diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-08 04:30:05 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-08 04:30:05 -0400 |
commit | 2d5ad7dee89ebe9c014270882e44d3a7a8a626fd (patch) | |
tree | 20a6d2c34d86dcc9f68201dc1028f9053834ba7b /src/token.cc | |
parent | f7f5ed3d0fe96854f048609433fc68a3fb6fcf34 (diff) | |
download | fork-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.cc | 9 |
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; |