diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-15 19:40:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-15 19:40:51 -0700 |
commit | ccb946d7e3a64dd501f21e5859de81fc127f816b (patch) | |
tree | 6bb0b870144c1f0454e5a68145943bf755549e7e /parser.y | |
parent | 4199307ffb1902b77eac48c8a05dad55daaed650 (diff) | |
download | txr-ccb946d7e3a64dd501f21e5859de81fc127f816b.tar.gz txr-ccb946d7e3a64dd501f21e5859de81fc127f816b.tar.bz2 txr-ccb946d7e3a64dd501f21e5859de81fc127f816b.zip |
parser: support uref dot as top-level expr.
* parser.y (hash_semi_oor_n_expr, hash_semi_or_i_expr): add
grammar rules for leading dot.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -198,13 +198,21 @@ spec : clauses_opt { parser->syntax_tree = $1; } hash_semi_or_n_expr : HASH_SEMI { parser->circ_suppress = 1; } n_expr { parser->circ_suppress = 0; $$ = nao; } + | HASH_SEMI '.' { parser->circ_suppress = 1; } + n_expr { parser->circ_suppress = 0; + $$ = nao; } | n_expr { $$ = $1; } + | '.' n_expr { $$ = uref_helper(parser, $2); } ; hash_semi_or_i_expr : HASH_SEMI { parser->circ_suppress = 1; } i_expr { parser->circ_suppress = 0; $$ = nao; } + | HASH_SEMI '.' { parser->circ_suppress = 1; } + i_expr { parser->circ_suppress = 0; + $$ = nao; } | i_expr { $$ = $1; } + | '.' i_expr { $$ = uref_helper(parser, $2); } ; |