File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,11 +31,7 @@ def read(self):
3131 self .ch = "success"
3232
3333 def language (self ):
34- if self .ch in string .ascii_lowercase :
35- self .content ()
36- elif self .ch == '(' :
37- self .content ()
38- elif self .ch == '[' :
34+ if self .ch in string .ascii_lowercase + "([" :
3935 self .content ()
4036
4137 def content (self ):
@@ -47,17 +43,17 @@ def content(self):
4743 self .expression ()
4844 if self .ch == ')' :
4945 self .read ()
50- self .language ()
5146 else :
5247 raise ValueError
48+ self .language ()
5349 elif self .ch == '[' :
5450 self .read ()
5551 self .expression ()
5652 if self .ch == ']' :
5753 self .read ()
58- self .language ()
5954 else :
6055 raise ValueError
56+ self .language ()
6157 else :
6258 raise ValueError
6359
@@ -71,9 +67,9 @@ def expression(self):
7167 self .expression ()
7268 if self .ch == ')' :
7369 self .read ()
74- self .language ()
7570 else :
7671 raise ValueError
72+ self .language ()
7773 else :
7874 raise ValueError
7975
You can’t perform that action at this time.
0 commit comments