summaryrefslogtreecommitdiff
path: root/src/parser.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-23 15:04:07 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-23 15:04:07 -0400
commite919f53c9916af622d1995514c38be68e070ba49 (patch)
treeb70f68910a0a7bbfc114fd901dd02d21c2345e05 /src/parser.cc
parent9a44b8a547c44111ba467e2fc37a8c43dc205501 (diff)
downloadfork-ledger-e919f53c9916af622d1995514c38be68e070ba49.tar.gz
fork-ledger-e919f53c9916af622d1995514c38be68e070ba49.tar.bz2
fork-ledger-e919f53c9916af622d1995514c38be68e070ba49.zip
Renamed O_COMMA to O_CONS, and changed semantics
In the old scheme, nested values would simply flatten and concatenate, so that '((1, 2), 3) = (1, 2, 3)'. Now sublists are preserved, so that sequences may be passed as arguments to functions.
Diffstat (limited to 'src/parser.cc')
-rw-r--r--src/parser.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser.cc b/src/parser.cc
index 2dab4901..eacf0481 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -69,7 +69,8 @@ expr_t::parser_t::parse_value_term(std::istream& in,
}
case token_t::LPAREN:
- node = parse_value_expr(in, tflags.plus_flags(PARSE_PARTIAL).minus_flags(PARSE_SINGLE));
+ node = parse_value_expr(in, tflags.plus_flags(PARSE_PARTIAL)
+ .minus_flags(PARSE_SINGLE));
tok = next_token(in, tflags);
if (tok.kind != token_t::RPAREN)
tok.expected(')');
@@ -399,7 +400,7 @@ expr_t::parser_t::parse_value_expr(std::istream& in,
if (tok.kind == token_t::COMMA) {
ptr_op_t prev(node);
- node = new op_t(op_t::O_COMMA);
+ node = new op_t(op_t::O_CONS);
node->set_left(prev);
node->set_right(parse_value_expr(in, tflags));
if (! node->right())