diff options
Diffstat (limited to 'script-beta/parser/grammar.lua')
-rw-r--r-- | script-beta/parser/grammar.lua | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/script-beta/parser/grammar.lua b/script-beta/parser/grammar.lua index 292f0e52..06dae246 100644 --- a/script-beta/parser/grammar.lua +++ b/script-beta/parser/grammar.lua @@ -1,6 +1,5 @@ local re = require 'parser.relabel' local m = require 'lpeglabel' -local emmy = require 'parser.emmy' local ast = require 'parser.ast' local scriptBuf = '' @@ -93,15 +92,13 @@ LongComment <- ('--[' {} {:eq: '='* :} {} '[' ) -> CLongComment CommentClose <- ']' =eq ']' -ShortComment <- (!%nl .)* +ShortComment <- ({} {(!%nl .)*} {}) + -> ShortComment ]] grammar 'Sp' [[ -Sp <- (EmmyLua / Comment / %nl / %s)* -Sps <- (EmmyLua / Comment / %nl / %s)+ - --- 占位 -EmmyLua <- !. . +Sp <- (Comment / %nl / %s)* +Sps <- (Comment / %nl / %s)+ ]] grammar 'Common' [[ @@ -522,8 +519,6 @@ FuncName <- {| Single (Sp SuffixWithoutCall)* |} / {} -> MissName %nil ]] ---grammar 'EmmyLua' (emmy.grammar) - grammar 'Lua' [[ Lua <- Head? ({} {| Action* |} {}) -> Lua |