diff options
author | Adrian Thurston <thurston@colm.net> | 2020-03-08 23:29:57 +0200 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2020-03-08 23:53:25 +0200 |
commit | 78e7949ca590b273c2c152a0abe0d51e590a52fd (patch) | |
tree | c253c852aec77af8a04c24d921d8657ff29c4101 /test/ragel.d/eofret1.rl | |
parent | 5718c319424a21b64e1b50dbb6aae644715b9e85 (diff) | |
download | colm-78e7949ca590b273c2c152a0abe0d51e590a52fd.tar.gz |
remove the ragel tests, export runtests for use by ragel
Diffstat (limited to 'test/ragel.d/eofret1.rl')
-rw-r--r-- | test/ragel.d/eofret1.rl | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/test/ragel.d/eofret1.rl b/test/ragel.d/eofret1.rl deleted file mode 100644 index fc2b8cab..00000000 --- a/test/ragel.d/eofret1.rl +++ /dev/null @@ -1,107 +0,0 @@ -/* - * @LANG: indep - * @NEEDS_EOF: yes - * @PROHIBIT_LANGUAGES: cv ruby ocaml rust crack - * @PROHIBIT_FLAGS: --var-backend - * - * Testing fret in an EOF action. - */ - -bool neg; -int value; - -value = 0; -neg = false; - -int top; -int stack[32]; - -%%{ - machine atoi; - - action begin { - neg = false; - value = 0; - } - - action see_neg { - neg = true; - } - - action add_digit { - value = value * 10 + <int>(fc - 48); - } - - action finish { - if ( neg ) { - value = -1 * value; - } - } - action print { - print_int value; - print_str "\n"; - } - - - atoi = ( - ('-'@see_neg | '+')? (digit @add_digit)+ - ) >begin %finish; - - action done - { - print_str "done: "; - print_off; - print_str "\n"; - } - - action extra - { - print_str "goto extra\n"; - fhold; - fret; - } - - # Jump to the real main so we can fret back here to check the offset. - main := any @{ fhold; fcall atoi; } "" %done; - - main_ := atoi '\n' @print %extra; -}%% - -##### INPUT ##### - "1\n" - "12\n" - "222222\n" - "+2123\n" - "213 3213\n" - "-12321\n" - "--123\n" - "-99\n" - " -3000\n" -##### OUTPUT ##### -1 -goto extra -done: 2 -ACCEPT -12 -goto extra -done: 3 -ACCEPT -222222 -goto extra -done: 7 -ACCEPT -2123 -goto extra -done: 6 -ACCEPT -FAIL --12321 -goto extra -done: 7 -ACCEPT -FAIL --99 -goto extra -done: 4 -ACCEPT -FAIL |