mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-15 09:29:49 +00:00
Correctly optimize variables around macros
This commit is contained in:
parent
d20cc677bb
commit
02031da61a
@ -181,7 +181,7 @@ abstract class AbstractStatementPreprocessor(protected val ctx: CompilationConte
|
||||
cv = search(arg, cv)
|
||||
cv = search(ve, cv)
|
||||
Assignment(ve, optimizeExpr(arg, cv)).pos(pos) -> cv
|
||||
case ExpressionStatement(expr@FunctionCallExpression(fname, List(VariableExpression(v), arg)))
|
||||
case ExpressionStatement(expr@FunctionCallExpression(fname, _))
|
||||
if ctx.env.maybeGet[Thing](fname).exists(i => i.isInstanceOf[MacroFunction]) =>
|
||||
ExpressionStatement(optimizeExpr(expr, Map())).pos(pos) -> Map()
|
||||
case ExpressionStatement(expr@FunctionCallExpression("+=", List(VariableExpression(v), arg)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user