diff --git a/pymbolic/parser.py b/pymbolic/parser.py index bb79859eeb886b00fa258a34c46bf4db9ba7ace0..4384db0f8b152037fe7ae0f5a7eedfa27d4667fa 100644 --- a/pymbolic/parser.py +++ b/pymbolic/parser.py @@ -92,8 +92,8 @@ _PREC_COMPARISON = 200 _PREC_SHIFT = 205 _PREC_PLUS = 210 _PREC_TIMES = 220 -_PREC_POWER = 230 -_PREC_UNARY = 240 +_PREC_UNARY = 230 +_PREC_POWER = 240 _PREC_CALL = 250 diff --git a/test/test_pymbolic.py b/test/test_pymbolic.py index 07566adc44e268e564c82e6ffe5b4b7c2885c791..8dc3a28a0dadf91f5b6b09c1ab0e68628ff4d403 100644 --- a/test/test_pymbolic.py +++ b/test/test_pymbolic.py @@ -332,6 +332,8 @@ def test_parser(): assert_parsed_same_as_python("0 if 1 if 2 else 3 else 4") assert_parsed_same_as_python("0 if (1 if 2 else 3) else 4") assert_parsed_same_as_python("(2, 3,)") + assert_parsed_same_as_python("-3**0.5") + assert_parsed_same_as_python("1/2/7") with pytest.deprecated_call(): parse("1+if(0, 1, 2)")