summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-15 19:40:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-15 19:40:51 -0700
commitccb946d7e3a64dd501f21e5859de81fc127f816b (patch)
tree6bb0b870144c1f0454e5a68145943bf755549e7e /parser.y
parent4199307ffb1902b77eac48c8a05dad55daaed650 (diff)
downloadtxr-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.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index 5e321c2f..427a3fc1 100644
--- a/parser.y
+++ b/parser.y
@@ -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); }
;