![]() |
|
return
in switch
statement (got broke a couple of releases ago..)
return
within the JIT did not properly abort compilation
die
statement
-nps
, --nopackedscripts cmdline option which is used to keep sources as-is in tkx
and tsl
files (default is to strip comments and tokenize them to speed up loading). This option is useful if the application wants to load its own source code at runtime.
.tsl
/.tkx
files
local MyClass mc<=null;
style initializations (no need to construct left hand side object)
-esp
resp. --enablestatementprofiling is used to enable the profiler
stderr
at exit
call count
millisec_sum
avg_millisec
use tkopengl;
class C {
Vector va[]; // yields a VectorArray
Double da[]; // yields an ObjectArray
}
C c; trace #(c.va);
class C {
Double da0[]=[1,2,3], da1[]=[4,5,6];
test() {
print #(da0); print #(da1);
print da0.string; print da1.string;
}
}
C c; c.test();
Double da0[]=[7,8,9], da1[]=[10,11,12];
print #(da0); print #(da1);
print da0.string; print da1.string;
deleteme
flag, otherwise a non-deletable reference will be added. Also see the pointerarray_list.tks example.
return SomeOtherCall()
(introduced in last release)
yacEvalFunction()
, yacEvalFunctionReturn()
now check whether the context is still running
ModuleMemberNotFound
) (like e.g. in Main.GameMap.misspelledfieldname
)
break
now also works within for
loops.
do..while
, while
, loop
and foreach
are thread safe and re-entrant now.
IMemberExpr
is thread safe and re-entrant now.
<temporary>
tks -ee my.tsl
is supported now
MyClass.o <= <expr>;
floor
() and ceil
() functions (see builtin functions)
for(;;)
is now a valid statement (the shortest way to write an infinite loop; greetings to Argon.. )
SomeFunction
or SomeModule.SomeFunction
or SomeClass.SomeStaticMethod
. Also see thread_simple.tks example.
function F() { return=42; }
return value assignment (very useful in conjunction with uncritical exceptions)
class Vec3 { float x,y,z; }
Vec3 v=[1,2.3,4];
(int)<factor>
(float)<factor
(Object)<factor>
(String)<factor>
int(<expr>)
float(<expr>)
Object(<expr>)
String(<expr>)
new
is prepended to the initializer expression, the i.expr will return new array objects each time it is called. Otherwise a reference to a static array is returned (faster but not re-entrant). Example:
IntArray ia <= new [1,2,3];
.tkx
, .tsl
) :
[project]
and [chapter]
sections are optional now
`some/file`
)
lib:
is now replaced with the current $TKS_LIBRARY_PATH
environment variable resp. registry setting.
.tsl
lib:
) in a .tkx
file. nevertheless, during startup each somefile.tsl
occurence will be replaced by the contents of the .tsl
file; this means that all files (both app and lib files) share the same namespace.
TKS_LIBRARY_PATH
environment variable and finally in the registry key HKLM\\Software\\TKS\\TKS_LIBRARY_PATH
(the registry setting only regards win32 ofcoz).
-lp
, --librarypath
cmdline option is used to override the TKS_LIBRARY_PATH
setting(s)
Main
module
-cl
, --compilelibrary
cmdline option (e.g. $ tks -cl ui
will create ui.tsl
from ui.tkp
)
tks-examples/tsl
example.
function MyThreadEntry(Thread _th) { /* ... */ }
Thread th;
if(th.create(MyThreadEntry))
{
print "thread created.";
}
else
{
print "failed to create thread.";
}
th.wait(); // Wait until thread function has returned
=
qualifier. Example:
class C { public static = testGlobal() { /*...*/ } }
==
qualifier. Example:
class C { == public testPerInstance() { /*...*/ } }
this
statements/expressions are now thread-safe. See the class_this.tks example.
TKS_MT
define)
try
, catch
, finally
and exception
keywords
ArrayOutOfBounds
error):
Error
CriticalError
Death
InvalidPointer
TypeMismatch
ClassTypeMismatch
NativeClassTypeMismatch
ScriptClassTypeMismatch
NotFound
ClassMethodNotFound
NativeClassMethodNotFound
ScriptClassMethodNotFound
ClassMemberNotFound
NativeClassMemberNotFound
ScriptClassMemberNotFound
ModuleNotFound
ModuleMemberNotFound
ArrayOutOfBounds
ReadArrayOutOfBounds
WriteArrayOutOfBounds
ConstraintViolation
NotNullConstraintViolation
UncriticalError
define exception Anything;// User defined base exception
define exception Something extends Anything;// Some exception
UncriticalError
will back-propagate exactly one stack frame. if there is no upper stackframe (global statements) or the upper stackframe (caller) does not catch the exception it will silently vanish.
return=<expr>;
syntax.
define exception MyGlobalException;
class MyBaseClass { define exception MyBaseException; }
class MyClass extends MyBaseClass {
define exception MyException;
define exception MyDerivedException extends MyBaseException;
define exception MyDerivedException2 : MyBaseClass::MyBaseException;
define exception MyDerivedException3 : ::MyGlobalException;
}
Also see the class_exceptions.tks example
yacCallbackCreate
(), yacCallbackGetIdByName
(), yacCallbackSetFunById
(), yacCallbackSetFunByName
(), yacCallbackGetFunById
())
yacMutex*
())
yacExceptionRegister
(), yacExceptionGetIdByName
(), yacExceptionRaise
())
zglClipPlane(int glplaneid, float eq0, eq1, eq2, eq3)
function (works like glClipPlane() except that the plane equation argument array has been turned into 4 individual eq[0..3] arguments). Also see clipplane.tks example.
YAC_CALL
. Now the JIT compiler also works when compiling with the Openwatcom compiler, which uses its own __watcall calling convention per default. It seems that this also had an effect on the VC8 build environment.
YAC_CALL
yac* method and global function decorator which is used to enforce __cdecl for 32bit environments. YAC_CALL
is defined as "" if a 64bit environment has been detected or if __GNUC__ is defined.
YAC_CALL
.
YAC_CALL
decorations now.
-fi
cmdline option is now also recognized (and ignored) even if the JIT compiler is not available
[---] formal argument mismatch in declaration of method NthToggle::init: [---] init(int start_state, int max_counter) (in class NthToggle) [---] init(int start_state) (in class Toggle) [---] compilation failed.
Value v;
v.setStringValue(Double.News("2.232323232359123")); // Converts Object to temporary String
v.stringValue.append(" ");
v.stringValue.append(42); // Converts int to Object then to temporary String
v.stringValue.append(" ");
v.stringValue.append(Long.Newi(42)); // Converts Object to temporary String
trace v.stringValue;
Main
default module name!)
-ee
cmdline option now also writes out class constants
-pls,--poolstrings <num>
is used to change the maximum number of strings in the String pool (default is 2048)
YAC_64
, sF32_MIN
, sF32_MAX
defines
Class
class CBase1_1 {
public test() {
trace "CBase1_1::test";
}
}
class CBase1 extends CBase1_1 {
}
class CBase2 {
public test() {
trace "CBase2::test";
}
}
// first search CTest, then CBase1, then CBase2
class CTest extends CBase1, CBase2 {
public run() {
test();
}
}
CTest t;
t.run();
- (prints "CBase1_1::test")
break;
in nested switch statement sequence now only breaks out of switch instead of outer loop
MyDerivedClass::myMethod(){}
type method body implementation may have caused an error if the base class also contained a method called myMethod (actually it depended on the method names and the resulting hashkey so it went unnoticed for a long time :)
this.<member> = <expr>
type assigments work now
YAC_TYPE_STRING
which caused them to be copied if passed in a function/method call
onSegV
signal callback and onSegVContinue
handler (win32 only ATM). Default segv handler now prints adr and access type that caused the crash.
--chapter
,-ch
cmd line option (selects start-chapter in tkx/tkp file)
--sharedmemorykey
,-smk
cmd line option
explain
keyword for code documentation
--emitexplanations
,-ee
cmd line option (causes the script engine to stop after parsing the project sources and emit code documentation to stdout, also see here)
YAC_Host::yacEvalFunctionReturn()
SDL_INIT_NOPARACHUTE
flag
tks -ee <script>
and creates a set of HTML pages.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |