File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1125,6 +1125,7 @@ def identify_number(op = "")
11251125 type = TkINTEGER
11261126 allow_point = true
11271127 allow_e = true
1128+ allow_ri = true
11281129 non_digit = false
11291130 while ch = getc
11301131 num << ch
@@ -1154,8 +1155,25 @@ def identify_number(op = "")
11541155 num << getc
11551156 end
11561157 allow_e = false
1158+ allow_ri = false
11571159 allow_point = false
11581160 non_digit = ch
1161+ when allow_ri && "r"
1162+ if non_digit
1163+ raise Error , "trailing `#{ non_digit } ' in number"
1164+ end
1165+ type = TkRATIONAL
1166+ if peek ( 0 ) == 'i'
1167+ type = TkIMAGINARY
1168+ num << getc
1169+ end
1170+ break
1171+ when allow_ri && "i"
1172+ if non_digit && non_digit != "r"
1173+ raise Error , "trailing `#{ non_digit } ' in number"
1174+ end
1175+ type = TkIMAGINARY
1176+ break
11591177 else
11601178 if non_digit
11611179 raise Error , "trailing `#{ non_digit } ' in number"
You can’t perform that action at this time.
0 commit comments