summaryrefslogtreecommitdiff
path: root/server/src/parser/grammar.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-31 11:58:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-31 11:58:36 +0800
commitbbab1b7fd1085e470d05b5e064ed5c655f264b45 (patch)
tree2df514666c105e0a0364c170c553d8eca89d4fdf /server/src/parser/grammar.lua
parentbf8399c9057927d6746b47915a7b79c62d1082bd (diff)
downloadlua-language-server-bbab1b7fd1085e470d05b5e064ed5c655f264b45.zip
更新语法检查
Diffstat (limited to 'server/src/parser/grammar.lua')
-rw-r--r--server/src/parser/grammar.lua19
1 files changed, 3 insertions, 16 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index a840a7a0..18118ac6 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -313,25 +313,12 @@ AfterArg <- DOTS
/ MustName
-Table <- ({} TL TR {})
+Table <- Sp ({} TL TableFields DirtyTR {})
-> Table
- / ({} TL TableFields DirtyTR {})
- -> Table
- / ({} TL DirtyTR {})
- -> Table
-TableFields <- TableField
- (TableAfterF)*
- LastTableSep?
- / DirtyExp
- (TableAfterF)+
- LastTableSep?
-TableAfterF <- TableSep !TR TableField
- / Sp ({} {(!TR !COMMA !SEMICOLON !Word !BL .)+})
+TableFields <- (TableSep {} / TableField / DirtyField)*
+DirtyField <- Sp ({} {(!TR !COMMA !SEMICOLON !Word !BL .)+})
-> UnknownSymbol
TableSep <- COMMA / SEMICOLON
- / {}
- -> MissTableSep
-LastTableSep<- COMMA / SEMICOLON
TableField <- NewIndex / NewField / Exp
NewIndex <- (BL DirtyExp DirtyBR DirtyAssign DirtyExp)
-> NewIndex