diff options
author | Hans Bolinder <hasse@erlang.org> | 2010-03-03 09:51:52 +0000 |
---|---|---|
committer | Erlang/OTP <otp@erlang.org> | 2010-03-03 09:51:52 +0000 |
commit | 67e5a5f8833a9d090e4e9920f29541870eba34f5 (patch) | |
tree | 0a2ba81c2372093091bc89ecae47a1081a7d4fa4 /lib/parsetools/test | |
parent | f94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca (diff) | |
download | erlang-67e5a5f8833a9d090e4e9920f29541870eba34f5.tar.gz |
OTP-8483 parsetools: yecc bug
Yecc failed to report reduce/reduce conflicts where one of the reductions
involved the root symbol. This bug has been fixed. (Thanks to Manolis
Papadakis.)
Diffstat (limited to 'lib/parsetools/test')
-rw-r--r-- | lib/parsetools/test/yecc_SUITE.erl | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index b5da414f7b..2e287f413a 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -44,7 +44,7 @@ empty/1, prec/1, yeccpre/1, lalr/1, old_yecc/1, other_examples/1, bugs/1, - otp_5369/1, otp_6362/1, otp_7945/1, + otp_5369/1, otp_6362/1, otp_7945/1, otp_8483/1, improvements/1, otp_7292/1, otp_7969/1]). @@ -1284,7 +1284,7 @@ other_examples(Config) when is_list(Config) -> ok. bugs(suite) -> - [otp_5369, otp_6362, otp_7945]. + [otp_5369, otp_6362, otp_7945, otp_8483]. otp_5369(doc) -> "OTP-5369. A bug in parse_and_scan reported on erlang questions."; @@ -1486,6 +1486,30 @@ otp_7945(Config) when is_list(Config) -> ?line {error,_} = erl_parse:parse([{atom,3,foo},{'.',2,9,9}]), ok. +otp_8483(doc) -> + "OTP-8483. reduce/accept conflict"; +otp_8483(suite) -> []; +otp_8483(Config) when is_list(Config) -> + Dir = ?privdir, + Input = filename:join(Dir, "bug.yrl"), + + Bug1 = <<"Nonterminals elem seq. + Terminals 'foo'. + Rootsymbol elem. + elem -> 'foo'. + elem -> seq. + seq -> elem. + seq -> seq elem.">>, + ?line ok = file:write_file(Input, Bug1), + Ret = [return, {report, true}], + ?line {error,[{_,[{none,yecc,{conflict,_}}, + {none,yecc,{conflict,_}}, + {none,yecc,{conflict,_}}]}], + [{_,[{none,yecc,{conflicts,1,3}}]}]} = + yecc:file(Input, Ret), + file:delete(Input), + ok. + improvements(suite) -> [otp_7292, otp_7969]. |