summaryrefslogtreecommitdiff
path: root/test/ragel.d/rust1.rl
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
committerAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
commitfff52cd5a567ec541cd487b9fee2d89bf9b6f6eb (patch)
tree046a3f0f457343f7c99bf096863daf023a085051 /test/ragel.d/rust1.rl
parent2d8e9c3f5c0417d6237c945c50f92bf8d28b32d5 (diff)
downloadcolm-fff52cd5a567ec541cd487b9fee2d89bf9b6f6eb.tar.gz
base (aapl, colm, ragel) test cases building
Diffstat (limited to 'test/ragel.d/rust1.rl')
-rw-r--r--test/ragel.d/rust1.rl37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/ragel.d/rust1.rl b/test/ragel.d/rust1.rl
new file mode 100644
index 00000000..8a95425e
--- /dev/null
+++ b/test/ragel.d/rust1.rl
@@ -0,0 +1,37 @@
+//
+// @LANG: rust
+//
+
+%%{
+ machine atoi;
+
+ main := '-'? [0-9]+ '.' @{
+ println!( "match" );
+ };
+}%%
+
+%% write data;
+
+fn m( s: String )
+{
+ let data: &[u8] = s.as_bytes();
+ let mut p = 0;
+ let mut pe = s.len();
+ let mut cs: i32 = 0;
+
+ %% write init;
+ %% write exec;
+}
+
+fn main()
+{
+ m( "-99.".to_string() );
+ m( "100.".to_string() );
+ m( "100x.".to_string() );
+ m( "1000.".to_string() );
+}
+
+##### OUTPUT #####
+match
+match
+match