summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-25 07:56:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-25 07:56:06 +0000
commit7a0f0e258b6dbeca3a9e357c22472cdd9f210b2b (patch)
treecb90e06b6bcbe1e44991d8d17cc57cb36872e939 /ext
parentf4afd05260398b9a3d58f0f266905179973d3285 (diff)
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
Diffstat (limited to 'ext')
-rw-r--r--ext/ripper/depend2
-rwxr-xr-xext/ripper/tools/strip.rb7
2 files changed, 4 insertions, 5 deletions
diff --git a/ext/ripper/depend b/ext/ripper/depend
index 4f48512a41a..f85d887a715 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -44,7 +44,7 @@ eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
preproc: ripper.E
ripper.E: ripper.c
$(ECHO) preprocessing ripper.c
- $(Q) $(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
+ $(Q) $(CC) -E $(INCFLAGS) $(CPPFLAGS) $< | $(RUBY) $(srcdir)/tools/strip.rb > $@
# AUTOGENERATED DEPENDENCIES START
ripper.o: $(RUBY_EXTCONF_H)
diff --git a/ext/ripper/tools/strip.rb b/ext/ripper/tools/strip.rb
index 82022d0b55e..0e409eb63bf 100755
--- a/ext/ripper/tools/strip.rb
+++ b/ext/ripper/tools/strip.rb
@@ -1,11 +1,10 @@
# frozen_string_literal: false
last_is_void = false
ARGF.each do |line|
- if line.strip.empty?
- #puts() unless last_is_void
+ case line
+ when /\A\s*\z/, /\A\#/
+ puts unless last_is_void
last_is_void = true
- elsif /\A\#/ === line
- ;
else
print line
last_is_void = false