From 2d5ad7dee89ebe9c014270882e44d3a7a8a626fd Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 8 Feb 2009 04:30:05 -0400 Subject: Added support for value expression definitions. Example: ] expr f(x) := x + 100 ] expr f(100) 200 --- src/token.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/token.cc') 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; -- cgit v1.2.3