mirror of
https://github.com/KarolS/millfork.git
synced 2025-02-04 18:32:38 +00:00
Macros should also accept indexed expressions as actual params
This commit is contained in:
parent
d6f38ba87b
commit
9f54a4d111
@ -88,6 +88,8 @@ object MacroExpander {
|
||||
params.zip(normalParams).foreach{
|
||||
case (v@VariableExpression(_), MemoryVariable(paramName, paramType, _)) =>
|
||||
actualCode = actualCode.map(stmt => replaceVariable(stmt, paramName.stripPrefix(i.environment.prefix), v).asInstanceOf[ExecutableStatement])
|
||||
case (v@IndexedExpression(_, _), MemoryVariable(paramName, paramType, _)) =>
|
||||
actualCode = actualCode.map(stmt => replaceVariable(stmt, paramName.stripPrefix(i.environment.prefix), v).asInstanceOf[ExecutableStatement])
|
||||
case _ =>
|
||||
ErrorReporting.error(s"Parameters to macro functions have to be variables", position)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user