mirror of
https://github.com/apple/pkl.git
synced 2026-05-28 01:29:15 +02:00
Fix double unary minus (#697)
Fix an issue where doubly unary minus (e.g. `--1`) on int/float literals are incorrectly parsed as single unary minus.
This commit is contained in:
@@ -141,6 +141,10 @@ examples {
|
||||
|
||||
-1.2.abs
|
||||
-x.abs
|
||||
|
||||
// https://github.com/apple/pkl/issues/650
|
||||
--1.0
|
||||
-(-1.0)
|
||||
}
|
||||
|
||||
["power"] {
|
||||
|
||||
@@ -163,6 +163,10 @@ examples {
|
||||
-0b11.abs
|
||||
local x = 4
|
||||
-x.abs
|
||||
|
||||
// https://github.com/apple/pkl/issues/650
|
||||
--1
|
||||
-(-1)
|
||||
}
|
||||
|
||||
["power"] {
|
||||
|
||||
@@ -98,6 +98,8 @@ examples {
|
||||
["negation"] {
|
||||
-1.2
|
||||
-1.2
|
||||
1.0
|
||||
1.0
|
||||
}
|
||||
["power"] {
|
||||
27.98409999999999
|
||||
|
||||
@@ -121,6 +121,8 @@ examples {
|
||||
-2
|
||||
-3
|
||||
-4
|
||||
1
|
||||
1
|
||||
}
|
||||
["power"] {
|
||||
16
|
||||
|
||||
Reference in New Issue
Block a user