Révision | 545a23932684bc1c0146fcb40758c5a409cddb9d (tree) |
---|---|
l'heure | 2015-11-06 09:57:14 |
Auteur | MirrgieRiana |
Commiter | MirrgieRiana |
mirrg.compile.lithiumbromide: ブロックコメントに関するバグを修正
@@ -55,7 +55,7 @@ | ||
55 | 55 | or((Class<ArrayList<?>>) null) |
56 | 56 | .or(HBromine.regex("[ \\t\\r\\n]+", tag -> null)) |
57 | 57 | .or(HBromine.regex("//[^\\r\\n]*", tag -> null)) |
58 | - .or(HBromine.regex("/\\*((.|\\r|\\n)(?<!\\*/))*\\*/", tag -> null)), | |
58 | + .or(HBromine.regex("/\\*(.|[\\r\\n])*?\\*/", tag -> null)), | |
59 | 59 | (node, index, child) -> {} , (node, index) -> {}); |
60 | 60 | |
61 | 61 | Syntax<NodeString> syntaxString = h.regex("'([^\\']|\\.)*'", |
@@ -181,6 +181,21 @@ | ||
181 | 181 | 3, 0, 0.001); |
182 | 182 | |
183 | 183 | assert1(compiler, |
184 | + "1+/**/2", | |
185 | + "1 + 2", | |
186 | + 3, 0, 0.001); | |
187 | + | |
188 | + assert1(compiler, | |
189 | + "1+/*/*/2", | |
190 | + "1 + 2", | |
191 | + 3, 0, 0.001); | |
192 | + | |
193 | + assert1(compiler, | |
194 | + "1+/* \r\n */2", | |
195 | + "1 + 2", | |
196 | + 3, 0, 0.001); | |
197 | + | |
198 | + assert1(compiler, | |
184 | 199 | "1+// 500\n2", |
185 | 200 | "1 + 2", |
186 | 201 | 3, 0, 0.001); |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // コメント |
3 | 3 | comment := { "[ \t\r\n]+" |
4 | 4 | | "//[^\r\n]*" |
5 | - | "/\*((.|\r|\n)(?<!\*/))*\*/" | |
5 | + | "/\*(.|[\r\n])*?\*/" | |
6 | 6 | }; |
7 | 7 | |
8 | 8 | // リテラル |