- Timestamp:
- 09/28/08 11:36:08 (2 months ago)
- Location:
- platform/unbabel/trunk
- Files:
-
- 12 modified
-
perl/lib/unbabel.pm (modified) (4 diffs)
-
presen/biwascheme/extra_lib.js (modified) (1 prop)
-
presen/biwascheme/prototype.160.js (modified) (1 prop)
-
ruby/README.txt (modified) (1 diff)
-
ruby/lib/unbabel.rb (modified) (6 diffs)
-
ruby/spec/spec_java.rb (modified) (2 diffs)
-
ruby/spec/spec_perl.rb (modified) (1 diff)
-
ruby/spec/spec_python.rb (modified) (1 diff)
-
ruby/spec/spec_ruby.rb (modified) (1 diff)
-
ruby/spec/spec_ruby19.rb (modified) (1 diff)
-
ruby/spec/spec_scheme.rb (modified) (1 diff)
-
ruby/spec/spec_unbabel.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/unbabel/trunk/perl/lib/unbabel.pm
r18558 r20100 6 6 ## called when this module is use'd 7 7 #sub import { 8 # print @_; 8 # print @_; 9 9 #} 10 10 … … 20 20 my ($self, $script, $comment) = @_; 21 21 die "error: need a script" unless defined($script); 22 $script =~ ($comment . "\\s*(\\S+)\\s*::\\s*((?:\\S+\\s*->\\s*)+)(\\S+)\\s*"); 22 $script =~ ($comment . "\\s*(\\S+)\\s*::\\s*((?:\\S+\\s*->\\s*)+)(\\S+)\\s*"); 23 23 my ($funcname, $argtypes, $rettype) = ($1, $2, $3); 24 24 die "error: signature not found: " . $script unless defined($1); … … 84 84 } 85 85 elsif ($type eq "String") { 86 $arg =~ s/\\/\\\\/g; 87 $arg =~ s/\n/\\n/g; 88 $arg =~ s/\t/\\t/g; 86 $arg =~ s/(?=[\\\r\n\t])/\\/g; 89 87 return '"' . $arg . '"'; 90 88 } … … 130 128 # elsif (($arg ^ $arg) eq "") { # string 131 129 # die "stringstring"; 132 # $arg =~ s/\\/\\\\/g; 133 # $arg =~ s/\n/\\n/g; 134 # $arg =~ s/\t/\\t/g; 130 # $arg =~ s/(?=[\\\r\n\t])/\\/g; 135 131 # return '"' . $arg . '"'; 136 132 # } -
platform/unbabel/trunk/presen/biwascheme/extra_lib.js
- Property svn:executable deleted
-
platform/unbabel/trunk/presen/biwascheme/prototype.160.js
- Property svn:executable deleted
-
platform/unbabel/trunk/ruby/README.txt
r18558 r20100 1 this is ruby implementation of Unbabel.1 this is Ruby implementation of Unbabel. 2 2 3 3 = requirements -
platform/unbabel/trunk/ruby/lib/unbabel.rb
r18558 r20100 16 16 class String 17 17 def lines 18 self.split(/\r?\n /).map{|line| line+"\n"}18 self.split(/\r?\n|\r/).map{|line| line+"\n"} 19 19 end 20 20 end 21 21 end 22 22 23 23 24 24 module Unbabel … … 99 99 # run it 100 100 if langdef.name == "Java" 101 temp_java = File.expand_path("Unbabel.java", File.dirname(tempfile.path))101 temp_java = File.expand_path("Unbabel.java", File.dirname(tempfile.path)) 102 102 temp_jclass = File.expand_path("Unbabel.class", File.dirname(tempfile.path)) 103 103 system "cp #{tempfile.path} #{temp_java}" … … 127 127 when "[String]" 128 128 result =~ /\((.*)\)/ 129 $1.split(/ /).map{|x| 129 $1.split(/ /).map{|x| 130 130 x =~ /"(.*)"/ 131 131 $1 … … 153 153 src = File.read(path) 154 154 src.lines.each do |line| 155 if in_stub 155 if in_stub 156 156 stub << line 157 157 else … … 193 193 case x 194 194 when Array 195 list_prefix + "(" + 195 list_prefix + "(" + 196 196 x.map{|item| format_object(item, delimiter, "")}.join(delimiter) + ")" 197 197 when String … … 221 221 222 222 # TODO: configurable template path 223 dir = File.expand_path("../../templates/", File.dirname(__FILE__)) 223 dir = File.expand_path("../../templates/", File.dirname(__FILE__)) 224 224 Dir.glob("#{dir}/*.unb").each do |path| 225 225 langdef = Unbabel::LangDef.load(path) -
platform/unbabel/trunk/ruby/spec/spec_java.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel" do 4 describe "Unbabel" do 5 5 6 6 it "should call Java function" do … … 9 9 public static int fib (int x) { 10 10 switch(x){ 11 case 0: return 0; 11 case 0: return 0; 12 12 case 1: return 1; 13 default: 13 default: 14 14 return fib(x-2) + fib(x-1); 15 15 } -
platform/unbabel/trunk/ruby/spec/spec_perl.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel21" do 4 describe "Unbabel21" do 5 5 6 6 it "should call Perl function" do -
platform/unbabel/trunk/ruby/spec/spec_python.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel21" do 4 describe "Unbabel21" do 5 5 6 6 it "should call Python function" do -
platform/unbabel/trunk/ruby/spec/spec_ruby.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel21" do 4 describe "Unbabel21" do 5 5 6 6 it "should call Ruby function :-)" do -
platform/unbabel/trunk/ruby/spec/spec_ruby19.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel21" do 4 describe "Unbabel21" do 5 5 6 6 it "should call Ruby 1.9 function ;-)" do -
platform/unbabel/trunk/ruby/spec/spec_scheme.rb
r18558 r20100 2 2 require 'unbabel' 3 3 4 describe "Unbabel21" do 4 describe "Unbabel21" do 5 5 6 6 it "should call Scheme function" do -
platform/unbabel/trunk/ruby/spec/spec_unbabel.rb
r18558 r20100 166 166 ### Runner 167 167 168 describe "Unbabel::Runner" do 168 describe "Unbabel::Runner" do 169 169 before :all do 170 170 @SRC = SRC_SCHEME_FIB … … 215 215 ### Integraton test 216 216 217 describe "Unbabel21" do 217 describe "Unbabel21" do 218 218 219 219 it "should call Scheme fibonacchi" do
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)