@@ -4839,7 +4839,7 @@ def getIdent(self):
48394839 genv.char_prev = genv.char_curr
48404840 self.getChar()
48414841
4842- if genv.char_curr.isalpha ():
4842+ if genv.char_curr.isalnum ():
48434843 self.token_str += genv.char_curr
48444844 continue
48454845 else:
@@ -5037,28 +5037,27 @@ def handle_pascal_comment_2(self):
50375037 continue
50385038 else:
50395039 continue
5040-
5041- if genv.char_curr.isalpha():
5042- if self.check_ident():
5043- showInfo("argument: " + self.token_str)
5044- while True:
5045- genv.char_prev = genv.char_curr
5046- self.getChar()
5040+ else:
5041+ while True:
5042+ genv.char_prev = genv.char_curr
5043+ self.getChar()
50475044
5048- if self.check_white_spaces():
5049- continue
5050- elif self.check_char('{'):
5051- self.handle_pascal_comment_1()
5052- continue
5053- elif self.check_char('('):
5054- self.handle_pascal_comment_2() # todo: expr
5055- continue
5056-
5057- elif self.check_char(':'):
5045+ if self.check_white_spaces():
5046+ continue
5047+ elif self.check_char('{'):
5048+ self.handle_pascal_comment_1()
5049+ continue
5050+ elif self.check_char('('):
5051+ self.handle_pascal_comment_2() # todo: expr
5052+ continue
5053+
5054+ elif genv.char_curr.isalpha():
5055+ if self.check_ident():
5056+ showInfo("argument: " + self.token_str)
50585057 while True:
50595058 genv.char_prev = genv.char_curr
50605059 self.getChar()
5061-
5060+
50625061 if self.check_white_spaces():
50635062 continue
50645063 elif self.check_char('{'):
@@ -5068,9 +5067,8 @@ def handle_pascal_comment_2(self):
50685067 self.handle_pascal_comment_2() # todo: expr
50695068 continue
50705069
5071- elif genv.char_curr.isalpha():
5072- self.handle_pascal_argument_type()
5073-
5070+ elif self.check_char(':'):
5071+ showInfo(":::::")
50745072 while True:
50755073 genv.char_prev = genv.char_curr
50765074 self.getChar()
@@ -5083,23 +5081,60 @@ def handle_pascal_comment_2(self):
50835081 elif self.check_char('('):
50845082 self.handle_pascal_comment_2() # todo: expr
50855083 continue
5086-
5087- elif self.check_char(')'):
5088- showInfo("list ende.")
5089- break
5084+
5085+ elif genv.char_curr.isalpha():
5086+ self.handle_pascal_argument_type()
5087+
5088+ while True:
5089+ genv.char_prev = genv.char_curr
5090+ self.getChar()
5091+
5092+ if self.check_white_spaces():
5093+ continue
5094+ elif self.check_char('{'):
5095+ self.handle_pascal_comment_1()
5096+ continue
5097+ elif self.check_char('('):
5098+ self.handle_pascal_comment_2() # todo: expr
5099+ continue
5100+
5101+ elif self.check_char(')'):
5102+ showInfo("list ende.")
5103+
5104+ while True:
5105+ genv.char_prev = genv.char_curr
5106+ self.getChar()
5107+
5108+ if self.check_white_spaces():
5109+ continue
5110+ elif self.check_char('{'):
5111+ self.handle_pascal_comment_1()
5112+ continue
5113+ elif self.check_char('('):
5114+ self.handle_pascal_comment_2() # todo: expr
5115+ continue
5116+
5117+ elif self.check_char(';'):
5118+ showInfo("procedure ende.")
5119+ break
5120+ else:
5121+ raise Exception(_("semicolon (;) expected."))
5122+ break
5123+ else:
5124+ raise Exception(_("argument type expected."))
5125+ break
5126+ break
50905127 else:
5091- raise Exception(_("argument type expected."))
5128+ raise Exception(_("colon (:) expected."))
5129+ break
50925130 break
50935131 else:
5094- raise Exception(_("colon (:) expected."))
5095-
5096- return True
5097-
5098- else:
5099- raise Exception(_("Error:\nPascal comment expected."))
5132+ raise Exception(_("ident expected."))
5133+ else:
5134+ raise Exception(_("wrong char type."))
51005135
51015136 def handle_pascal_argument_type(self):
5102- self.ungetChar(1)
5137+ # self.ungetChar(1)
51035138 self.check_ident()
51045139 showInfo("argument type: " + self.token_str)
51055140
0 commit comments