[#26975] [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

56 messages 2005/09/07
[#26976] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26977] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26978] Re: [proposal] ANSI style function — nobu@... 2005/09/07

なかだです。

[#26979] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26980] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26983] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26988] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26989] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26990] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/08

まつもと ゆきひろです

[#26991] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26995] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#26996] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/09

まつもと ゆきひろです

[#26998] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#27000] Re: [proposal] ANSI style function — Takahiro Kambe <taca@...> 2005/09/09

In message <20050909220539.E1B26BB8.ocean@m2.ccsnet.ne.jp>

[#27001] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27002] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27003] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27004] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27005] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27006] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27007] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27008] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27009] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27011] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27013] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27016] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#27015] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#26984] elimination of "extern int errno;" — Takahiro Kambe <taca@...>

こんにちは。

48 messages 2005/09/08
[#27023] sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050908.120716.71112483.taca@back-street.net>

[#27024] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27025] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <1126489480.743964.31599.nullmailer@x31.priv.netlab.jp>

[#27027] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050912.104954.92585084.taca@back-street.net>

[#27029] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27035] Re: sizeof(FILE) problem on DragonFly BSD — "U.Nakamura" <usa@...> 2005/09/12

こんにちは、なかむら(う)です。

[#27036] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27079] ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27081] Re: ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Yukihiro Matsumoto <matz@...> 2005/09/15

まつもと ゆきひろです

[#27082] Re: ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27083] Re: ruby-1.8.3 status for release — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/15

山本です。

[#27099] Re: ruby-1.8.3 status for release — Hidetoshi NAGAI <nagai@...> 2005/09/15

永井@知能.九工大です.

[#27531] ruby/tk installation without tcl/tk (for 1.8.4) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/10/26

山本です。

[#27619] Re: ruby/tk installation without tcl/tk (for 1.8.4) — Hidetoshi NAGAI <nagai@...> 2005/11/02

永井@知能.九工大です.

[#27139] ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...>

高橋征義です。

66 messages 2005/09/18
[#27193] Re: ruby-1.8.3 status for release — TAKAHASHI Masayoshi <maki@...> 2005/09/20

高橋征義です。

[#27251] 脆弱性レポート翻訳者募集 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

13 messages 2005/09/21

[#27321] RubyGemsとOS platformとの関係 — Daigo Moriwaki <techml@...>

こんにちは、森脇です。

42 messages 2005/09/26
[#27327] Re: RubyGemsとOS platformとの関係 — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/09/27

なかだです。

[#27330] Re: RubyGemsとOS platformとの関係 — Yukihiro Matsumoto <matz@...> 2005/09/27

まつもと ゆきひろです

[#27337] Re: RubyGems と OS platform との関係 — NISHIO Mizuho <jurader@...> 2005/09/27

西尾瑞穂 と言います。

[#27343] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27347] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/28

In article <1127872084.608903.6359.nullmailer@x31.priv.netlab.jp>,

[#27348] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27359] Re: RubyGems と OS platform との関係 — Daigo Moriwaki <techml@...> 2005/09/28

森脇です。

[#27364] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Daigo Moriwaki wrote:

[#27365] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/30

In article <433CC31E.20802@ruby-lang.org>,

[#27367] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Tanaka Akira wrote:

[#27369] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/10/01

In article <433D4CED.9030005@ruby-lang.org>,

[ruby-dev:27307] Re: pragma on ripper

From: nobu@...
Date: 2005-09-22 23:32:03 UTC
List: ruby-dev #27307
なかだです。

At Fri, 23 Sep 2005 07:09:46 +0900,
Minero Aoki wrote in [ruby-dev:27304]:
> > > core.rbの更新は完全に手動で管理するようになってしまったようです
> > > が、せめてparse.yなどを更新したときだけ更新するようにはならない
> > > でしょうか。
> 
> これには迂遠な理由があったのですが、別の方法で問題をチェックできることに
> 気付いたので、lib/ripper/core.rb をレポジトリから消すことにしました。

その理由というのにちょっと好奇心を刺激されますが、というのはお
いといて、ext/extmk.rbから作られるときは$(RUBY)はminirubyなので、
まだstringioは使えません。


Index: ext/ripper/depend
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/ripper/depend,v
retrieving revision 1.14
diff -U2 -p -r1.14 depend
--- ext/ripper/depend	22 Sep 2005 22:08:46 -0000	1.14
+++ ext/ripper/depend	22 Sep 2005 23:16:01 -0000
@@ -1,2 +1,4 @@
+src: ripper.c eventids1.c $(srcdir)/lib/ripper/core.rb
+
 ripper.o: ripper.c eventids1.c $(srcdir)/eventids2.c $(hdrdir)/lex.c
 
@@ -7,5 +9,5 @@ ripper.y: $(srcdir)/tools/preproc.rb $(h
 	$(RUBY) $(srcdir)/tools/preproc.rb $(hdrdir)/parse.y --output=$@
 
-$(srcdir)/lib/ripper/core.rb: $(srcdir)/tools/generate.rb $(srcdir)/lib/ripper/core.rb.in $(hdrdir)/parse.y $(hdrdir)/eventids2.c
+$(srcdir)/lib/ripper/core.rb: $(srcdir)/tools/generate.rb $(srcdir)/lib/ripper/core.rb.in $(hdrdir)/parse.y $(srcdir)/eventids2.c
 	$(RUBY) $(srcdir)/tools/generate.rb --mode=ripper/core --template=$@.in --output=$@ --ids1src=$(hdrdir)/parse.y --ids2src=$(srcdir)/eventids2.c
 
Index: ext/ripper/extconf.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/ripper/extconf.rb,v
retrieving revision 1.4
diff -U2 -p -r1.4 extconf.rb
--- ext/ripper/extconf.rb	22 Sep 2005 14:40:37 -0000	1.4
+++ ext/ripper/extconf.rb	22 Sep 2005 14:41:44 -0000
@@ -7,6 +7,6 @@ def main
   unless find_executable('bison')
     unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
-      $stderr.puts 'missing bison; abort'
-      exit 1
+      Logging.message 'missing bison; abort'
+      return
     end
   end
Index: ext/ripper/tools/generate.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/ripper/tools/generate.rb,v
retrieving revision 1.2
diff -U2 -p -r1.2 generate.rb
--- ext/ripper/tools/generate.rb	22 Sep 2005 22:01:32 -0000	1.2
+++ ext/ripper/tools/generate.rb	22 Sep 2005 23:29:56 -0000
@@ -1,5 +1,4 @@
 # $Id: generate.rb,v 1.2 2005/09/22 22:01:32 aamine Exp $
 
-require 'stringio'
 require 'optparse'
 
@@ -13,5 +12,5 @@ def main
   parser = @parser = OptionParser.new
   parser.banner = "Usage: #{File.basename($0)} --mode=MODE [--ids1src=PATH] [--ids2src=PATH] [--template=PATH] [--output=PATH]"
-  parser.on('--mode=MODE', '"ripper/core" or "eventids1".') {|m|
+  parser.on('--mode=MODE', %"ripper/core eventids1") {|m|
     mode = m
   }
@@ -30,5 +29,5 @@ def main
   parser.on('--help', 'Prints this message and quit.') {
     puts parser.help
-    exit 0
+    exit true
   }
   begin
@@ -39,5 +38,5 @@ def main
   usage 'no mode given' unless mode
   case mode
-  when 'ripper/core', 'ripper/core.rb'
+  when 'ripper/core'
     usage 'no --ids1src' unless ids1src
     usage 'no --ids2src' unless ids2src
@@ -45,10 +44,10 @@ def main
     ids1 = read_ids1(ids1src)
     ids2 = read_ids2(ids2src)
-    unless (ids1.keys & ids2).empty?
-      $stderr.puts "event crash: #{(ids1.keys & ids2).join(' ')}"
-      exit 1
+    diff = ids1.map {|id, *| id} & ids2
+    unless diff.empty?
+      abort "event crash: #{diff.join(' ')}"
     end
     result = generate_ripper_core(template, ids1, ids2)
-  when 'eventids1', 'eventids1.c'
+  when 'eventids1'
     usage 'no --ids1src' unless ids1src
     result = generate_eventids1(read_ids1(ids1src))
@@ -66,10 +65,9 @@ def usage(msg)
   $stderr.puts msg
   $stderr.puts @parser.help
-  exit 1
+  exit false
 end
 
 def generate_ripper_core(template, ids1, ids2)
-  f = StringIO.new
-  f.print <<header
+  str = <<header
 # This file is automatically generated from #{File.basename(template)} and parse.y.
 # DO NOT MODIFY!!!!!!
@@ -79,38 +77,32 @@ header
     case line
     when /\A\#include ids1/
-      comma = ''
-      ids1.each do |id, arity|
-        f.print comma; comma = ",\n"
-        f.print "    #{id.intern.inspect} => #{arity}"
-      end
-      f.puts
+      str << ids1.map {|id, arity|
+        "    #{id.intern.inspect} => #{arity}"
+      }.join(",\n") << "\n"
     when /\A\#include ids2/
-      comma = ''
-      ids2.each do |id|
-        f.print comma; comma = ",\n"
-        f.print "    #{id.intern.inspect} => 1"
-      end
-      f.puts
+      str << ids2.map {|id|
+        "    #{id.intern.inspect} => 1"
+      }.join(",\n") << "\n"
     when /\A\#include handlers1/
       ids1.each do |id, arity|
-        f.puts
-        f.puts "  def on_#{id}#{paramdecl(arity)}"
-        f.puts "    #{arity == 0 ? 'nil' : 'a'}"
-        f.puts "  end"
+        str << $/
+        str << "  def on_#{id}#{paramdecl(arity)}" << $/
+        str << "    #{arity == 0 ? 'nil' : 'a'}" << $/
+        str << "  end" << $/
       end
     when /\A\#include handlers2/
       ids2.each do |id|
-        f.puts
-        f.puts "  def on_#{id}(token)"
-        f.puts "    token"
-        f.puts "  end"
+        str << $/
+        str << "  def on_#{id}(token)" << $/
+        str << "    token" << $/
+        str << "  end" << $/
       end
     when /\A\#include (.*)/
       raise "unknown operation: #include #{$1}"
     else
-      f.print line
+      str << line
     end
   end
-  f.string
+  str
 end
 
@@ -121,17 +113,17 @@ end
 
 def generate_eventids1(ids)
-  f = StringIO.new
+  str = ""
   ids.each do |id, arity|
-    f.puts "static ID ripper_id_#{id};"
+    str << "static ID ripper_id_#{id};" << $/
   end
-  f.puts
-  f.puts 'static void'
-  f.puts 'ripper_init_eventids1()'
-  f.puts '{'
+  str << $/
+  str << 'static void' << $/
+  str << 'ripper_init_eventids1()' << $/
+  str << '{' << $/
   ids.each do |id, arity|
-    f.puts %Q[    ripper_id_#{id} = rb_intern("on_#{id}");]
+    str << %Q[    ripper_id_#{id} = rb_intern("on_#{id}");] << $/
   end
-  f.puts '}'
-  f.string
+  str << '}' << $/
+  str
 end
 
@@ -148,10 +140,10 @@ def check_arity(h)
     unless list.map {|line, arity| arity }.uniq.size == 1
       invalid = true
-      $stderr.puts "arity crash [event=#{event}]: #{
+      $stderr.puts "arity crash [event=#{event}]: #{ # "
                      list.map {|line,a| "#{line}:#{a}" }.join(', ')
-                   }"
+                   }"           # "
     end
   end
-  exit 1 if invalid
+  abort if invalid
 end
 
@@ -163,5 +155,5 @@ def read_ids1_with_locations(path)
       next if /ripper_dispatch/ =~ line
       line.scan(/dispatch(\d)\((\w+)/) do |arity, event|
-        (h[event] ||= []).push [f.lineno, arity]
+        (h[event] ||= []).push [f.lineno, arity.to_i]
       end
     end
Index: ext/ripper/tools/preproc.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/ripper/tools/preproc.rb,v
retrieving revision 1.2
diff -U2 -p -r1.2 preproc.rb
--- ext/ripper/tools/preproc.rb	22 Sep 2005 22:08:47 -0000	1.2
+++ ext/ripper/tools/preproc.rb	22 Sep 2005 23:15:26 -0000
@@ -1,5 +1,4 @@
 # $Id: preproc.rb,v 1.2 2005/09/22 22:08:47 aamine Exp $
 
-require 'stringio'
 require 'optparse'
 
@@ -13,5 +12,5 @@ def main
   parser.on('--help', 'Prints this message and quit.') {
     puts parser.help
-    exit 0
+    exit true
   }
   begin
@@ -20,11 +19,10 @@ def main
     $stderr.puts err.message
     $stderr.puts parser.help
-    exit 1
+    exit false
   end
   unless ARGV.size == 1
-    $stderr.puts "wrong number of arguments (#{ARGV.size} for 1)"
-    exit 1
+    abort "wrong number of arguments (#{ARGV.size} for 1)"
   end
-  out = StringIO.new
+  out = ""
   File.open(ARGV[0]) {|f|
     prelude f, out
@@ -34,8 +32,8 @@ def main
   if output
     File.open(output, 'w') {|f|
-      f.write out.string
+      f.write out
     }
   else
-    print out.string
+    print out
   end
 end
@@ -45,18 +43,18 @@ def prelude(f, out)
     case line
     when %r</\*%%%\*/>
-      out.puts '/*'
+      out << '/*' << $/
     when %r</\*%>
-      out.puts '*/'
+      out << '*/' << $/
     when %r<%\*/>
-      out.puts
+      out << $/
     when /\A%%/
-      out.puts '%%'
+      out << '%%' << $/
       return
     when /\A%token/
-      out.puts line.sub(/<\w+>/, '<val>')
+      out << line.sub(/<\w+>/, '<val>') << $/
     when /\A%type/
-      out.puts line.sub(/<\w+>/, '<val>')
+      out << line.sub(/<\w+>/, '<val>') << $/
     else
-      out.print line
+      out << line
     end
   end
@@ -67,18 +65,18 @@ def grammar(f, out)
     case line
     when %r</\*%%%\*/>
-      out.puts '#if 0'
+      out << '#if 0' << $/
     when %r</\*%c%\*/>
-      out.puts '/*'
+      out << '/*' << $/
     when %r</\*%c>
-      out.puts '*/'
+      out << '*/' << $/
     when %r</\*%>
-      out.puts '#endif'
+      out << '#endif' << $/
     when %r<%\*/>
-      out.puts
+      out << $/
     when /\A%%/
-      out.puts '%%'
+      out << '%%' << $/
       return
     else
-      out.print line
+      out << line
     end
   end
@@ -87,5 +85,5 @@ end
 def usercode(f, out)
   while line = f.gets
-    out.print line
+    out << line
   end
 end


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread