如何将 -ml 标志(或任何标志,实际上)添加到沙丘文件中的 ocamllex?

问题描述 投票:0回答:1

这是我当前的

dune
文件:

(library
(name parsing)
(libraries toto fmt menhirLib)
(modules parser lexer lex_and_parse)
)

(ocamllex lexer)

(menhir
 (modules parser)
 (flags --explain -v))

我知道拥有太大的自动机可能不是一个好主意,但是对我来说能够在当前状态下调试我的词法分析器会很方便,这意味着允许带有

-ml
标志的更大的自动机。我无法向 ocamllex 提供标志。有什么想法吗?

ocaml lexer dune
1个回答
0
投票

(ocamllex lexer)
替换为

(rule
 (target lexer.ml)
 (deps   lexer.mll)
 (action (chdir %{workspace_root}
          (run %{bin:ocamllex} -q -o %{target} %{deps}))))
;                             ^^^^^^^^
;                       add your flags here
© www.soinside.com 2019 - 2024. All rights reserved.