Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Evans cd0877a93e
Support raise_errors keyword for Ripper.{lex,tokenize,sexp,sexp_raw}
Implements [Feature #17276]
2020-11-17 21:15:50 -08:00
Takashi Kokubun 4a7dccf44f
Add a Ripper.lex test of :on_embexpr_end
This is a weird use case of Ripper.lex which I'm not sure is supposed to
be maintained, so I'm adding this test so that we can easily notice such
changes.

If we change the behavior, this will break the behavior of hamlit.gem v1
and code like https://github.com/haml/haml/pull/1043.
2020-10-19 20:56:09 -07:00
Nobuyoshi Nakada ea68bb914a Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
Nobuyoshi Nakada 5331932cd2
Removed unused variables 2019-06-28 17:08:21 +09:00
Nobuyoshi Nakada 92ecf58b1e
parse.y: adjust here-doc error token
* parse.y (here_document): adjust token to the here-doc identifier
  in compile_error when a here-document misses the closing
  identifier.
2019-05-30 22:03:33 +09:00
Nobuyoshi Nakada b0e2b7a5ff
Include stack elements left after errors 2019-05-30 21:54:38 +09:00
Nobuyoshi Nakada 1da5c73932
parse.y: fix state after ivar/cvar
* parse.y (parse_atmark): return EXPR_END or EXPR_ENDFN, depending
  on the previous state, even incomplete names consistently.
2019-05-29 21:42:58 +09:00
k0kubun 0e60fdc511 test/ripper/test_lexer.rb: add test for r62743
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 13:03:12 +00:00
nobu 8b501f6d7f parse.y: indent at '#'
* parse.y (parser_here_document): update indent at '#', which is
  not a space.  [ruby-core:83368] [Bug #14032]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-19 05:10:38 +00:00
nobu 0e7936f896 lexer.rb: no dedent strings in middle
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): dedent only
  strings at the beginning, not strings in middle.
  [ruby-core:83343] [Bug #14027]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-19 04:25:30 +00:00
yui-knk a7452a8f4f test_lexer.rb: require ripper directly
* test/ripper/test_lexer.rb: This file does not use
  DummyParser, so requiring ripper directly instead of
  requiring dummyparser.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-15 07:24:12 +00:00
nobu d9d8ca0b8f lexer.rb: ignore dedented space
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): replace an
  empty string content because of dedentation with :on_ignored_sp.
  an empty token makes the sorted order unstable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-06 04:12:51 +00:00
nobu 4671737b0f ripper/lexer.rb: nested indented heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert
  stripped leading spaces as `on_ignored_sp` elements, so that the
  original source can be reconsructed.
  [ruby-core:80977] [Bug #13536]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-06 15:14:58 +00:00
nobu d24c4683f7 ripper/lexer.rb: nested indented heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for
  nested indedented here documents, where `Elem`s are nested too.
  [ruby-core:80977] [Bug #13536]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-02 17:48:10 +00:00