Compiler/Preprocessor: Difference between revisions
m
syntax highlighting fixup automation
(→Task) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 61:
=={{header|Julia}}==
<
""" If the line is a macro definition, add the macro to macros. """
Line 201:
runwithopts(preprocess)
</
=={{header|Phix}}==
No attempt to implement command line arguments, obviously trivial on desktop/Phix but not possible under pwa/p2js, aka within a browser.
<!--<
<span style="color: #000080;font-style:italic;">--
-- demo\rosetta\Compiler\preprocess.exw
Line 381:
<span style="color: #000080;font-style:italic;">--close_files()</span>
<!--</
{{out}}
<pre>
Line 399:
=={{header|Python}}==
<
"""Rosetta Code compiler/preprocessor. Requires Python >= 3.7."""
import re
Line 742:
args = parser.parse_args()
preprocess(args.infile.read(), args.infile.name, args.outfile, debug=args.debug)
</syntaxhighlight>
{{out}}
Line 802:
Note that the program errors out if there are any syntax or other errors when defining the macros.
<
import "./ioutil" for FileUtil, File, Input
import "./str" for Char
Line 980:
file.writeBytes("\n")
}
}</
{{out}}
|