jasononeil / webpack-haxe-loader

Webpack loader for the Haxe programming language.
MIT License
38 stars 11 forks source link

Macro with multiple sets of quotes fails to compile #60

Open jgranick opened 5 years ago

jgranick commented 5 years ago

The HXML compiles properly without using haxe-loader but fails due to a macro call with multiple sets of quotes:

--macro addMetadata("@:build(com.test.Hack.build())", "Math")

This would be resolved with: https://github.com/jasononeil/webpack-haxe-loader/issues/31

This is probably also related to: https://github.com/jasononeil/webpack-haxe-loader/issues/28

elsassph commented 5 years ago

@jgranick can you try using single quotes? Currently we take the entire value and put it between double-quotes.

jgranick commented 5 years ago

I did try

If memory serves, either way it ends up looking something like:

--macro "addMetadata(@:build(com.test.Hack.build())", Math)

...and breaking the build

elsassph commented 5 years ago

Agh ok the bug is in the tokenisation library we're using to parse the arguments. Here's something that works (pre-quoted using double quotes, single quotes inside): --macro "addMetadata('@:keep', 'Test1')"