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

148 Коммитов

Автор SHA1 Сообщение Дата
nobu 32a4b080f1 Ripper::Lexer bit predicates
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): added allbits?,
  anybits? and nobits? methods, as well as Integer.  a patch by
  aycabta.  [Feature #14170]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 10:26:09 +00:00
nobu 3280f54168 lexer.rb: Ripper::Lexer::State
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer::State): wrapper
  of lex_state values.

* parse.y (rb_parser_lex_state_name): return shared strings.  lex
  state combinations are very restricted.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-05 21:13:18 +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
nobu 3ca9f25b29 ripper/lexer.rb: remove double quotes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30 06:42:24 +00:00
nobu 71345cf1df fix up r59949
* ext/ripper/lib/ripper/lexer.rb (List#inspect): splat self data
  to local variables same as members of Elem.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 02:32:55 +00:00
nobu d1e63172c6 parse.y: ripper_lex_state_name
* parse.y (ripper_lex_state_name): represent lex_state as OR-ed
  form.

* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer::Elem#to_a):
  lex_state for inspection.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-18 00:08:19 +00:00
nobu 7df1e45bb6 ripper: add states of scanner
* parse.y (ripper_state): add states of scanner to tokens from
  Ripper.lex and Ripper::Filter#on_*.  based on the patch by
  aycabta (Code Ahss) at [ruby-core:81789].  [Feature #13686]

* ext/ripper/tools/preproc.rb (prelude, usercode): generate EXPR_*
  constants from enums.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14 10:53:47 +00:00
nobu 9028340deb ripper.rb: fix License format [ci skip]
* ext/ripper/lib/ripper.rb: [DOC] fix format of the License
  description and the author.  patched by aycabta (Code Ahss) at
  [ruby-core:82376].  [Bug #13813]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-15 00:50:22 +00:00
nobu f7ef047f8e VPATH for ripper
* common.mk (ripper.c): pass the build directory path for id.h
  which may be generated there.

* ext/ripper/depend (ripper.y): search the top build directory and
  the top source directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-14 10:31:05 +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 f2d1848441 parse.y: f_margs parser events
* parse.y (f_margs): implemented parser events for massign
  formal arguments.  [ruby-core:81848] [Bug #13701]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-01 02:01:05 +00:00
mame 41e800f6a8 ripper.c should have `#line "ripper.c"`, not `#line "parse.c"`
The order of sed commands in Makefile of ripper was wrong: it tries to
replace `y.tab.c` with `ripper.c`, but before that, ytab.sed replaced
`y.tab.c` with `parse.c`, which led to a wrong result.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 12:23:27 +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
shyouhei 20c72dc89d ruby tool/update-deps --fix
Onigumo 6 (r57045) introduced new onigumo.h header file, which is
required from quite much everywhere.  This commit adds necessary
dependencies.

Note: ruby/oniguruma.h now includes onigumo.h,
      ruby/io.h includes oniguruma.h,
      ruby/encoding.h also includes oniguruma.h,
      and internal.h includes encoding.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22 06:00:18 +00:00
kazu e3300dce82 {ext,test}/ripper: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-05 07:54:32 +00:00
nobu 78b9d778de probes.dmyh: remove preprocessor directives
* tool/gen_dummy_probes.rb: remove include and conditional
  directives from probes.dmyh which are removed by preprocessing.

* common.mk: remove unnecessary dependencies on vm_opts.h via
  probes.dmyh.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:03:14 +00:00
nobu 7a0f0e258b ripper: fix ripper.E
* ext/ripper/depend (ripper.E): add missing $(INCFLAGS).

* ext/ripper/tools/strip.rb: insert an empty line for blank or
  line directive lines.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-25 07:56:06 +00:00
akr 9d8ef4ea20 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-11 11:50:00 +00:00
nobu a43f2cbaa1 Fix Ripper.lex error in dedenting squiggly heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
  Ripper.lex error in dedenting squiggly heredoc.  heredoc tree is
  also an array of Elem in the outer tree.  [Fix GH-1234]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-02 23:21:34 +00:00
nobu 50b014d536 ripper: clean timestamp
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-19 10:39:42 +00:00
usa a1115a1b47 * ext/ripper/depend: Just like BSDmake, nmake also recognize the rule of
".eventids2.check" as inference one.  but nmake is not cheated by macro.
  this fixes build failure introduced at r53448. see also the commit log of
  r53452.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 12:28:32 +00:00
naruse 93bf547258 fix r53448
avoid mkmf.rb's suffix rule scanner (lib/mkmf.rb:2085), it detects
suffix rule from depend file and adds .SUFFIXES.
It breaks bsdmake to generate check file named ".eventids2.check".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 07:11:33 +00:00
nobu b032d111ab mkmf.rb: library installation messages
* lib/mkmf.rb (configuration, dummy_makefile, create_makefile):
  show library installation messages only when any files need to
  be updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 03:06:58 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
nobu 9a28a29b87 parse.y: indented hereoc
* parse.y: add heredoc <<~ syntax.  [Feature #9098]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 14:39:52 +00:00
nobu ef44c0ad2f ripper/lexer.rb: dispatch alias
* ext/ripper/lib/ripper/lexer.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 06:56:23 +00:00
nobu cf2b422fc5 ripper/core.rb: share handlers
* ext/ripper/lib/ripper/sexp.rb (SexpBuilderPP): share scanner
  event handlers and most of parser event handlers with
  SexpBuilder.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:43:17 +00:00
nobu f8ecb823a0 ripper/core.rb: dispatch alias
* ext/ripper/lib/ripper/core.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:26:16 +00:00
nobu a01b6453eb Rename DOTQ to ANDDOT
* defs/id.def, parse.y: Switch internal token name to reflect
  current form of safe-call operator.  [Fix GH-1090]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10 09:42:27 +00:00
nobu 1a98528cb7 symbol.c: dotq in ripper
* symbol.c (op_tbl): add DOTQ for ripper.  [Feature #11537]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-25 01:12:07 +00:00
akr ecedd3b224 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19 13:34:54 +00:00
akr 698f329b55 Update dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-27 12:52:17 +00:00
akr 6ca202fcee Update dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21 03:04:44 +00:00
nobu 3a2d2af0f7 common.mk: fix build error
* common.mk (ext/ripper/ripper.c): VPATH is always ../.. from
  ext/ripper.

* ext/ripper/depend (.y.c): VPATH is not needed for an
  intermediate file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-19 15:19:33 +00:00
naruse 926b9e05f1 * common.mk (ext/ripper/ripper.c): pass build directory as VPATH.
* ext/ripper/depend (.y.c): use VPATH for y.tab.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-19 09:00:33 +00:00
akr 20fe728a24 Dependencies updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 15:28:08 +00:00
akr 7cd76ab0c5 * internal.h: Include ruby.h and ruby/encoding.h to be
includable without prior inclusion.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:49:06 +00:00
akr dd547e1b22 Mark auogenerated part.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:14:08 +00:00
akr 57682b05e1 * common.mk: Remove comments in Dependency lines.
Notified by usa.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 10:28:25 +00:00
akr 8727eb77be * tool/update-deps: Extend to fix dependencies.
* common.mk: Dependencies updated by tool/update-deps.

* enc/depend: Ditto.

* ext/**/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 05:15:49 +00:00
nobu b5524d9f8a eventids2.c: reduce size
* ext/ripper/eventids2.c (token_assoc): reduce size.  unsigned
  short can hold 65535 at least.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-28 02:53:24 +00:00
nobu 1b132cb254 eventids2.c: reduce size
* ext/ripper/eventids2.c (token_to_eventid): reduce relocations
  and element size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27 06:50:49 +00:00
nobu 92c61ca747 ripper/tools/generate.rb: shorten generated source
* ext/ripper/tools/generate.rb (generate_eventids1): shorten
  generated source.

* ext/ripper/tools/generate.rb (generate_eventids2): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27 06:38:09 +00:00
nobu d1ec43ae7a parse.y: Ripper.sexp returns error
* ext/ripper/lib/ripper/sexp.rb (Ripper.sexp, Ripper.sexp_raw):
  return nil on error.  [ruby-dev:48678] [Bug #10405]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-26 03:24:18 +00:00
nobu b0c03f63e5 parse.y: quoted ID key
* parse.y (assoc): allow quoted ID as a key of a hash literal.
  [ruby-core:34453] [Feature #4276]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-20 01:48:43 +00:00
zzak 9699d0ddf4 * ext/ripper/lib/ripper/lexer.rb: [DOC] use lower case version of core
classes when referring to return value, since we aren't directly
  talking about the class. Patch by Jonathan Jackson [Bug #9483]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07 12:57:44 +00:00
nobu 90b9996523 parse.y: remove "f" suffix [ruby-core:57966] [Feature #9042]
revert r42847 "test_string.rb: add test string encoding"

revert r42846 "parse.y: freeze in advance to reduce objects"

revert r42843 "parse.y: deduplicate frozen string literals"

revert r42780 "test_string.rb: yet another test"

revert r42779 "parse.y: valid suffix word only"

revert r42778 "test_string.rb: remove duplicated code"

revert r42775 "parse.y: force_encoding"

This reverts commit 93ea04ecec.

revert r42773 "Add frozen string literals"

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10 06:13:02 +00:00
charliesome a056098cb7 * NEWS: Add note about frozen string literals
* compile.c (case_when_optimizable_literal): optimize NODE_LIT strings
  in when clauses of case statements

* ext/ripper/eventids2.c: add tSTRING_SUFFIX

* parse.y: add 'f' suffix on string literals for frozen strings

* test/ripper/test_scanner_events.rb: add scanner tests

* test/ruby/test_string.rb: add frozen string tests

[Feature #8579] [ruby-core:55699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02 07:11:41 +00:00
nobu 856a9afb98 eventids2.c: new literals
* ext/ripper/eventids2.c (ripper_init_eventids2): ripper support for
  new literals, tRATIONAL and tIMAGINARY.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02 14:13:20 +00:00