On Sat, May 14, 2005 at 03:31:21PM +0200, Leopold Toetsch wrote:
> Jerry Gay <[EMAIL PROTECTED]> wrote:
> > with parrot revision 8086, i'm running the following:
>
> > .sub main @MAIN
> > load_bytecode 'PGE.pbc'
> > .local pmc p6rule, rulesub, match
> > p6rule= find_global 'PGE', 'p6rule'
> > rulesub= p6rule( '( \\ \. )+ \\' )
> > .end
> > which, under parrot -t, gives thousands of lines of output.
> > eventually, i get the following...
> > error:imcc:op not found 'index' (index<1>)
>
> Inserting:
> print $S0
> before the C<compile> in P6Rule.pir:876 reveals the culprit:
> $I0 = index "\", $S0
> i.e. an unescapted backslash inside double quotes.
This particular bug is now fixed in r8102.
PGE is not yet complete in its handling of escape sequences
in literal strings -- there are just a lot of them to be handled.
For example:
rx / \n / # match a newline character (a character class)
rx / <"\n"> / # match a literal newline (probably \012)
rx / <'\n'> / # match a backslash + n
and for any literal string that PGE generates it must be sure that
it's properly escaped for PIR. (Fortunately this past week I found
Data::Escape which helps quite a bit.)
> OTOH there is also:
> lit = '\\'
> which should have double quotes to mean a single slash.
Hmmm, that seems odd. I looked in P6PE to find out about string
literal escapes and basically came away with "they work like Perl 5",
but occasionally I've noticed places where there's a mismatch...
such as this one. I couldn't find anything about string literals
in the Parrot docs -- is it documented somewhere?
Pm