哪个 Flash SWF 编译器使用编译器指令?

发布于 2024-07-11 04:33:09 字数 548 浏览 7 评论 0原文

现有的 Flash SWF 编译器是否可以理解 #IF #ENDIF 等指令?

一些 SWF 编译器:(希望)

Any existing Flash SWF compilers that can understand directives like #IF #ENDIF, etc?

Some SWF Compilers: (Hopefuls)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赴月观长安 2024-07-18 04:33:09

我使用过mtasc,它不支持这种条件编译。 但是,它看起来像 Flex 3 的 mxmlc 通过 -define 命令行选项对此提供支持。 此外,Haxe 完全可以满足您的需求

I've used mtasc, and it does not support this kind of conditional compilation. However, it looks like Flex 3's mxmlc has support for this via the -define command line option. Also, Haxe does exactly what you want.

素手挽清风 2024-07-18 04:33:09

MXMLC 编译器还支持条件编译,尽管它相当原始且实现方式很奇怪。

他们没有实施“ifdef”。 相反,我们只是从赋值中获取逗号后面的值。 虽然这对于字符串插入来说效果很好,但对于布尔值来说却很令人困惑。

以下示例仅编译该方法的“release”实现:

-define=CONFIG::debugging,false -define=CONFIG::release,true

然后在源代码中:

CONFIG::debugging
private function configure():void {
    // set up for debugging
}

CONFIG::release
private function configure():void {
    // set up for release
}

The MXMLC compiler also supports conditional compilation, though it is pretty primitive and strangely-implemented.

They didn't implement 'ifdef'. Instead we just get the value after the comma from the assignment. While this works fine for string insertion, it's pretty confusing for booleans.

The following example would only compile the 'release' implementation of the method:

-define=CONFIG::debugging,false -define=CONFIG::release,true

Then in your source code:

CONFIG::debugging
private function configure():void {
    // set up for debugging
}

CONFIG::release
private function configure():void {
    // set up for release
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文