summaryrefslogtreecommitdiffstats
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
commit510caa23aa66e783e967e991623a7327fd2e58c4 (patch)
tree6bb0b870144c1f0454e5a68145943bf755549e7e
parente4a571c3f71286d6a314052759c5a73d817b2baa (diff)
downloadtxr-510caa23aa66e783e967e991623a7327fd2e58c4.tar.gz
txr-510caa23aa66e783e967e991623a7327fd2e58c4.tar.bz2
txr-510caa23aa66e783e967e991623a7327fd2e58c4.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.
-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); }
;