diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-21 15:52:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-21 15:52:55 +0800 |
commit | 195ed853f29255beea4a1a008db42615b57b7d22 (patch) | |
tree | fd015087c22e59c8e649f73ca69b106696cb3f4d /server/src | |
parent | b7f804de230d3bad149fc74971ca55b12175fb66 (diff) | |
download | lua-language-server-195ed853f29255beea4a1a008db42615b57b7d22.zip |
更新语法解析
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/parser/grammar.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua index df98833e..942c23fc 100644 --- a/server/src/parser/grammar.lua +++ b/server/src/parser/grammar.lua @@ -207,8 +207,8 @@ Boolean <- Sp ({} -> True) TRUE grammar 'String' [[ String <- Sp ({} StringDef {}) -> String -StringDef <- '"' {~(Esc / !%nl !'"' .)*~} -> first '"' - / "'" {~(Esc / !%nl !"'" .)*~} -> first "'" +StringDef <- '"' {~(Esc / !%nl !'"' .)*~} -> first (%nl / '"'?) + / "'" {~(Esc / !%nl !"'" .)*~} -> first (%nl / "'"?) / '[' {:eq: '='* :} '[' {(!StringClose .)*} -> first StringClose StringClose <- ']' =eq ']' ]] @@ -268,7 +268,7 @@ Suffix <- DOT MustName / Sp ({} Table {}) -> Call / Sp ({} String {}) -> Call / BL Exp -> Index BR - / Sp ({} PL ExpList PR {}) -> Call + / Sp ({} PL ExpList PR? {}) -> Call DirtyExp <- Exp / DirtyName ExpList <- (COMMA DirtyExp)+ @@ -290,7 +290,7 @@ AfterArg <- DOTS / MustName -Table <- Sp ({} TL TableFields TR {}) +Table <- Sp ({} TL TableFields TR? {}) -> Table TableFields <- TableSep (TableSep? TableField)+ TableSep? / (TableField (TableSep? TableField)* TableSep?)? |