[svn:parrot] r37868 - trunk/compilers/pge/PGE
pmichaud at svn.parrot.org
pmichaud at svn.parrot.org
Thu Apr 2 04:29:06 UTC 2009
Author: pmichaud
Date: Thu Apr 2 04:29:05 2009
New Revision: 37868
URL: https://trac.parrot.org/parrot/changeset/37868
Log:
[pge]: Improve error message on unrecognized char names.
Whitespace allowed inside of \c[...], \o[...], \x[...].
Modified:
trunk/compilers/pge/PGE/Perl6Regex.pir
Modified: trunk/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- trunk/compilers/pge/PGE/Perl6Regex.pir Thu Apr 2 03:13:28 2009 (r37867)
+++ trunk/compilers/pge/PGE/Perl6Regex.pir Thu Apr 2 04:29:05 2009 (r37868)
@@ -202,6 +202,10 @@
goto succeed
scan_xco_char:
decnum = 0
+ # inside brackets, skip leading ws
+ unless isbracketed goto scan_xco_char_ws
+ pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
+ scan_xco_char_ws:
if base != 10 goto scan_xco_char_digits
unless isbracketed goto scan_xco_char_digits
$I0 = is_cclass .CCLASS_NUMERIC, target, pos
@@ -251,7 +255,8 @@
.return (mob)
err_unicode_name:
- 'parse_error'(mob, pos, "Unrecognized character name")
+ $S0 = concat "Unrecognized character name ", $S0
+ 'parse_error'(mob, pos, $S0)
err_missing_bracket:
'parse_error'(mob, pos, "Missing close bracket for \\x[...], \\o[...], or \\c[...]")
err_digit:
More information about the parrot-commits
mailing list