mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Merge pull request #45076 from ThakeeNathees/gdscript-operator-precedence-bug-fix
GDScript operator `+` `-` precedence bug fix
This commit is contained in:
commit
0dba21a4d1
@ -2919,8 +2919,8 @@ GDScriptParser::ParseRule *GDScriptParser::get_rule(GDScriptTokenizer::Token::Ty
|
||||
{ nullptr, &GDScriptParser::parse_binary_operator, PREC_BIT_SHIFT }, // LESS_LESS,
|
||||
{ nullptr, &GDScriptParser::parse_binary_operator, PREC_BIT_SHIFT }, // GREATER_GREATER,
|
||||
// Math
|
||||
{ &GDScriptParser::parse_unary_operator, &GDScriptParser::parse_binary_operator, PREC_ADDITION }, // PLUS,
|
||||
{ &GDScriptParser::parse_unary_operator, &GDScriptParser::parse_binary_operator, PREC_SUBTRACTION }, // MINUS,
|
||||
{ &GDScriptParser::parse_unary_operator, &GDScriptParser::parse_binary_operator, PREC_ADDITION_SUBTRACTION }, // PLUS,
|
||||
{ &GDScriptParser::parse_unary_operator, &GDScriptParser::parse_binary_operator, PREC_ADDITION_SUBTRACTION }, // MINUS,
|
||||
{ nullptr, &GDScriptParser::parse_binary_operator, PREC_FACTOR }, // STAR,
|
||||
{ nullptr, &GDScriptParser::parse_binary_operator, PREC_FACTOR }, // SLASH,
|
||||
{ nullptr, &GDScriptParser::parse_binary_operator, PREC_FACTOR }, // PERCENT,
|
||||
|
@ -1172,8 +1172,7 @@ private:
|
||||
PREC_BIT_XOR,
|
||||
PREC_BIT_AND,
|
||||
PREC_BIT_SHIFT,
|
||||
PREC_SUBTRACTION,
|
||||
PREC_ADDITION,
|
||||
PREC_ADDITION_SUBTRACTION,
|
||||
PREC_FACTOR,
|
||||
PREC_SIGN,
|
||||
PREC_BIT_NOT,
|
||||
|
Loading…
Reference in New Issue
Block a user