From 5c753b030ab6b9435755d0fb538c0a6cca37923c Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Sun, 26 Dec 2021 21:58:54 +0000 Subject: need to add regular language definitions to trans.lm, removed from ragel.lm --- test/ragel.d/trans.lm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/ragel.d/trans.lm b/test/ragel.d/trans.lm index 660f94b8..b2897c0e 100644 --- a/test/ragel.d/trans.lm +++ b/test/ragel.d/trans.lm @@ -1,5 +1,37 @@ include 'ragel.lm' +rl ident + /( alpha | '_' ) ( alpha | digit | '_' )*/ + +rl number + / digit+ / + +rl hex_number + / '0x' [0-9a-fA-F]+ / + +rl hex_char + / '0x' [0-9a-fA-F]{2} / + +rl NL / '\n' / + +rl c_comment + / '/*' ( any | NL )* :>> '*/' / + +rl cpp_comment + / '//' [^\n]* NL / + +rl ruby_comment + / '#' [^\n]* NL / + +rl s_literal + / "'" ([^'\\\n] | '\\' (any | NL))* "'" / + +rl d_literal + / '"' ([^"\\] | NL | '\\' (any | NL))* '"' / + +rl host_re_literal + / '/' ([^/\\] | NL | '\\' (any | NL))* '/' / + namespace inline lex literal `fpc `fc `fcurs `ftargs -- cgit v1.2.1