Closed hishamhm closed 6 years ago
Merging #230 into master will decrease coverage by
1.1%
. The diff coverage is58.69%
.
Impacted Files | Coverage Δ | |
---|---|---|
titan-compiler/driver.lua | 59.57% <43.47%> (-14.26%) |
:arrow_down: |
titan-compiler/checker.lua | 89.5% <8.33%> (-1.11%) |
:arrow_down: |
titan-compiler/coder.lua | 96.34% <97.05%> (-0.05%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b473e32...a089310. Read the comment docs.
This PR adds support for compiling stand-alone executables.
If a module contains a
main
function with signaturefunction({string}):integer
, that is the main entry point of the program. The input argument is an array of strings containing the command-line arguments, and the integer return value is the exit code of the program.Only one of the modules given to
titanc
may contain amain
function.When compiling a program as a single executable,
titanc
does not use dynamic linking to resolve references in imports. Instead, it generates simpleextern
declarations that are resolved in the linking step.The
examples.sdl_demo
example is modified to demonstrate this, moving the helper function into a separate module.Additionally, this adds a
-v
/--verbose
flag totitanc
, which makes it display the C compiler invocations.