From 682c572eea51cd69308dfc7b7aa184bb3c292782 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sat, 20 Jun 2009 16:12:10 +0000 Subject: [PATCH] Allow function and method calls as lhs of equations --- chaiscript/chaiscript_engine.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chaiscript/chaiscript_engine.hpp b/chaiscript/chaiscript_engine.hpp index 08c7e01c..cc7cc3dd 100644 --- a/chaiscript/chaiscript_engine.hpp +++ b/chaiscript/chaiscript_engine.hpp @@ -157,11 +157,11 @@ namespace chaiscript params = Id(TokenType::Identifier) >> *(Ign(Str(",")) >> Id(TokenType::Identifier)); block = *(Ign(Id(TokenType::Semicolon))) >> Ign(Id(TokenType::Curly_Open)) >> *(Ign(Id(TokenType::Semicolon))) >> ~statement_list >> *(Ign(Id(TokenType::Semicolon))) >> Ign(Id(TokenType::Curly_Close)); - equation = *(((vardecl | arraycall | Id(TokenType::Identifier)) >> Str("=")) | - ((vardecl | arraycall | Id(TokenType::Identifier)) >> Str("+=")) | - ((vardecl | arraycall | Id(TokenType::Identifier)) >> Str("-=")) | - ((vardecl | arraycall | Id(TokenType::Identifier)) >> Str("*=")) | - ((vardecl | arraycall | Id(TokenType::Identifier)) >> Str("/="))) >> boolean; + equation = *(((vardecl | arraycall | funcall | methodcall | Id(TokenType::Identifier)) >> Str("=")) | + ((vardecl | arraycall | funcall | methodcall | Id(TokenType::Identifier)) >> Str("+=")) | + ((vardecl | arraycall | funcall | methodcall | Id(TokenType::Identifier)) >> Str("-=")) | + ((vardecl | arraycall | funcall | methodcall | Id(TokenType::Identifier)) >> Str("*=")) | + ((vardecl | arraycall | funcall | methodcall | Id(TokenType::Identifier)) >> Str("/="))) >> boolean; boolean = comparison >> *((Str("&&") >> comparison) | (Str("||") >> comparison)); comparison = expression >> *((Str("==") >> expression) | (Str("!=") >> expression) | (Str("<") >> expression) | (Str("<=") >> expression) |(Str(">") >> expression) | (Str(">=") >> expression));