1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-08-12 11:29:20 +00:00

Macros should also accept indexed expressions as actual params

This commit is contained in:
Karol Stasiak 2018-02-22 13:36:19 +01:00
parent d6f38ba87b
commit 9f54a4d111

View File

@ -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)
}