summaryrefslogtreecommitdiff
path: root/src/token.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-08 04:30:05 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-08 04:30:05 -0400
commit2d5ad7dee89ebe9c014270882e44d3a7a8a626fd (patch)
tree20a6d2c34d86dcc9f68201dc1028f9053834ba7b /src/token.cc
parentf7f5ed3d0fe96854f048609433fc68a3fb6fcf34 (diff)
downloadfork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.tar.gz
fork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.tar.bz2
fork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.zip
Added support for value expression definitions.
Example: ] expr f(x) := x + 100 ] expr f(100) 200
Diffstat (limited to 'src/token.cc')
-rw-r--r--src/token.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/token.cc b/src/token.cc
index f7133af3..9311f60a 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -258,6 +258,15 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
break;
case ':':
in.get(c);
+ c = in.peek();
+ if (c == '=') {
+ in.get(c);
+ symbol[1] = c;
+ symbol[2] = '\0';
+ kind = DEFINE;
+ length = 2;
+ break;
+ }
kind = COLON;
break;