0
私はルビーのビット、TDDのビット、そしてツリートップのビットを私に教えようとしています。Treetop:文字列リテラルの解析?
I持って解析する文字列リテラルのための次の文法:
grammar Str
rule string
'"'
(
!'"' ./'\"'
)*
'"'
end
end
そして以下の試験方法:
def test_strings
assert @parser.parse('"Hi there!"')
assert [email protected]('"This is not" valid')
assert @parser.parse('"He said, \"Well done!\""')
end
第3の試験(バックスラッシュを有するもの)(文字列を通過しません解析されません):なぜですか?
ありがとうございます!あなたはエスケープ引用符チェックの順番入れ替えする必要が
ありがとうございました!面白いことに、私が投稿した例は、公式文書[here](http://treetop.rubyforge.org/pitfalls_and_advanced_techniques.html)に掲載されている例です。 – Rom1
ちょうどメモ:この例はTreetopのウェブサイトで修正されました。 – Rom1