Modding TDD: comments syntax
Wyzcrak
Pot Pie Aficionado Join Date: 2002-12-04 Member: 10447Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue
in Modding
<div class="IPBDescription">'//' -vs- '--'</div>Scenario: I'm trying to create a server mod, and I'm trying to do it with test-driven development. I'm falling down when my lunity unit tests eventually execute actual NS2 Lua files.
Question: How can I make lunity treat lines beginning with '//' (in NS2's Lua files) as comments?
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Details:<!--sizec--></span><!--/sizec-->
When my unit test eventually loads an NS2 Lua file, it complains about the '//' comment syntax at the top of the file.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->lua.Globals
...les (x86)\Steam\steamapps\common\natural selection 2\ns2\lua\Globals.lua:1: unexpected symbol near '/'<!--c2--></div><!--ec2-->
The first line of Globals.lua (Build 217):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// ======= Copyright (c) 2003-2012, Unknown Worlds Entertainment, Inc. All rights reserved. =======<!--c2--></div><!--ec2-->
I'm running Lua for Windows 5.1 and lunity 0.9. The only documentation I can find says the '--' is how comments get made.
How is NS2 treating these '//' lines as comments?
Question: How can I make lunity treat lines beginning with '//' (in NS2's Lua files) as comments?
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Details:<!--sizec--></span><!--/sizec-->
When my unit test eventually loads an NS2 Lua file, it complains about the '//' comment syntax at the top of the file.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->lua.Globals
...les (x86)\Steam\steamapps\common\natural selection 2\ns2\lua\Globals.lua:1: unexpected symbol near '/'<!--c2--></div><!--ec2-->
The first line of Globals.lua (Build 217):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// ======= Copyright (c) 2003-2012, Unknown Worlds Entertainment, Inc. All rights reserved. =======<!--c2--></div><!--ec2-->
I'm running Lua for Windows 5.1 and lunity 0.9. The only documentation I can find says the '--' is how comments get made.
How is NS2 treating these '//' lines as comments?
Comments
They mentioned that on the PAX prime 2012 video: <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=120599" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=120599</a>