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