src/nitlight: Updated client to avoid crashes on unparsed modules
[nit.git] / src / nitlight.nit
index ddb1887..176ec5f 100644 (file)
@@ -23,7 +23,7 @@ var toolcontext = new ToolContext
 toolcontext.keep_going = true
 
 var opt_fragment = new OptionBool("Omit document header and footer", "-f", "--fragment")
-var opt_line_id_prefix = new OptionString("Prefix of the id of each line <span> element", "--line-id-prefix")
+var opt_line_id_prefix = new OptionString("Prefix of the id of each line `<span>` element", "--line-id-prefix")
 var opt_first_line = new OptionInt("Start the source file at this line (default: 1)", 0, "--first-line")
 var opt_last_line = new OptionInt("End the source file at this line (default: to the end)", 0, "--last-line")
 var opt_dir = new OptionString("Output html files in a specific directory (required if more than one module)", "-d", "--dir")
@@ -41,7 +41,7 @@ var args = toolcontext.option_context.rest
 var mmodules = modelbuilder.parse_full(args)
 modelbuilder.run_phases
 
-if opt_full.value then mmodules = model.mmodules
+if opt_full.value then mmodules = modelbuilder.parsed_modules
 
 var dir = opt_dir.value
 if dir != null then
@@ -59,6 +59,8 @@ for mm in mmodules do
        if prefix != null then
                v.line_id_prefix = prefix.trim
        end
+       v.include_loose_tokens = true
+       v.include_whole_lines = true
 
        if opt_first_line.value != 0 then v.first_line = opt_first_line.value
        if opt_last_line.value != 0 then v.last_line = opt_last_line.value