diff options
author | Undecidable Robot <undecidabot@gmail.com> | 2016-05-16 18:32:41 +0800 |
---|---|---|
committer | Undecidable Robot <undecidabot@gmail.com> | 2016-05-16 18:32:41 +0800 |
commit | a782cf72be84a10a95be301fce6e432b6e747814 (patch) | |
tree | 78f365e76898426f57beea31f354c37b542928a2 /testerrors.lua | |
parent | 08296c5f604ad40428e642f09fd9b4b479e329cc (diff) | |
download | lpeglabel-a782cf72be84a10a95be301fce6e432b6e747814.tar.gz lpeglabel-a782cf72be84a10a95be301fce6e432b6e747814.tar.bz2 lpeglabel-a782cf72be84a10a95be301fce6e432b6e747814.zip |
Unifying reporting of syntactic and semantic error messages
Diffstat (limited to 'testerrors.lua')
-rw-r--r-- | testerrors.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/testerrors.lua b/testerrors.lua index dff35df..ab1c665 100644 --- a/testerrors.lua +++ b/testerrors.lua | |||
@@ -99,7 +99,7 @@ local patterns = { | |||
99 | [[{||}]], | 99 | [[{||}]], |
100 | [[{|@|}]], | 100 | [[{|@|}]], |
101 | [['p' {| 'q' / 'r' }]], | 101 | [['p' {| 'q' / 'r' }]], |
102 | -- 71-73 | 102 | -- 71-75 |
103 | [['a'/{1}'b'/'c']], | 103 | [['a'/{1}'b'/'c']], |
104 | [[x <- {:x:}]], | 104 | [[x <- {:x:}]], |
105 | [[&'p'/&/!/'p'^'q']], | 105 | [[&'p'/&/!/'p'^'q']], |
@@ -107,7 +107,21 @@ local patterns = { | |||
107 | A <- 'a' (B 'b' | 107 | A <- 'a' (B 'b' |
108 | B <- 'x' / ! | 108 | B <- 'x' / ! |
109 | C <- 'c' | 109 | C <- 'c' |
110 | ]] | 110 | ]], |
111 | [[ | ||
112 | A <- %nosuch %def | ||
113 | A <- 'A again' | ||
114 | A <- 'and again' | ||
115 | ]], | ||
116 | -- 76 - 79 | ||
117 | [[names not in grammar]], | ||
118 | [[ | ||
119 | A <- %nosuch %def | ||
120 | A <- 'A again' | ||
121 | A <- 'and again' | ||
122 | ]], | ||
123 | [[ A <- %nosuch ('error' ]], | ||
124 | [[A <- Unknown Rules]] | ||
111 | } | 125 | } |
112 | 126 | ||
113 | for i, patt in ipairs(patterns) do | 127 | for i, patt in ipairs(patterns) do |