summaryrefslogtreecommitdiff
path: root/test/trans.d
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2017-02-22 16:28:57 +0800
committerAdrian Thurston <thurston@colm.net>2017-02-22 16:28:57 +0800
commitd503447cc85fdd11357d26f87f729eee00eb4a3e (patch)
tree3a5831ef148ea29ce846af7905543f78a8855ac1 /test/trans.d
parentbf4c32ff73537111b7c381f8764cca6fc246b4ba (diff)
downloadcolm-d503447cc85fdd11357d26f87f729eee00eb4a3e.tar.gz
test cases updated for auto-trim
Diffstat (limited to 'test/trans.d')
-rw-r--r--test/trans.d/Makefile4
-rw-r--r--test/trans.d/case/atoi1_ocaml.rl6
-rw-r--r--test/trans.d/case/atoi2_ocaml.rl6
-rw-r--r--test/trans.d/case/cond1_ocaml.rl6
-rw-r--r--test/trans.d/case/gotocallret3_ocaml.rl2
-rw-r--r--test/trans.d/case/next2_ocaml.rl2
-rw-r--r--test/trans.d/case/scan1_ocaml.rl10
-rw-r--r--test/trans.d/trans-asm.lm2
-rw-r--r--test/trans.d/trans-c.lm2
-rw-r--r--test/trans.d/trans-crack.lm2
-rw-r--r--test/trans.d/trans-csharp.lm2
-rw-r--r--test/trans.d/trans-d.lm2
-rw-r--r--test/trans.d/trans-go.lm2
-rw-r--r--test/trans.d/trans-java.lm2
-rw-r--r--test/trans.d/trans-julia.lm2
-rw-r--r--test/trans.d/trans-ocaml.lm2
-rw-r--r--test/trans.d/trans-ruby.lm2
-rw-r--r--test/trans.d/trans-rust.lm2
-rw-r--r--test/trans.d/trans.lm6
19 files changed, 33 insertions, 31 deletions
diff --git a/test/trans.d/Makefile b/test/trans.d/Makefile
index 6fe93336..3a1e977a 100644
--- a/test/trans.d/Makefile
+++ b/test/trans.d/Makefile
@@ -7,6 +7,8 @@ COLM = $(SUBJECT_BIN)
COLM_INC = $(SUBJECT_CPPFLAGS)
COLM_LIB = $(SUBJECT_LDFLAGS)
+TRANS_DEPS = $(wildcard *-*.lm)
+
OBJ = actparams.o trans.o main.o
trans: $(OBJ)
@@ -21,5 +23,5 @@ main.o: main.c
trans.o: trans.c
gcc -c $(COLM_INC) -o $@ $<
-trans.c: trans.lm $(TRANS_DEPS)
+trans.c: trans.lm $(TRANS_DEPS)
$(COLM) -b trans_object -c -o $@ $<
diff --git a/test/trans.d/case/atoi1_ocaml.rl b/test/trans.d/case/atoi1_ocaml.rl
index d84f8813..b0bc8c9f 100644
--- a/test/trans.d/case/atoi1_ocaml.rl
+++ b/test/trans.d/case/atoi1_ocaml.rl
@@ -16,13 +16,13 @@ value := 0;
action see_neg {neg := 1;
}
- action add_digit {value := value .contents * 10 + ( fc - 48 )
+ action add_digit {value := value .contents * 10 + ( fc - 48 )
;
}
- action finish {if neg .contents != 0 then
+ action finish {if neg .contents != 0 then
begin
- value := -1 * value.contents;
+ value := -1 * value.contents;
end
;
diff --git a/test/trans.d/case/atoi2_ocaml.rl b/test/trans.d/case/atoi2_ocaml.rl
index ad40d865..45dc1f6e 100644
--- a/test/trans.d/case/atoi2_ocaml.rl
+++ b/test/trans.d/case/atoi2_ocaml.rl
@@ -16,13 +16,13 @@ value := 0;
action see_neg {neg := 1;
}
- action add_digit {value := value .contents * 10 + ( fc - 48 )
+ action add_digit {value := value .contents * 10 + ( fc - 48 )
;
}
- action finish {if neg .contents != 0 then
+ action finish {if neg .contents != 0 then
begin
- value := -1 * value.contents;
+ value := -1 * value.contents;
end
;
diff --git a/test/trans.d/case/cond1_ocaml.rl b/test/trans.d/case/cond1_ocaml.rl
index 5cf840db..4c01cd53 100644
--- a/test/trans.d/case/cond1_ocaml.rl
+++ b/test/trans.d/case/cond1_ocaml.rl
@@ -20,7 +20,7 @@ let k = ref 0
action three {print_string( " three\n" );
}
- action seti {if fc == 48 then
+ action seti {if fc == 48 then
begin
i := 0;
@@ -32,7 +32,7 @@ begin
end
;
}
- action setj {if fc == 48 then
+ action setj {if fc == 48 then
begin
j := 0;
@@ -44,7 +44,7 @@ begin
end
;
}
- action setk {if fc == 48 then
+ action setk {if fc == 48 then
begin
k := 0;
diff --git a/test/trans.d/case/gotocallret3_ocaml.rl b/test/trans.d/case/gotocallret3_ocaml.rl
index 8784e83e..d4d243cc 100644
--- a/test/trans.d/case/gotocallret3_ocaml.rl
+++ b/test/trans.d/case/gotocallret3_ocaml.rl
@@ -35,7 +35,7 @@ let stack = Array.make 32 0
dig_comm := digit+ $!hold_and_return;
# Choose which to machine to call into based on the command.
- action comm_arg {if comm .contents >= 97 then
+ action comm_arg {if comm .contents >= 97 then
begin
fncall alp_comm;
diff --git a/test/trans.d/case/next2_ocaml.rl b/test/trans.d/case/next2_ocaml.rl
index 2eb127f3..6357296d 100644
--- a/test/trans.d/case/next2_ocaml.rl
+++ b/test/trans.d/case/next2_ocaml.rl
@@ -38,7 +38,7 @@ last := 2;
} |
# This one is conditional based on the last.
- '3' @{if last .contents == 2 then
+ '3' @{if last .contents == 2 then
begin
target := fentry( three );
fnext *target.contents;
diff --git a/test/trans.d/case/scan1_ocaml.rl b/test/trans.d/case/scan1_ocaml.rl
index 74984262..d3a156e6 100644
--- a/test/trans.d/case/scan1_ocaml.rl
+++ b/test/trans.d/case/scan1_ocaml.rl
@@ -15,7 +15,7 @@ let token = ref 0
# coverage of the scanner action types.
main := |*
'a' => {print_string( "on last " );
-if p.contents + 1 == te .contents then
+if p.contents + 1 == te .contents then
begin
print_string( "yes" );
@@ -25,7 +25,7 @@ print_string( "\n" );
};
'b'+ => {print_string( "on next " );
-if p.contents + 1 == te .contents then
+if p.contents + 1 == te .contents then
begin
print_string( "yes" );
@@ -35,7 +35,7 @@ print_string( "\n" );
};
'c1' 'dxxx'? => {print_string( "on lag " );
-if p.contents + 1 == te .contents then
+if p.contents + 1 == te .contents then
begin
print_string( "yes" );
@@ -45,7 +45,7 @@ print_string( "\n" );
};
'd1' => {print_string( "lm switch1 " );
-if p.contents + 1 == te .contents then
+if p.contents + 1 == te .contents then
begin
print_string( "yes" );
@@ -54,7 +54,7 @@ end
print_string( "\n" );
};
'd2' => {print_string( "lm switch2 " );
-if p.contents + 1 == te .contents then
+if p.contents + 1 == te .contents then
begin
print_string( "yes" );
diff --git a/test/trans.d/trans-asm.lm b/test/trans.d/trans-asm.lm
index 1563e85e..1adcb6af 100644
--- a/test/trans.d/trans-asm.lm
+++ b/test/trans.d/trans-asm.lm
@@ -457,7 +457,7 @@ void rw_asm( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
" .text
" .comm buf, 1024, 32
diff --git a/test/trans.d/trans-c.lm b/test/trans.d/trans-c.lm
index f93d7b34..563e1eec 100644
--- a/test/trans.d/trans-c.lm
+++ b/test/trans.d/trans-c.lm
@@ -261,7 +261,7 @@ void rw_c( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"int cs;
diff --git a/test/trans.d/trans-crack.lm b/test/trans.d/trans-crack.lm
index c6ef9fb0..f9506cb6 100644
--- a/test/trans.d/trans-crack.lm
+++ b/test/trans.d/trans-crack.lm
@@ -288,7 +288,7 @@ void crack( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"
diff --git a/test/trans.d/trans-csharp.lm b/test/trans.d/trans-csharp.lm
index 7fd895e2..5cd31085 100644
--- a/test/trans.d/trans-csharp.lm
+++ b/test/trans.d/trans-csharp.lm
@@ -272,7 +272,7 @@ void rw_csharp( Output: stream )
}
send Output
- ["\n" Section "\n"]
+ ["\n" @Section "\n"]
send Output
"%% write data;
diff --git a/test/trans.d/trans-d.lm b/test/trans.d/trans-d.lm
index d3f86d58..674b0555 100644
--- a/test/trans.d/trans-d.lm
+++ b/test/trans.d/trans-d.lm
@@ -252,7 +252,7 @@ void rw_d( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"int cs;
diff --git a/test/trans.d/trans-go.lm b/test/trans.d/trans-go.lm
index 506f6a32..30a5600f 100644
--- a/test/trans.d/trans-go.lm
+++ b/test/trans.d/trans-go.lm
@@ -256,7 +256,7 @@ void rw_go( Output: stream )
Action = parse ragel::action_block[$Out->tree]
}
- prints( Output, '\n', Section, '\n' )
+ send Output ['\n' @Section '\n']
send Output
"var cs int;
diff --git a/test/trans.d/trans-java.lm b/test/trans.d/trans-java.lm
index 7503ba97..99c1b486 100644
--- a/test/trans.d/trans-java.lm
+++ b/test/trans.d/trans-java.lm
@@ -266,7 +266,7 @@ void rw_java( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"int cs;
diff --git a/test/trans.d/trans-julia.lm b/test/trans.d/trans-julia.lm
index 9a0659fa..ed918dbb 100644
--- a/test/trans.d/trans-julia.lm
+++ b/test/trans.d/trans-julia.lm
@@ -275,7 +275,7 @@ void julia( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"
diff --git a/test/trans.d/trans-ocaml.lm b/test/trans.d/trans-ocaml.lm
index 39bffb74..4298637f 100644
--- a/test/trans.d/trans-ocaml.lm
+++ b/test/trans.d/trans-ocaml.lm
@@ -310,7 +310,7 @@ void rw_ocaml( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"
"%% write data;
diff --git a/test/trans.d/trans-ruby.lm b/test/trans.d/trans-ruby.lm
index 22bbaea7..df0f346c 100644
--- a/test/trans.d/trans-ruby.lm
+++ b/test/trans.d/trans-ruby.lm
@@ -268,7 +268,7 @@ void rw_ruby( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"
diff --git a/test/trans.d/trans-rust.lm b/test/trans.d/trans-rust.lm
index e9254bc9..b75f672b 100644
--- a/test/trans.d/trans-rust.lm
+++ b/test/trans.d/trans-rust.lm
@@ -289,7 +289,7 @@ void rust( Output: stream )
send Output
"
- "[Section]
+ "[@Section]
"
"%% write data;
"
diff --git a/test/trans.d/trans.lm b/test/trans.d/trans.lm
index 5ccca1d5..b9fa5870 100644
--- a/test/trans.d/trans.lm
+++ b/test/trans.d/trans.lm
@@ -135,7 +135,7 @@ namespace indep
else {
return cons abs_expr [
abs_multiplicative( Expr._multiplicative )
- Expr.Op
+ @Expr.Op
Expr.factor
]
}
@@ -151,7 +151,7 @@ namespace indep
else {
return cons abs_expr [
abs_additive( Expr._additive )
- Expr.Op
+ @Expr.Op
abs_multiplicative( Expr.multiplicative )
]
}
@@ -167,7 +167,7 @@ namespace indep
else {
return cons abs_expr [
abs_comparative( Expr._comparative )
- Expr.Op
+ @Expr.Op
abs_additive( Expr.additive )
]
}