$from(action_name);
Verbose embeddings without parentheses can make code difficult to read
because they force a space in the middle of an action embedding. There is a
tendency to associtate spaces with concatenation. Without syntax
highlighting to make it clear that the embedding type is a keyword, the
problem is especially bad. The danger is that a verbose embedding could be
read as an embedding of the embedding type:
main := 'foo' $from some_action '\n';
With parentheses this statment reads much more clearly.
main := 'foo' $from(some_action) '\n';
git-svn-id: http://svn.complang.org/ragel/trunk@126
052ea7fc-9027-0410-9066-
f65837a77df0
+For Next Release
+================
+ -Added a new syntax for verbose embeddings. This adds parentheses:
+ $from(action_name);
+ Verbose embeddings without parentheses can make code difficult to read
+ because they force a space in the middle of an action embedding. There is a
+ tendency to associtate spaces with concatenation. Without syntax
+ highlighting to make it clear that the embedding type is a keyword, the
+ problem is especially bad. The danger is that a verbose embedding could be
+ read as an embedding of the embedding type:
+ main := 'foo' $from some_action '\n';
+ With parentheses this statment reads much more clearly.
+ main := 'foo' $from(some_action) '\n';
+
Ragel 5.18 - February 13, 2007
==============================
-There is now a 100% correspondence between state id numbers in the
used. Perhaps a unique name for each instance of the current machine should be
used instead. This idea could work well if applied to user-defined embeddings.
-Verbose embeddings %eof a to $eof(a).
User defined embeddings <-name(a1,a2,...).
User defined operators expr1 <name> expr2.
nonterm action_embed uses action_ref;
action_embed: action_embed_word final { $$->action = $1->action; };
+action_embed: '(' action_embed_word ')' final { $$->action = $2->action; };
action_embed: action_embed_block final { $$->action = $1->action; };
nonterm action_embed_word uses action_ref;