Created
November 7, 2008 04:25
-
-
Save kamal/22779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: test/test_ruby_parser.rb | |
=================================================================== | |
--- test/test_ruby_parser.rb (revision 448) | |
+++ test/test_ruby_parser.rb (working copy) | |
@@ -374,6 +374,13 @@ | |
assert_equal pt, @processor.parse(rb) | |
end | |
+ def test_str_pct_nested_nested | |
+ rb = "%{ { #\{ \"#\{1}\" } } }" | |
+ pt = s(:dstr, " { ", s(:evstr, s(:lit, 1)), s(:str, " } ")) | |
+ | |
+ assert_equal pt, @processor.parse(rb) | |
+ end | |
+ | |
def test_str_str | |
rb = "\"a #\{'b'}\"" | |
pt = s(:str, "a b") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MacBook-Pro:dev kamalmb$ rake test | |
(in /Users/kamalmb/src/ruby_parser/dev) | |
racc warning: terminal tEQL used but not decleared | |
racc warning: terminal tLOWEST used but not decleared | |
Loaded suite -e | |
Started | |
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................E......................................................... | |
Finished in 1.427799 seconds. | |
1) Error: | |
test_str_pct_nested_nested(TestRubyParser): | |
SyntaxError: unterminated string meets end of file. near line 1: "" | |
./lib/ruby_lexer.rb:384:in `rb_compile_error' | |
./lib/ruby_lexer.rb:373:in `parse_string' | |
./lib/ruby_lexer.rb:1321:in `yylex_string' | |
./lib/ruby_lexer.rb:629:in `yylex' | |
./lib/ruby_lexer.rb:58:in `advance' | |
./lib/ruby_parser_extras.rb:713:in `next_token' | |
/usr/local/lib/ruby/site_ruby/1.8/racc/parser.rb:99:in `_racc_do_parse_c' | |
/usr/local/lib/ruby/site_ruby/1.8/racc/parser.rb:99:in `__send__' | |
/usr/local/lib/ruby/site_ruby/1.8/racc/parser.rb:99:in `do_parse' | |
./lib/ruby_parser_extras.rb:750:in `parse' | |
./test/test_ruby_parser.rb:381:in `test_str_pct_nested_nested' | |
634 tests, 3467 assertions, 0 failures, 1 errors | |
rake aborted! | |
Command failed with status (1): [/usr/local/bin/ruby -w -I../../ParseTree/d...] | |
(See full trace by running task with --trace) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment