aboutsummaryrefslogtreecommitdiff
path: root/testrelabelparser.lua
diff options
context:
space:
mode:
authorSérgio Queiroz <sqmedeiros@gmail.com>2017-12-19 13:13:10 -0300
committerSérgio Queiroz <sqmedeiros@gmail.com>2017-12-19 13:13:10 -0300
commitc5574a9e8396498769e1f2a91609d08cbb0f86eb (patch)
tree2c6e109132bc1f0b20a619dedd913cd20b18035b /testrelabelparser.lua
parentc6b98103f0ab2c4afb7216e73f2eacac58cbf952 (diff)
downloadlpeglabel-c5574a9e8396498769e1f2a91609d08cbb0f86eb.tar.gz
lpeglabel-c5574a9e8396498769e1f2a91609d08cbb0f86eb.tar.bz2
lpeglabel-c5574a9e8396498769e1f2a91609d08cbb0f86eb.zip
Updating relabel's parser after removing /{} and //{}
Diffstat (limited to 'testrelabelparser.lua')
-rw-r--r--testrelabelparser.lua41
1 files changed, 11 insertions, 30 deletions
diff --git a/testrelabelparser.lua b/testrelabelparser.lua
index 2ca8528..0399ff6 100644
--- a/testrelabelparser.lua
+++ b/testrelabelparser.lua
@@ -53,26 +53,14 @@ L1:C5: unexpected characters after the pattern
53 53
54-- testing ExpPatt1 54-- testing ExpPatt1
55 55
56testerror([['p' //{1}]], [[
57L1:C10: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{'
58'p' //{1}
59 ^
60]])
61
62testerror([['p' //{1} //{2} 'q']], [[
63L1:C10: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{'
64'p' //{1} //{2} 'q'
65 ^
66]])
67
68testerror([['p' /]], [[ 56testerror([['p' /]], [[
69L1:C6: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' 57L1:C6: expected a pattern after '/'
70'p' / 58'p' /
71 ^ 59 ^
72]]) 60]])
73 61
74testerror([['p' / / 'q']], [[ 62testerror([['p' / / 'q']], [[
75L1:C6: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' 63L1:C6: expected a pattern after '/'
76'p' / / 'q' 64'p' / / 'q'
77 ^ 65 ^
78]]) 66]])
@@ -249,22 +237,22 @@ L1:C2: expected a pattern or closing '}' after '{'
249 ^ 237 ^
250]]) 238]])
251 239
252-- testing ExpNum 240-- testing ExpNumName
253 241
254testerror([['p' ^ n]], [[ 242testerror([['p' ^ n]], [[
255L1:C6: expected a number after '^', '+' or '-' (no space) 243L1:C6: expected a number, '+', '-' or a name (no space) after '^'
256'p' ^ n 244'p' ^ n
257 ^ 245 ^
258]]) 246]])
259 247
260testerror([['p'^+(+1)]], [[ 248testerror([['p'^+(+1)]], [[
261L1:C5: expected a number after '^', '+' or '-' (no space) 249L1:C5: expected a number, '+', '-' or a name (no space) after '^'
262'p'^+(+1) 250'p'^+(+1)
263 ^ 251 ^
264]]) 252]])
265 253
266testerror([['p'^-/'q']], [[ 254testerror([['p'^-/'q']], [[
267L1:C5: expected a number after '^', '+' or '-' (no space) 255L1:C5: expected a number, '+', '-' or a name (no space) after '^'
268'p'^-/'q' 256'p'^-/'q'
269 ^ 257 ^
270]]) 258]])
@@ -351,25 +339,18 @@ L1:C2: expected the name of a rule after '<' (no space)
351 339
352-- testing ExpLab1 340-- testing ExpLab1
353 341
354testerror([['p' //{} 'q']], [[ 342testerror([['p' %{} 'q']], [[
355L1:C8: expected at least one label after '{' 343L1:C7: expected a label after '{'
356'p' //{} 'q' 344'p' %{} 'q'
357 ^ 345 ^
358]]) 346]])
359 347
360testerror([[%{ 'label' }]], [[ 348testerror([[%{ 'label' }]], [[
361L1:C3: expected at least one label after '{' 349L1:C3: expected a label after '{'
362%{ 'label' } 350%{ 'label' }
363 ^ 351 ^
364]]) 352]])
365 353
366-- testing ExpLab2
367
368testerror([['p' //{1,2,3,} 'q']], [[
369L1:C14: expected a label after the comma
370'p' //{1,2,3,} 'q'
371 ^
372]])
373 354
374-- testing ExpNameOrLab 355-- testing ExpNameOrLab
375 356