diff options
author | David Walter Seikel | 2012-02-04 21:52:48 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-04 21:52:48 +1000 |
commit | 0626bc79168a4735df9083be616efb05bb106de6 (patch) | |
tree | 644e439264b635f23c02f02d2df49d50d88b3987 /LuaSL/src | |
parent | Fix up constant variables and local crements. (diff) | |
download | SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.zip SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.gz SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.bz2 SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.xz |
Cooment a problem with typecasting strings to integers.
Diffstat (limited to 'LuaSL/src')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index d73b145..a9375d9 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -1,5 +1,23 @@ | |||
1 | #include "LuaSL.h" | 1 | #include "LuaSL.h" |
2 | 2 | ||
3 | /* TODO - | ||
4 | Bit of a problem, but I think it will go away once llGetSubString() is implemented. | ||
5 | The problem is that Lua can't convert the string "0x" to a number, though it's fine with "0x0". | ||
6 | In LSL any string that does not represent a number gets converted to 0 by a typecast. | ||
7 | |||
8 | In other cases the LSL code is typecasting a string to an integer, but Lua can't coz it's not a real number in the string. | ||
9 | |||
10 | Sooo, should actually implement that typecast. | ||
11 | |||
12 | function --[[integer]] channel() | ||
13 | return --[[(integer)]] ("0x" .. _LSL.llGetSubString( --[[(string)]] _LSL.llGetKey(), -4, -1)); | ||
14 | end | ||
15 | |||
16 | function setBalls( --[[string]] cmd) | ||
17 | local --[[integer]] ch=channel(); | ||
18 | _LSL.llSay(ch+ix, cmd); | ||
19 | end | ||
20 | */ | ||
3 | 21 | ||
4 | 22 | ||
5 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); | 23 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); |