7.1 Generating files in the source tree 在源代码树中生成文件

https://lalrpop.github.io/lalrpop/generate_in_source.html

Up to version 0.15, LALRPOP was generating its files in the same directory of the input files. Since 0.16, files are generated in the Cargo's output directory.

MST -- 直到版本 0.15,LALRPOP 在输入文件的同一目录中生成文件。从 0.16 开始,文件在 Cargo 的输出目录中生成。

GPT -- “直到 0.15 版本,LALRPOP 会在输入文件的同一目录中生成文件。从 0.16 版本开始,文件会生成在 Cargo 的输出目录中。”

If you want to keep the previous behaviour, you can use generate_in_source_tree in your configuration:

MST -- 如果你想保留之前的行为,你可以在你的配置中使用 generate_in_source_tree:

GPT -- “如果你想保持之前的行为,可以在你的配置中使用 generate_in_source_tree:”

fn main() {
    lalrpop::Configuration::new()
        .generate_in_source_tree()
        .process().unwrap();
}

For each foo.lalrpop file you can simply have mod foo; in your source tree. The lalrpop_mod macro is not useful in this mode.

MST -- 对于每个 foo.lalrpop 文件,您可以简单地使用 mod foo;在你的源代码树中。lalrpop_mod 宏在此模式下没有用。

GPT -- “对于每个 foo.lalrpop 文件,你可以简单地在源代码树中使用 mod foo;。在这种模式下,lalrpop_mod 宏是没有用的。”

posted on 2025-01-05 19:45  及途又八  阅读(10)  评论(0)    收藏  举报

导航