mirror of
https://github.com/KarolS/millfork.git
synced 2024-09-10 11:54:30 +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{
|
params.zip(normalParams).foreach{
|
||||||
case (v@VariableExpression(_), MemoryVariable(paramName, paramType, _)) =>
|
case (v@VariableExpression(_), MemoryVariable(paramName, paramType, _)) =>
|
||||||
actualCode = actualCode.map(stmt => replaceVariable(stmt, paramName.stripPrefix(i.environment.prefix), v).asInstanceOf[ExecutableStatement])
|
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 _ =>
|
case _ =>
|
||||||
ErrorReporting.error(s"Parameters to macro functions have to be variables", position)
|
ErrorReporting.error(s"Parameters to macro functions have to be variables", position)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user