summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-14 06:53:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-03-14 06:53:16 -0700
commit96f072cfdb5d1eac3e32dbdb15704b0a32258a37 (patch)
treeb25990f165c0485db4f990a4e721191b4b8380d5 /parser.l
parent7f0f22c4e455f457d37ddf542b36c49db20d16af (diff)
downloadtxr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.tar.gz
txr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.tar.bz2
txr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.zip
Implementing #H((...) ...) read/print syntax for hash tables.
* hash.c (print_key_val, hash_print_op): New static functions. (hash_ops): hash_print_op wired in in place of cobj_print_op. * parser.l (HASH_H): New token recognized. * parser.y (HASH_H): New terminal symbol. (hash): New nonterminal symbol. (expr): Acquires hash as a constituent. (hash_from_notation): New static function. * txr.1: Hash syntax described. * txr.vim: Updated.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index f7a655db..76ba8203 100644
--- a/parser.l
+++ b/parser.l
@@ -461,6 +461,11 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return '#';
}
+<NESTED,BRACED>#H {
+ yylval.lineno = lineno;
+ return HASH_H;
+}
+
<NESTED>\.\. {
yylval.lineno = lineno;
return DOTDOT;