mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-02 08:08:20 +00:00
Added command line option to display the preprocessor output.
Will help identify the source line until preprocessor line tracking is implemented.
This commit is contained in:
parent
7d0ee20058
commit
aad73fb71d
1 changed files with 23 additions and 16 deletions
9
main.py
9
main.py
|
@ -169,6 +169,7 @@ Usage: {progname}
|
||||||
[-P|--prearg=<arg>] add parameter to preprocessor's command line
|
[-P|--prearg=<arg>] add parameter to preprocessor's command line
|
||||||
[--precmd=<cmd>] preprocessor command ('cpp' by default)
|
[--precmd=<cmd>] preprocessor command ('cpp' by default)
|
||||||
[--prenodef] no LSL specific defines (__AGENTKEY__ etc.)
|
[--prenodef] no LSL specific defines (__AGENTKEY__ etc.)
|
||||||
|
[--preshow] show preprocessor output, and stop
|
||||||
[--avid=<UUID>] specify UUID of avatar saving the script
|
[--avid=<UUID>] specify UUID of avatar saving the script
|
||||||
[--avname=<name>] specify name of avatar saving the script
|
[--avname=<name>] specify name of avatar saving the script
|
||||||
[--assetid=<UUID>] specify the asset UUID of the script
|
[--assetid=<UUID>] specify the asset UUID of the script
|
||||||
|
@ -296,7 +297,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hO:o:p:P:H',
|
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hO:o:p:P:H',
|
||||||
('optimizer-options=', 'help', 'version', 'output=', 'header',
|
('optimizer-options=', 'help', 'version', 'output=', 'header',
|
||||||
'preproc=', 'precmd=', 'prearg=', 'prenodef',
|
'preproc=', 'precmd=', 'prearg=', 'prenodef', 'preshow',
|
||||||
'avid=', 'avname=', 'assetid=', 'scriptname='))
|
'avid=', 'avname=', 'assetid=', 'scriptname='))
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
Usage()
|
Usage()
|
||||||
|
@ -312,6 +313,7 @@ def main():
|
||||||
predefines = True
|
predefines = True
|
||||||
script_header = ''
|
script_header = ''
|
||||||
mcpp_mode = False
|
mcpp_mode = False
|
||||||
|
preshow = False
|
||||||
|
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if type(opt) is unicode:
|
if type(opt) is unicode:
|
||||||
|
@ -386,6 +388,9 @@ def main():
|
||||||
elif opt == '--prenodef':
|
elif opt == '--prenodef':
|
||||||
predefines = False
|
predefines = False
|
||||||
|
|
||||||
|
elif opt == '--preshow':
|
||||||
|
preshow = True
|
||||||
|
|
||||||
elif opt in ('-H', '--header'):
|
elif opt in ('-H', '--header'):
|
||||||
script_header = True
|
script_header = True
|
||||||
|
|
||||||
|
@ -486,6 +491,8 @@ def main():
|
||||||
elif x == 'USE_LAZY_LISTS':
|
elif x == 'USE_LAZY_LISTS':
|
||||||
options.add('lazylists')
|
options.add('lazylists')
|
||||||
|
|
||||||
|
if not preshow:
|
||||||
|
|
||||||
p = parser()
|
p = parser()
|
||||||
try:
|
try:
|
||||||
ts = p.parse(script, options)
|
ts = p.parse(script, options)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue