parseExpression method

void parseExpression(
  1. JrlLine line,
  2. String source,
  3. RegExp expPresent
)

check if it can be evaluated with expressions: ^0.2.3:

Implementation

void parseExpression(JrlLine line,String source, RegExp expPresent) {
  //we need to extract the variables
  RegExp rex = RegExp(r"(\(.*\))");
  rex.allMatches(source).forEach((match)
  {
    String testExp = match.group(1).toString();
    testExp = testExp.replaceAll("#", "");
    try {
      Expression expression = Expression.parse(testExp);
      expressions[match.group(1)!] = expression;
      //print("adding expression ${match.group(1)} with $expression");
      //line.valexp =expression ?? new Expression();//force invalid value
      line.valexp =expression;//force invalid value
    }
    catch(e){
      print("error parsing expression '$testExp'");
    }
  });
}