mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Hack to make identifiers in globals in non-global-expression mode work.
This commit is contained in:
parent
b441c1774f
commit
56d51b835c
3 changed files with 39 additions and 7 deletions
|
@ -278,6 +278,19 @@ class Test03_Optimizer(UnitTestCase):
|
|||
''', ['extendedassignment'])
|
||||
self.opt.optimize(p, self.parser.functions)
|
||||
self.outscript.output(p)
|
||||
p = self.parser.parse('''
|
||||
key k = "blah";
|
||||
list L = [k, "xxxx", 1.0];
|
||||
float f;
|
||||
vector v = <f, 3, 4>;
|
||||
|
||||
default{timer(){}}
|
||||
''', ['extendedassignment'])
|
||||
self.opt.optimize(p, self.parser.functions)
|
||||
out = self.outscript.output(p)
|
||||
self.assertEqual(out, 'key k = "blah";\nlist L = [k, "xxxx", 1.];\n'
|
||||
'float f;\nvector v = <f, 3, 4>;\ndefault\n{\n timer()\n'
|
||||
' {\n }\n}\n')
|
||||
|
||||
def tearDown(self):
|
||||
del self.parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue