Skip to content

Commit 7c6c72c

Browse files
committed
unquoted strings can contain '.' [WIP]
1 parent c3b7348 commit 7c6c72c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/Latte/Compiler/TagLexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function tokenizeCode(): void
124124
(?<Php_NameFullyQualified> \\ (?&label) ( \\ (?&label) )* )|
125125
(?<Php_NameQualified> (?&label) ( \\ (?&label) )+ )|
126126
(?<Php_IdentifierFollowed> (?&label) (?= [ \t\r\n]* [(&=] ) )|
127-
(?<Php_Identifier> (?&label)(--?[a-zA-Z0-9_\x80-\xff]+)* )|
127+
(?<Php_Identifier> (?&label)((--?|\.)[a-zA-Z0-9_\x80-\xff]+)* )|
128128
(
129129
(
130130
(?<Php_ObjectOperator> -> )|

tests/phpPrint/unquotedStrings.phpt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ $test = <<<'XX'
1818
a-b-c,
1919
a--b--c,
2020
21-
/* usage */
21+
/* dots */
2222
a.b,
23+
a . b,
24+
25+
/* usage */
2326
a-b.c-d,
27+
a.b(),
2428
foo(aa, bb, cc)
2529
XX;
2630

@@ -39,6 +43,8 @@ __halt_compiler();
3943
MD5,
4044
'a-b-c',
4145
'a--b--c',
46+
'a.b',
4247
'a' . 'b',
43-
'a-b' . 'c-d',
48+
'a-b.c-d',
49+
a.b(),
4450
foo('aa', 'bb', 'cc')

0 commit comments

Comments
 (0)