Allow using the constant "pi" in expressions.

pull/4/head
whitequark 2015-09-21 07:28:55 +03:00
parent ef3ee55d42
commit c6194d439c
1 changed files with 3 additions and 0 deletions

View File

@ -780,6 +780,9 @@ void Expr::Lex(const char *in) {
} else if(strcmp(name, "sin")==0) {
e->op = UNARY_OP;
e->x.c = 's';
} else if(strcmp(name, "pi")==0) {
e->op = CONSTANT;
e->x.v = PI;
} else {
throw "unknown name";
}