diff options
author | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-12-19 13:13:10 -0300 |
---|---|---|
committer | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-12-19 13:13:10 -0300 |
commit | c5574a9e8396498769e1f2a91609d08cbb0f86eb (patch) | |
tree | 2c6e109132bc1f0b20a619dedd913cd20b18035b /testrelabelparser.lua | |
parent | c6b98103f0ab2c4afb7216e73f2eacac58cbf952 (diff) | |
download | lpeglabel-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.lua | 41 |
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 | ||
56 | testerror([['p' //{1}]], [[ | ||
57 | L1:C10: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' | ||
58 | 'p' //{1} | ||
59 | ^ | ||
60 | ]]) | ||
61 | |||
62 | testerror([['p' //{1} //{2} 'q']], [[ | ||
63 | L1:C10: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' | ||
64 | 'p' //{1} //{2} 'q' | ||
65 | ^ | ||
66 | ]]) | ||
67 | |||
68 | testerror([['p' /]], [[ | 56 | testerror([['p' /]], [[ |
69 | L1:C6: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' | 57 | L1:C6: expected a pattern after '/' |
70 | 'p' / | 58 | 'p' / |
71 | ^ | 59 | ^ |
72 | ]]) | 60 | ]]) |
73 | 61 | ||
74 | testerror([['p' / / 'q']], [[ | 62 | testerror([['p' / / 'q']], [[ |
75 | L1:C6: expected a pattern after '/' and '//{...}', or the label(s) after '/{' and '//{' | 63 | L1: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 | ||
254 | testerror([['p' ^ n]], [[ | 242 | testerror([['p' ^ n]], [[ |
255 | L1:C6: expected a number after '^', '+' or '-' (no space) | 243 | L1:C6: expected a number, '+', '-' or a name (no space) after '^' |
256 | 'p' ^ n | 244 | 'p' ^ n |
257 | ^ | 245 | ^ |
258 | ]]) | 246 | ]]) |
259 | 247 | ||
260 | testerror([['p'^+(+1)]], [[ | 248 | testerror([['p'^+(+1)]], [[ |
261 | L1:C5: expected a number after '^', '+' or '-' (no space) | 249 | L1:C5: expected a number, '+', '-' or a name (no space) after '^' |
262 | 'p'^+(+1) | 250 | 'p'^+(+1) |
263 | ^ | 251 | ^ |
264 | ]]) | 252 | ]]) |
265 | 253 | ||
266 | testerror([['p'^-/'q']], [[ | 254 | testerror([['p'^-/'q']], [[ |
267 | L1:C5: expected a number after '^', '+' or '-' (no space) | 255 | L1: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 | ||
354 | testerror([['p' //{} 'q']], [[ | 342 | testerror([['p' %{} 'q']], [[ |
355 | L1:C8: expected at least one label after '{' | 343 | L1:C7: expected a label after '{' |
356 | 'p' //{} 'q' | 344 | 'p' %{} 'q' |
357 | ^ | 345 | ^ |
358 | ]]) | 346 | ]]) |
359 | 347 | ||
360 | testerror([[%{ 'label' }]], [[ | 348 | testerror([[%{ 'label' }]], [[ |
361 | L1:C3: expected at least one label after '{' | 349 | L1:C3: expected a label after '{' |
362 | %{ 'label' } | 350 | %{ 'label' } |
363 | ^ | 351 | ^ |
364 | ]]) | 352 | ]]) |
365 | 353 | ||
366 | -- testing ExpLab2 | ||
367 | |||
368 | testerror([['p' //{1,2,3,} 'q']], [[ | ||
369 | L1: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 | ||