mirror of
https://github.com/KarolS/millfork.git
synced 2024-12-23 08:29:35 +00:00
Fix text literals as expressions
This commit is contained in:
parent
12d32594d1
commit
07a29643a8
@ -111,7 +111,7 @@ abstract class AbstractStatementPreprocessor(protected val ctx: CompilationConte
|
||||
stmt match {
|
||||
case Assignment(ve@VariableExpression(v), arg) if trackableVars(v) =>
|
||||
cv = search(arg, cv)
|
||||
Assignment(ve, optimizeExpr(arg, cv)).pos(pos) -> (env.eval(arg, currentVarValues) match {
|
||||
Assignment(ve, optimizeExpr(arg, cv)).pos(pos) -> (env.eval(optimizeExpr(arg, Map()), currentVarValues) match {
|
||||
case Some(c) => cv + (v -> c)
|
||||
case None => cv - v
|
||||
})
|
||||
|
@ -591,6 +591,7 @@ class Environment(val parent: Option[Environment], val prefix: String, val cpuFa
|
||||
private def evalImpl(e: Expression, vv: Option[Map[String, Constant]]): Option[Constant] = {
|
||||
e match {
|
||||
case LiteralExpression(value, size) => Some(NumericConstant(value, size))
|
||||
case _:TextLiteralExpression => ???
|
||||
case ConstantArrayElementExpression(c) => Some(c)
|
||||
case GeneratedConstantExpression(c, t) => Some(c)
|
||||
case VariableExpression(name) =>
|
||||
|
Loading…
Reference in New Issue
Block a user