Skip to content

Commit

Permalink
Fix the order of Rust and Ruby
Browse files Browse the repository at this point in the history
And a bit improvement
  • Loading branch information
mame committed Oct 8, 2017
1 parent 2658df8 commit be3b845
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/code-gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ def f(s,n)s.gsub(/.{1,#{n*255}}/m){yield$S=E[$s=$&]}end;
END
# rp: Re-Pair (Naive byte pair encoding)

class Rust < CodeGen
File = "QR.rs"
Cmd = "rustc QR.rs && ./QR > OUTFILE"
Apt = "rustc"
Code = %q(%(fn main(){println!("{}",#{E[PREV]});}))
end

class Python_R_Ratfor_REXX < CodeGen
File = ["QR.py", "QR.R", "QR.ratfor", "QR.rexx"]
Cmd = [
Expand Down Expand Up @@ -920,7 +913,7 @@ def code
)
for(n=9;substr(s,j,1)!=sprintf("%c",++n););
s="\\"4,:,";
split("#{ "BLC".unpack(?m)[0].bytes * g }",a);
split("#{"BLC".unpack(?m)[0].bytes*g}",a);
for(i in a){
s=s 0;
for(c=a[i]+0;c;c--)s=s"1+";
Expand Down Expand Up @@ -1158,6 +1151,13 @@ def code
end
end

class Rust < CodeGen
File = "QR.rs"
Cmd = "rustc QR.rs && ./QR > OUTFILE"
Apt = "rustc"
Code = %q(%(fn main(){print!("{}",#{E[PREV]});}))
end

class Ruby < CodeGen
File = "QR.rb"
Cmd = "ruby QR.rb > OUTFILE"
Expand Down

0 comments on commit be3b845

Please sign in to comment.