multi-line expressions
This commit is contained in:
parent
298883939b
commit
7ae9ddaee9
@ -5,7 +5,11 @@ iterations := 100
|
||||
|
||||
while k - iterations {
|
||||
k_f := float(k)
|
||||
sum = sum + 1.0 / pow(16.0, k_f) * (4.0 / (8.0 * k_f + 1.0) - 2.0 / (8.0 * k_f + 4.0) - 1.0 / (8.0 * k_f + 5.0) - 1.0 / (8.0 * k_f + 6.0))
|
||||
sum = sum + 1.0 / pow(16.0, k_f) *
|
||||
(4.0 / (8.0 * k_f + 1.0) -
|
||||
2.0 / (8.0 * k_f + 4.0) -
|
||||
1.0 / (8.0 * k_f + 5.0) -
|
||||
1.0 / (8.0 * k_f + 6.0))
|
||||
k = k + 1
|
||||
}
|
||||
|
||||
|
8
parse.c
8
parse.c
@ -177,6 +177,14 @@ static ExprRet expr(IRToks *out_ir, TokList *toks, Map *funcs, Scope *parent_sc,
|
||||
negate = true;
|
||||
}
|
||||
|
||||
/* Delete newline if we're definitely expecting an operand. */
|
||||
if (t->tok.kind == TokOp && t->tok.Op == OpNewLn) {
|
||||
if (t == start)
|
||||
start = t->next;
|
||||
t = t->next;
|
||||
toklist_del(toks, t->prev, t->prev);
|
||||
}
|
||||
|
||||
/* Collapse parentheses. */
|
||||
if (t->tok.kind == TokOp && t->tok.Op == OpLParen) {
|
||||
ExprRet r;
|
||||
|
Loading…
Reference in New Issue
Block a user