1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Add #set to define preprocessors constants from an imported file

This commit is contained in:
Étienne Fildadut 2021-06-18 14:37:45 +02:00
parent d4102f1af6
commit 53f715cc6f
2 changed files with 177 additions and 357 deletions

View file

@ -184,6 +184,10 @@ function candran.preprocess(input, options={})
error("invalid macro type %s":format(tostring(iast.tag)))
end
end
env.set = function(identifier, value)
options.preprocessorEnv[identifier] = value
env[identifier] = value
end
-- default macros
if options.builtInMacros then