Change how LSLCalc is handled.

Instead of using an option in the command line, use a global in lslcommon, settable by the main program (only the main LSLCalc program, which differs from LSL-PyOptimizer's main, changes it).
This commit is contained in:
Sei Lisa 2016-12-20 21:25:33 +01:00
parent 1b6777e47b
commit 7c2c09188d
3 changed files with 9 additions and 7 deletions

View file

@ -20,7 +20,7 @@
# TODO: Add info to be able to propagate error position to the source.
from lslcommon import Key, Vector, Quaternion
from lslcommon import *
import lslcommon
import lslfuncs
import sys, re
@ -2621,8 +2621,8 @@ list lazy_list_set(list L, integer i, list v)
self.linestart = True
self.tok = self.GetToken()
self.globals = self.BuildTempGlobalsTable() if \
'lslcalc' not in options else self.funclibrary.copy()
self.globals = self.BuildTempGlobalsTable() if not IsCalc \
else self.funclibrary.copy()
# Restart
@ -2636,7 +2636,7 @@ list lazy_list_set(list L, integer i, list v)
self.usedspots = 0
# Start the parsing proper
if 'lslcalc' in options:
if IsCalc:
self.Parse_single_expression()
else:
self.Parse_script()