meta_compile 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/meta_compile +2 -2
- data/bootstrap/meta_for_ruby.txt +3 -3
- metadata +1 -1
data/bin/meta_compile
CHANGED
@@ -5,7 +5,7 @@ def compile(str, out)
|
|
5
5
|
@i, @o = StringScanner.new(str), out
|
6
6
|
compile_program
|
7
7
|
end
|
8
|
-
def
|
8
|
+
def compile_outarg
|
9
9
|
begin
|
10
10
|
@i.scan /\s*/; s='$'
|
11
11
|
@f = (@i.peek(s.length) == s) ? (@t=s; @i.pos += s.length) : nil
|
@@ -28,7 +28,7 @@ begin
|
|
28
28
|
@f = (@i.peek(s.length) == s) ? (@t=s; @i.pos += s.length) : nil
|
29
29
|
if @f
|
30
30
|
begin
|
31
|
-
|
31
|
+
compile_outarg
|
32
32
|
end while @f
|
33
33
|
@f = true
|
34
34
|
raise("error at: " + @i.rest.split("\n")[0]) if !@f
|
data/bootstrap/meta_for_ruby.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
.syntax RMetaII
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
outarg = '$' <'@o.print @t'>
|
4
|
+
| .string <'@o.print ' $>;
|
5
5
|
|
6
|
-
out = '<' *
|
6
|
+
out = '<' *outarg '>' <'@o.print "\n"'>;
|
7
7
|
|
8
8
|
exp3 = .id <'compile_' $>
|
9
9
|
| .string <'@i.scan /\s*/; s=' $>
|