diff --git a/ast/ast.go b/ast/ast.go index f3efbfbf..f78e6d30 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -243,7 +243,7 @@ func Integer(tk *token.Token) Node { negativePrefix := "" if value[0] == '-' { skipCharacterNum++ - if value[2] == 'o' { + if len(value) > 2 && value[2] == 'o' { skipCharacterNum++ } negativePrefix = "-"