lib/regextest/front/scanner.rb in regextest-0.1.5 vs lib/regextest/front/scanner.rb in regextest-0.1.6
- old
+ new
@@ -18,17 +18,19 @@
[:LEX_BACK_REFER,
%r!\\[1-9]\d*! ],
[:LEX_CODE_LITERAL,
LexCodeLiteral ],
[:LEX_NAMED_REFER,
- %r!\\k[<'](?:\-?\d+|\w+)(?:[\+\-]\d+)?[>']! ],
+ %r!(?u:\\k[<'](?:\-?\d+|\w+)(?:[\+\-]\d+)?[>'])! ],
[:LEX_NAMED_GENERATE,
- %r!\\g[<'][\+\-]?\w+[>']! ],
+ %r!(?u:\\g[<'][\+\-]?\w+[>'])! ],
[:LEX_CONTROL_LETTER,
- %r!\\c[a-zA-Z]|\\C-[a-zA-Z]|\\c\\\\|\\C-\\\\! ],
+ %r!\\c\\\\|\\C-\\\\|\\c[0-~]|\\C-[0-~]! ],
+ [:LEX_META_CONTROL_LETTER,
+ %r!\\M-\\C-[0-~]! ],
[:LEX_META_LETTER,
- %r!\\M-(?:[a-zA-Z]|\\C-[a-zA-Z])! ],
+ %r!\\M-[0-~]! ],
[:LEX_ESCAPED_LETTER,
%r!\\[tvnrfae #\{\}\[\]\(\)]! ], # \b is an anchor out of bracket
[:LEX_UNICODE,
%r!\\u\h{4}|\\u\{\h{1,6}(?:\s+\h{1,6})*\}! ],
# [:LEX_POSIX_CHAR_CLASS, # invalid out of bracket
@@ -48,18 +50,19 @@
[:LEX_PAREN_START_EX1,
%r!\(\?(?=\w*x)[imxdau]+(?:\-[im]*)?(?::|(?=\)))! ], # (?x-im: ... )
[:LEX_PAREN_START_EX2,
%r!\(\?[imxdau]*(?:\-(?=\w*x)[imx]+)?(?::|(?=\)))! ], # (?im-x: ... )
[:LEX_PAREN_START,
- %r!\(\?<\w+>|
- \(\?'\w+'|
- \(\?\(\d+\)|
- \(\?\(<\w+>\)|
- \(\?\('\w+'\)|
- \(\?[imdau]*(?:\-[im]*)?(?::|(?=\)))| # expressions independent of "x"
- \(\?\<[\=\!]|
- \(\?.| # for better error message
- \(
+ %r!(?u:\(\?<\w+>|
+ \(\?'\w+'|
+ \(\?\(\d+\)|
+ \(\?\(<\w+>\)|
+ \(\?\('\w+'\)|
+ \(\?[imdau]*(?:\-[im]*)?(?::|(?=\)))| # expressions independent of "x"
+ \(\?\<[\=\!]|
+ \(\?.| # for better error message
+ \(
+ )
!x ],
[:LEX_PAREN_END,
%r!\)! ],
[:LEX_BRACKET, # considering nested bracket
# %r!(?<bs>\[(?:\[:\^?\w+:\]|\\\]|\\.|[^\]\[]|\g<bs>)+\])! ],