Closed GoogleCodeExporter closed 9 years ago
In script mode, variables can be declared inline and mingled with code and
declarations (the begin/end in your snippet is unnecessary), this dictates that
var/const have to be explicit.
However, var/const blocks are allowed when declaring a function or in "classic"
units (units that have interface/implementation sections).
Note that units in which you omit the "interface" keyword are considered to be
"consolidated" and follow script syntax, and can optionally have function body
inline in classes (as in Java or C#)
Original comment by zar...@gmail.com
on 27 May 2013 at 6:17
Thanks for the clarification Eric.
That sounds like it's an enhancement that can't be cleanly implemented in
DWScript because of that mixing (which isn't a bad feature, i actually like
that idea).
I went ahead and implemented my own customized ReadVarDeclBlock() to allow
var-blocks in script mode ... my implementation parses single var-statements if
used inline (if it's inside a BEGIN..END block) and allows a block of VAR
statements if defined outside. But obviously the drawback of my approach is
that i then require a ttBEGIN/ttCONST/ttPROCEDURE/etc token to know when to
exit parsing the var-block. My implementation is Pascal like grammar and it's a
drawback that i can live with, but maybe for others it would lead to
compatibility issues with existing scripts.
ps: i tried to reach you at your glscene.org email address about
exception-handling issue in dwscript, did you get that email?
Original comment by Fighting...@gmail.com
on 27 May 2013 at 7:35
I don't think I had that email, when was it sent?
Original comment by zar...@gmail.com
on 27 May 2013 at 7:59
Can you contact me privately on fightingninjasucks (gmail.com) ... i cant see
your full email address here. The exception issue isn't really an issue, just a
question on how to best implement a particular feature that i require. Maybe
something you can help me with in return for some sponsorship of DWScript?
Original comment by Fighting...@gmail.com
on 27 May 2013 at 8:17
Original issue reported on code.google.com by
Fighting...@gmail.com
on 27 May 2013 at 5:17