From b46d7cbbb27cdf2188cc734661f31c0259fed74d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?=
Date: Wed, 17 May 2017 13:55:03 +0200
Subject: [PATCH] n:class supports BEM (#156)
---
src/Latte/Compiler/MacroTokens.php | 2 +-
tests/Latte/expected/macros.n-macros.html | 2 +-
tests/Latte/expected/macros.n-macros.phtml | 2 +-
tests/Latte/templates/macros.n-macros.latte | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Latte/Compiler/MacroTokens.php b/src/Latte/Compiler/MacroTokens.php
index 9394f84d7..f4be32c16 100644
--- a/src/Latte/Compiler/MacroTokens.php
+++ b/src/Latte/Compiler/MacroTokens.php
@@ -50,7 +50,7 @@ public function parse($s)
self::T_CAST => '\((?:expand|string|array|int|integer|float|bool|boolean|object)\)', // type casting
self::T_VARIABLE => '\$[\w\pL_]+',
self::T_NUMBER => '[+-]?[0-9]+(?:\.[0-9]+)?(?:e[0-9]+)?',
- self::T_SYMBOL => '[\w\pL_]+(?:-[\w\pL_]+)*',
+ self::T_SYMBOL => '[\w\pL_]+(?:-+[\w\pL_]+)*',
self::T_CHAR => '::|=>|->|\+\+|--|<<|>>|<=>|<=|>=|===|!==|==|!=|<>|&&|\|\||\?\?|\?>|\*\*|\.\.\.|[^"\']', // =>, any char except quotes
], 'u');
return self::$tokenizer->tokenize($s);
diff --git a/tests/Latte/expected/macros.n-macros.html b/tests/Latte/expected/macros.n-macros.html
index 27fd4a921..0eefa7857 100644
--- a/tests/Latte/expected/macros.n-macros.html
+++ b/tests/Latte/expected/macros.n-macros.html
@@ -14,7 +14,7 @@
n:class
n:class empty
-
+n:class with BEM
diff --git a/tests/Latte/expected/macros.n-macros.phtml b/tests/Latte/expected/macros.n-macros.phtml
index 0ce85c43e..923698eca 100644
--- a/tests/Latte/expected/macros.n-macros.phtml
+++ b/tests/Latte/expected/macros.n-macros.phtml
@@ -52,7 +52,7 @@ class Template%a% extends Latte\Runtime\Template
>n:class
>n:class empty
-
+>n:class with BEM
n:class
n:class empty
-
+n:class with BEM