Integer literals now support signs

This commit is contained in:
2022-11-22 01:19:35 -05:00
parent 0ce136585b
commit 776856a6a5
3 changed files with 18 additions and 1 deletions

View File

@@ -164,7 +164,11 @@ func onPress (button stone.Button, modifiers stone.Modifiers) {
case *IntegerLiteral:
integer := selectedExpression.(*IntegerLiteral)
integer.value *= int64(integer.displayRadix)
integer.value += int64(value)
if integer.value < 0 {
integer.value -= int64(value)
} else {
integer.value += int64(value)
}
}
redraw()