Skip to content

Commit dbb6538

Browse files
committed
close #119
1 parent 2a77910 commit dbb6538

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

LuaParser/src/Lexer/LuaLexer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,17 @@ LuaTokenKind LuaLexer::Lex() {
254254
}
255255
return '#';
256256
}
257+
case '{': {
258+
// extend syntax see issue 119
259+
_reader.SaveAndNext();
260+
if (_reader.CheckNext1('@')){
261+
_reader.EatWhile([](char ch) { return lislalnum(ch); });
262+
if (_reader.CheckNext1('}')){
263+
return TK_NAME;
264+
}
265+
}
266+
return '{';
267+
}
257268
default: {
258269
if (lislalpha(_reader.GetCurrentChar())) /* identifier or reserved word? */
259270
{

Test2/src/FormatTest2.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
int main() {
1010
std::string buffer = R"(
11-
local d = {
12-
dddd = 23131;
13-
}
11+
local d = {@123131}
1412
)";
1513

1614
auto file = std::make_shared<LuaFile>(std::move(buffer));

0 commit comments

Comments
 (0)