summaryrefslogtreecommitdiff
path: root/test/trans.d/case/curs1_go.rl
diff options
context:
space:
mode:
Diffstat (limited to 'test/trans.d/case/curs1_go.rl')
-rw-r--r--test/trans.d/case/curs1_go.rl67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/trans.d/case/curs1_go.rl b/test/trans.d/case/curs1_go.rl
new file mode 100644
index 00000000..1c9058a2
--- /dev/null
+++ b/test/trans.d/case/curs1_go.rl
@@ -0,0 +1,67 @@
+/*
+ * @LANG: go
+ * @GENERATED: true
+ */
+
+package main
+import "fmt"
+
+var return_to int ;
+
+%%{
+ machine curs1;
+
+ unused := 'unused';
+
+ one := 'one' @{fmt.Print( "one\n" );fnext *return_to;
+
+};
+
+ two := 'two' @{fmt.Print( "two\n" );fnext *return_to;
+
+};
+
+ main :=
+ '1' @{return_to = fcurs;
+fnext one;
+}
+ | '2' @{return_to = fcurs;
+fnext two;
+}
+ | '\n';
+}%%
+
+
+var cs int;
+var blen int;
+var buffer [1024] byte;
+
+%% write data;
+
+func prepare() {
+ %% write init;
+}
+
+func exec(data string) {
+ var p int = 0
+ var pe int = len(data)
+ %% write exec;
+}
+func finish() {
+ if cs >= curs1_first_final {
+ fmt.Println("ACCEPT")
+ } else {
+ fmt.Println("FAIL")
+ }
+}
+var inp []string = []string {
+"1one2two1one\n",
+};
+
+func main() {
+ for _, data := range inp {
+ prepare()
+ exec(data)
+ finish()
+ }
+}