nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nitg: add option --global
[nit.git]
/
src
/
nitg.nit
diff --git
a/src/nitg.nit
b/src/nitg.nit
index
fbb09c2
..
7b442a0
100644
(file)
--- a/
src/nitg.nit
+++ b/
src/nitg.nit
@@
-18,7
+18,7
@@
module nitg
import modelbuilder
module nitg
import modelbuilder
-import exprbuilder
+import frontend
import rapid_type_analysis
import global_compiler
import separate_erasure_compiler
import rapid_type_analysis
import global_compiler
import separate_erasure_compiler
@@
-26,6
+26,11
@@
import separate_compiler
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
+
+# Create a new option for --global
+var opt_global = new OptionBool("Use global compilation", "--global")
+toolcontext.option_context.add_option(opt_global)
+
# We do not add other options, so process them now!
toolcontext.process_options
# We do not add other options, so process them now!
toolcontext.process_options
@@
-47,9
+52,9
@@
end
var progname = arguments.first
# Here we load an process all modules passed on the command line
var progname = arguments.first
# Here we load an process all modules passed on the command line
-var mmodules = modelbuilder.parse_and_build([progname])
+var mmodules = modelbuilder.parse([progname])
if mmodules.is_empty then return
if mmodules.is_empty then return
-modelbuilder.full_propdef_semantic_analysis
+modelbuilder.run_phases
if toolcontext.opt_only_metamodel.value then exit(0)
if toolcontext.opt_only_metamodel.value then exit(0)