エラー処理の実験2
ちくちくとエラー処理の確認をしていたら、やはり出てきました。へんなところ。
例えば、
***ソースプログラム↓
program test;
const
yes = true;
no = false;
small = + # ←定数の値を'+'にしてみた
big = 123456;
var
id1 : integer;
id2 : boolean;
hen : integer;
x, y, z : int;
begin
end.
***実行結果↓
~/PasAvr$ python parser0.py
program
test
;
const
yes
=
true
;
no
=
false
;
small
=
+
big
Error8 ';'セミコロンが抜けていませんか?
・・・なんで?
関数const_stmts()を追っていくと、error(13)の
'+','-'のあとには整数がくるはずですよ!
というエラーを出して止まるはずなんですけど。
いろいろ修正して試したんだけど、全然ダメだ。ちょっと途方にくれています。