Allow using the constant "pi" in expressions.

This commit is contained in:
whitequark 2015-09-21 07:28:55 +03:00
parent ef3ee55d42
commit c6194d439c

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";
}