Describe the bug
In the expression assert, failed to compile those simple math sub expressions such as -(-2) , +2.
Reproduction Steps
the test
testfiles> v conv_test.v
conv_test.v:8:33: error: invalid expression: unexpected token ` ==`
6 | assert strconv.atoi(' -2' )! == -2
7 | assert strconv.atoi(' +2' )! == i - 1 + 1
8 | assert strconv.atoi(' +2' )! == -(-2)
| ^
9 | assert strconv.atoi(' +2' )! == +2
10 | }
testfiles> v conv_test.v
conv_test.v:9:33: error: invalid expression: unexpected token ` +`
7 | assert strconv.atoi(' +2' )! == i - 1 + 1
8 | //assert strconv.atoi(' +2' )! == -(-2)
9 | assert strconv.atoi(' +2' )! == +2
| ^
10 | }
testfiles>
the test source
import strconv
fn test_atoi () ! {
i := 2
assert strconv.atoi ('1' )! == 1
assert strconv.atoi ('-2' )! == - 2
assert strconv.atoi ('+2' )! == i - 1 + 1
assert strconv.atoi ('+2' )! == - (- 2 )
assert strconv.atoi ('+2' )! == + 2
}
Expected Behavior
Compiling ok.
Current Behavior
Failed to compile it.
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.5.1 0c3183c
Environment details (OS name and version, etc.)
Windows 10 amd64.
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Describe the bug
In the expression
assert, failed to compile those simple math sub expressions such as-(-2),+2.Reproduction Steps
the test
the test source
Expected Behavior
Compiling ok.
Current Behavior
Failed to compile it.
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.5.1 0c3183c
Environment details (OS name and version, etc.)
Windows 10 amd64.
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.