formatting
This commit is contained in:
@@ -83,9 +83,14 @@ local function tokenize(expr)
|
||||
-- Check if this is a negative number or subtraction
|
||||
-- It's a negative number if previous token is an operator or opening paren
|
||||
local prevToken = tokens[#tokens]
|
||||
if not prevToken or prevToken.type == TokenType.PLUS or prevToken.type == TokenType.MINUS
|
||||
or prevToken.type == TokenType.MULTIPLY or prevToken.type == TokenType.DIVIDE
|
||||
or prevToken.type == TokenType.LPAREN then
|
||||
if
|
||||
not prevToken
|
||||
or prevToken.type == TokenType.PLUS
|
||||
or prevToken.type == TokenType.MINUS
|
||||
or prevToken.type == TokenType.MULTIPLY
|
||||
or prevToken.type == TokenType.DIVIDE
|
||||
or prevToken.type == TokenType.LPAREN
|
||||
then
|
||||
-- This is a negative number, continue to number parsing
|
||||
local numStr = "-"
|
||||
i = i + 1
|
||||
|
||||
Reference in New Issue
Block a user