summaryrefslogtreecommitdiff
path: root/ocamltest/tsl_lexer.mll
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez@inria.fr>2021-04-28 18:03:51 +0200
committerDamien Doligez <damien.doligez@inria.fr>2021-04-28 18:03:51 +0200
commit620f2cb93ce16a793bc0c5255b490e7a911e5710 (patch)
treeb968b06ebefbfb002772e072fa72aeab0192bc81 /ocamltest/tsl_lexer.mll
parentebddee737b3f532eb77b127450598c2eb1afd75c (diff)
downloadocaml-620f2cb93ce16a793bc0c5255b490e7a911e5710.tar.gz
use a marker at the top when the test block is at the end of the file
Diffstat (limited to 'ocamltest/tsl_lexer.mll')
-rw-r--r--ocamltest/tsl_lexer.mll5
1 files changed, 3 insertions, 2 deletions
diff --git a/ocamltest/tsl_lexer.mll b/ocamltest/tsl_lexer.mll
index e099336609..d427f7ed04 100644
--- a/ocamltest/tsl_lexer.mll
+++ b/ocamltest/tsl_lexer.mll
@@ -33,11 +33,12 @@ rule token = parse
| blank * { token lexbuf }
| newline { Lexing.new_line lexbuf; token lexbuf }
| "/*" blank* "TEST" { TSL_BEGIN_C_STYLE }
+ | "/*" blank* "TEST_SCRIPT_BELOW" _ * "/*" blank* "TEST" { TSL_BEGIN_C_STYLE }
| "*/" { TSL_END_C_STYLE }
| "(*" blank* "TEST" { TSL_BEGIN_OCAML_STYLE }
+ | "(*" blank* "TEST_SCRIPT_BELOW" _ * "(*" blank* "TEST"
+ { TSL_BEGIN_OCAML_STYLE }
| "*)" { TSL_END_OCAML_STYLE }
- | _ * "(*" blank* "TEST" { TSL_BEGIN_OCAML_STYLE_AT_EOF }
- | "*)" (blank | newline) * eof { TSL_END_OCAML_STYLE_AT_EOF }
| "," { COMMA }
| '*'+ { TEST_DEPTH (String.length (Lexing.lexeme lexbuf)) }
| "+=" { PLUSEQUAL }