mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler2: update operator precedence and associativity (#3218)
This commit is contained in:
committed by
Alexander Medvednikov
parent
c1f4fc3f0f
commit
fe8a6abb41
@@ -12,12 +12,15 @@ fn test_parser() {
|
||||
println('\n')
|
||||
|
||||
text_expr := [
|
||||
'1 += 2',
|
||||
'1.2 + 3.4',
|
||||
'4 + 4',
|
||||
'1 + 2 * 5',
|
||||
'(2 * 3) / 2',
|
||||
'3 + (7 * 6)',
|
||||
'2 ^ 8 * (7 * 6)',
|
||||
'(2) + (17*2-30) * (5)+2 - (8/2)*4'
|
||||
'20 + (10 * 15) / 5', // 50
|
||||
'(2) + (17*2-30) * (5)+2 - (8/2)*4' // 8
|
||||
]
|
||||
for s in text_expr {
|
||||
// print using str method
|
||||
|
||||
Reference in New Issue
Block a user