2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
unary operator -
|
2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
|
|
|
|
|
foo = -3
|
|
|
|
|
|
2021-06-17 19:39:46 +02:00
|
|
|
--------------------------------------------------------------------------------
|
2021-06-13 09:26:15 +02:00
|
|
|
|
2021-06-14 23:33:28 +02:00
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(operation
|
2021-06-17 19:39:46 +02:00
|
|
|
(unary_operation
|
|
|
|
|
(literal_value
|
|
|
|
|
(numeric_lit))))))))
|
2021-06-13 09:26:15 +02:00
|
|
|
|
2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
unary operator !
|
2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
|
|
|
|
|
foo = !true
|
|
|
|
|
|
2021-06-17 19:39:46 +02:00
|
|
|
--------------------------------------------------------------------------------
|
2021-06-13 09:26:15 +02:00
|
|
|
|
2021-06-14 23:33:28 +02:00
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
2021-06-17 19:39:46 +02:00
|
|
|
(expression
|
|
|
|
|
(operation
|
|
|
|
|
(unary_operation
|
|
|
|
|
(literal_value
|
|
|
|
|
(bool_lit))))))))
|
2021-06-13 09:26:15 +02:00
|
|
|
|
2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
binary operators +
|
2021-06-17 19:39:46 +02:00
|
|
|
================================================================================
|
2021-06-13 09:26:15 +02:00
|
|
|
|
|
|
|
|
foo = 1+2
|
|
|
|
|
|
2021-06-17 19:39:46 +02:00
|
|
|
--------------------------------------------------------------------------------
|
2021-06-13 09:26:15 +02:00
|
|
|
|
2021-06-14 23:33:28 +02:00
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
2021-06-17 19:39:46 +02:00
|
|
|
(expression
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(literal_value
|
|
|
|
|
(numeric_lit))
|
|
|
|
|
(literal_value
|
|
|
|
|
(numeric_lit))))))))
|
2021-06-19 18:10:47 +02:00
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
|
precedence in binary operators
|
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
|
|
foo = a != b && c == d
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))))
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))))))))))
|
2025-03-30 13:33:58 +02:00
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
|
precedence in binary operators 2
|
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
|
|
foo = a.foo != "" && b.foo == "" ? 1 : 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(conditional
|
|
|
|
|
(expression
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))
|
|
|
|
|
(get_attr
|
|
|
|
|
(identifier))
|
|
|
|
|
(literal_value
|
|
|
|
|
(string_lit
|
|
|
|
|
(quoted_template_start)
|
|
|
|
|
(quoted_template_end)))))
|
|
|
|
|
(operation
|
|
|
|
|
(binary_operation
|
|
|
|
|
(variable_expr
|
|
|
|
|
(identifier))
|
|
|
|
|
(get_attr
|
|
|
|
|
(identifier))
|
|
|
|
|
(literal_value
|
|
|
|
|
(string_lit
|
|
|
|
|
(quoted_template_start)
|
|
|
|
|
(quoted_template_end))))))))
|
|
|
|
|
(expression
|
|
|
|
|
(literal_value
|
|
|
|
|
(numeric_lit)))
|
|
|
|
|
(expression
|
|
|
|
|
(literal_value
|
|
|
|
|
(numeric_lit))))))))
|