mirror of
https://github.com/irmen/prog8.git
synced 2024-12-12 12:29:11 +00:00
fix parse error for <<= and >>=
This commit is contained in:
parent
b03597ac13
commit
39ea5c5f99
@ -167,7 +167,8 @@ private fun prog8Parser.StatementContext.toAst() : Statement {
|
|||||||
augassignment()?.let {
|
augassignment()?.let {
|
||||||
// replace A += X with A = A + X
|
// replace A += X with A = A + X
|
||||||
val target = it.assign_target().toAst()
|
val target = it.assign_target().toAst()
|
||||||
val expression = BinaryExpression(target.toExpression(), it.operator.text.substring(0, 1), it.expression().toAst(), it.expression().toPosition())
|
val oper = it.operator.text.substringBefore('=')
|
||||||
|
val expression = BinaryExpression(target.toExpression(), oper, it.expression().toAst(), it.expression().toPosition())
|
||||||
return Assignment(it.assign_target().toAst(), expression, it.toPosition())
|
return Assignment(it.assign_target().toAst(), expression, it.toPosition())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user