Fixed precedence on '-'. Passed additional tests. Comments on bad.py. Updated worklog.

This commit is contained in:
bill
2021-03-01 17:54:09 +08:00
parent 440b2e59f3
commit 1efee5e539
4 changed files with 26 additions and 14 deletions
+7 -3
View File
@@ -4,8 +4,10 @@ def fun5():
c = 6
def fun6():
print("Hello")
c = 4 + 5
c = 4 + 5 # Indentation error
# Global statements in between definitions
# (not allowed in the language manual)
if True:
if True:
print("Hello")
@@ -16,11 +18,11 @@ if True:
else:
print("Again")
else:
print("And Again")
print("And Again") # Unmatched Else
class Thor(object):
y:int = 0
print("Right place?")
print("Right place?") # Statement in class
class Stones(object):
y:int = 0
@@ -30,6 +32,8 @@ class Stones(object):
return 2+3
print("Wrong Place")
# Functions without `statements'
# (not allowed in the language manual)
def fun1():
def fun2():
print("Hello")
@@ -73,8 +73,10 @@ f.bar(4)
a=[[[1],[2]],[[3],[4]]]
print(a[0][0][1]*a[1][1][0])
multiline_string="Hi World,
multiline_string="Hi World,\
Here I am"
expr_precedence = -a + b * (c + d)
stone="Blue"
print(get_stones(stone))