Discussion:
[ragel-users] Basic question on use of grouping in Ragel
Programmist Setevik
2013-04-21 11:06:48 UTC
Permalink
Reading through Ragel guide, I see examples like this one:

# Match a word followed by a newline. Execute A when
# finishing the word.
main :=* (* lower+ %A *)* . '\n';

Question I have is: why is grouping used here ? Could this be written
simply as

main :=* * lower+ %A . '\n';

And if not, what would be the difference ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.complang.org/pipermail/ragel-users/attachments/20130421/57939613/attachment.html>
Adrian Thurston
2013-06-23 17:42:52 UTC
Permalink
It is unnecessary, only there to make the parse of the expression explicit.
Post by Programmist Setevik
# Match a word followed by a newline. Execute A when
# finishing the word.
main :=*(* lower+ %A *)* . '\n';
Question I have is: why is grouping used here ? Could this be written
simply as
main :=** lower+ %A . '\n';
And if not, what would be the difference ?
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
Loading...