@@ -1397,7 +1397,6 @@ String &checkCanonicalName(String &name) {
1397
1397
return name;
1398
1398
}
1399
1399
1400
-
1401
1400
// √π -i ++j !true … not delete(x)
1402
1401
bool isPrefixOperation (Node &node, Node &lhs, Node &rhs) {
1403
1402
if (prefixOperators.has (node.name )) {
@@ -1423,7 +1422,6 @@ Node &groupOperatorCall(Node &node, Function &function) {
1423
1422
Node &grouped = groupOperators (node, function);// outer analysis id(3+3) => id(+(3,3))
1424
1423
if (grouped.length > 0 )
1425
1424
for (Node &child: grouped) {// inner analysis while(i<3){i++}
1426
- // if (&child == 0)continue;
1427
1425
child = analyze (child, function);// REPLACE with their ast
1428
1426
}
1429
1427
if (is_function)
@@ -1534,8 +1532,6 @@ Node &groupFunctionCalls(Node &expressiona, Function &context) {
1534
1532
rest.setType (expression);// todo f(1,2) vs f(1+2)
1535
1533
// if (hasFunction(rest) and rest.first().kind != groups)
1536
1534
// warn("Ambiguous mixing of functions `ƒ 1 + ƒ 1 ` can be read as `ƒ(1 + ƒ 1)` or `ƒ(1) + ƒ 1` ");
1537
- if (rest.first ().kind == groups)
1538
- rest = rest.first ();
1539
1535
// per-function precedence does NOT really increase readability or bug safety
1540
1536
if (rest.value .data ) {
1541
1537
maxArity--;// ?
@@ -1547,18 +1543,9 @@ Node &groupFunctionCalls(Node &expressiona, Function &context) {
1547
1543
" defaults and currying not yet supported" s % name % arg_length % minArity);
1548
1544
} else if (arg_length == 0 and minArity > 0 )
1549
1545
error (" missing arguments for function %s, or to pass function pointer use func keyword" s % name);
1550
- // else if (rest.first().kind == operators) { // random() + 1 == random + 1
1551
- // // keep whole expressiona for later analysis in groupOperators!
1552
- // return expressiona;
1553
- // } else if (arg_length >= maxArity) {
1554
1546
Node &args = analyze (rest, context);// todo: could contain another call!
1555
1547
node.add (args);
1556
- if (rest.kind == groups)
1557
- expressiona.remove (i + 1 , i + 1 );
1558
- else
1559
- expressiona.remove (i + 1 , i + arg_length);
1560
- // } else
1561
- // todo("missing arity match case");
1548
+ expressiona.remove (i + 1 , i + arg_length);
1562
1549
}
1563
1550
return expressiona;
1564
1551
}
@@ -1835,11 +1822,6 @@ Node &groupWhile(Node &n, Function &context) {
1835
1822
if (n.has (" :" )) {
1836
1823
condition = n.to (" :" );
1837
1824
then = n.from (" :" );
1838
- } else if (n.has (" do" )) {
1839
- condition = n.to (" do" );
1840
- then = n.from (" do" );
1841
- } else if (condition.has (" :" )) {
1842
- then = condition.from (" :" );
1843
1825
}
1844
1826
1845
1827
// Handle standalone conditions and alternative grouping cases
0 commit comments