summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-04-22 15:00:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-04-22 15:00:59 +0800
commit3cbb4891100a864e17af5a77dec23942caea3577 (patch)
treee628eaa410df96e8aa69aca3cd087313b6d4f3e0
parente5b2ed3fff12a38a24055fb2a1633c8c24c33edf (diff)
downloadlua-language-server-3cbb4891100a864e17af5a77dec23942caea3577.zip
fix #156
-rw-r--r--script/glob/gitignore.lua4
-rw-r--r--script/glob/glob.lua6
2 files changed, 7 insertions, 3 deletions
diff --git a/script/glob/gitignore.lua b/script/glob/gitignore.lua
index f96aa627..315efa37 100644
--- a/script/glob/gitignore.lua
+++ b/script/glob/gitignore.lua
@@ -35,7 +35,9 @@ local parser = m.P {
+ object('?', m.P'?')
+ object('[]', m.V'Range')
,
- ['Char'] = object('char', (1 - m.S',{}[]*?/\\')^1),
+ ['SimpleChar'] = m.P(1) - m.S',{}[]*?/',
+ ['EscChar'] = m.P'\\' / '' * m.P(1),
+ ['Char'] = object('char', m.Cs((m.V'EscChar' + m.V'SimpleChar')^1)),
['FSymbol'] = object('**', m.P'**'),
['Range'] = m.P'[' * m.Ct(m.V'RangeUnit'^0) * m.P']'^-1,
['RangeUnit'] = m.Ct(- m.P']' * m.C(m.P(1)) * (m.P'-' * - m.P']' * m.C(m.P(1)))^-1),
diff --git a/script/glob/glob.lua b/script/glob/glob.lua
index aa8923f3..9cfbdc7e 100644
--- a/script/glob/glob.lua
+++ b/script/glob/glob.lua
@@ -19,7 +19,7 @@ end
local parser = m.P {
'Main',
['Sp'] = m.S(' \t')^0,
- ['Slash'] = m.S('/\\')^1,
+ ['Slash'] = m.P('/')^1,
['Main'] = m.Ct(m.V'Sp' * m.P'{' * m.V'Pattern' * (',' * expect(m.V'Pattern', 'Miss exp after ","'))^0 * m.P'}')
+ m.Ct(m.V'Pattern')
+ m.T'Main Failed'
@@ -35,7 +35,9 @@ local parser = m.P {
+ object('?', m.P'?')
+ object('[]', m.V'Range')
,
- ['Char'] = object('char', (1 - m.S',{}[]*?/\\')^1),
+ ['SimpleChar'] = m.P(1) - m.S',{}[]*?/',
+ ['EscChar'] = m.P'\\' / '' * m.P(1),
+ ['Char'] = object('char', m.Cs((m.V'EscChar' + m.V'SimpleChar')^1)),
['FSymbol'] = object('**', m.P'**'),
['RangeWord'] = 1 - m.P']',
['Range'] = m.P'[' * m.Ct(m.V'RangeUnit'^0) * m.P']'^-1,