Compiler/Preprocessor: Difference between revisions

m
remove unused code
(julia example)
m (remove unused code)
Line 63:
=={{header|Julia}}==
<lang ruby>""" Rosetta Code task Compiler/Preprocessor task """
 
 
""" if Char can be used in identifier """
isidentifierchar(c) = isletter(c) || isnumeric(c) || (c == '_')
 
""" If this is an identifier, all Chars are valid identifier Chars and first is nonnumeric """
isidentifier(s) = s != "" && !isnumeric([1]) && all(isidentifierchar, s)
 
""" If the line is a macro definition, add the macro to macros. """
Line 187 ⟶ 180:
end
 
""" Process command line, open files if needed, hand off to function `func`, close files """
function runwithopts(func, minargs = 0, maxargs = 3)
minargs <= length(ARGS) <= maxargs || error("Wrong number of arguments ($minargs:$maxargs)")
Line 209 ⟶ 203:
runwithopts(preprocess)
</lang>{{out}} Same output as Phix entry.
 
 
=={{header|Phix}}==
4,102

edits