ログを解析する小さなhylangプログラムを作成しました。しかし、私はそれを評価しようとすると、私は次のエラーを取得する:なぜ私のhylangプログラムが解析に失敗しますか?
File "", line 8, column 38
(setv rule (.next irule))))))) ^LexException: Ran into a RPAREN where it wasn't expected.
機能疑問に(個別に評価するときにもエラーになります)以下の通りです:
限り私として(defmain [&rest args]
(setv inname (get args 1))
(setv outname (get args 2))
(with [ifile (open inname 'r')]
(with [ofile (open outname 'w')]
(setv tl (Tableline))
(setv irule (iter (.get-rule tl)))
(setv rule (.next irule))
(for [line ifile]
(setv match (re.match (get rule 0) line))
(when match
(for [(, group-num attr-data) (enumerate (get rule 1))]
(setattr tl (get attr-data 1) (apply (get attr-data 0)
[(.group match (inc group-num))])))
(if (. tl ready) (write ofile (str tl)))
(setv rule (.next irule)))))))
彼らの場所にあるすべての括約物とバランスのとれた表現であることが分かります。なぜレクサーが失敗するのですか?
私のプログラムの全文はここにある:pastebin