1
0
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:
joe-conigliaro
2019-12-26 13:40:18 +11:00
committed by Alexander Medvednikov
parent c1f4fc3f0f
commit fe8a6abb41
3 changed files with 64 additions and 34 deletions

View File

@@ -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