> I came across this problem when writing the vim syntax file:
>
> How can we tell the difference between these?:
>
> m:option(pattern)
> m:option(argument)/pattern/
Easy. As A5 states, (...) are no longer leagal regex delimiters.
So the first is a syntax error.
:-)
Damian
Luke Palmer:
# I came across this problem when writing the vim syntax file:
#
# How can we tell the difference between these?:
#
# m:option(pattern)
# m:option(argument)/pattern/
The difference is that the first is a syntax error. :^) I think it
says that '(' is no longer a valid
I came across this problem when writing the vim syntax file:
How can we tell the difference between these?:
m:option(pattern)
m:option(argument)/pattern/
Luke
On Thu, 13 Jun 2002, David Whipp wrote:
: Second, we should eliminate as much of the syntactic noise as possible:
:
:
:
: would be nice -- with parenthesis, or the like, needed only when things
: become ambiguous. I think, though am not sure, that having whitespace act as
: an arglist separat
Luke Palmer wrote:
> So there's no elegant way the new regexes support it?
> That's a shame.
seems fairly elegant to me, with 2 caveats:
First, we need assertions as part of the default library. I.e. we shouldn't
need a C for things like min and max.
Second, we should eliminate as much of
I figured that (I actually did it, in a less-pretty form, in my early
Perl days when I wrote a syntax highlighter for my website). So there's
no elegant way the new regexes support it? That's a shame.
But I see now how state objects are a very cool idea.
Oh, and I'd just thought I'd let ever
Damian Conway:
# > I'm still unclear as to how you implement lex-like longest
# token rule
# > with P6 regexes. If the | operator grabs the first one it matches,
# > how do I match "bacamus" out of this?:
# >
# > "bacamus" =~ / b.*a | b.*s /
#
# Borrow this trick from Parse::RecDesce
> I'm still unclear as to how you implement lex-like longest token rule with
> P6 regexes. If the | operator grabs the first one it matches, how do I
> match "bacamus" out of this?:
>
> "bacamus" =~ / b.*a | b.*s /
Borrow this trick from Parse::RecDescent:
rule max (*@candidate
I'm still unclear as to how you implement lex-like longest token rule with
P6 regexes. If the | operator grabs the first one it matches, how do I
match "bacamus" out of this?:
"bacamus" =~ / b.*a | b.*s /
Luke