You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiler incorrectly treats string literals with some characters #66
In the past I remembered that the IDE compiled the strings, but eliminating the spaces, and now it does not compile them directly. So you asked me. Wasn't it better to replace the spaces with another character? It was there when I started to investigate the archive .SCM, and I noticed that the spaces were replaced by the underscores when decompiling. So, could the same function be done for compilation of the scripts, and thus avoid this problem?
GXT.addDynamic("EXA", "Hello Word")
--------- ⬇ when compiling ---------
0ADF: "EXA" "Hello_Word"
--------- ⬇ when decompiling-------
GXT.addDynamic("EXA", "Hello_Word")
and another thing ... since the F11 does not have any function in the editor, other than deleting the field of the Opcodes Finder. Could you assign it to open the offline help file (.chm)? yes? please...
Compiler can't replace spaces with underscores as this changes the content and may break the logic this string is for. "Hello world" and "Hello_world" are two different string literals.
Can you provide a real code that does not compile? Spaces in string literals should not cause compilation issues.
and another thing ... since the F11 does not have any function in the editor, other than deleting the field of the Opcodes Finder. Could you assign it to open the offline help file (.chm)? yes? please...
@x87 Yes I know... after sending the proposal I had remembered that program. I configured it, I tested it, it worked, and finally, I forgot to edit the footer of the message... sorry... but there was also something else he wanted to say to you and he didn't remember it.
But... now I do remember.
You know that the new gosub function that you implemented is tasty, delicious, exquisite, capable of delighting you and making you feel an orgasm and everything, but... do you think you can do something similar with it opcode 0AB1?
AnimObj() // if this is a gosub.
AnimObjTo($obj, x, y, z) // this can be the same as
//0AB1: call_scm_func @AnimObjTo 4 $obj x y z
But the comma(,), is already registered to be visible within the game.
How about this idea ..
if 1 space is detected, compile it with the space, but if it is more than 2 spaces, compile with the underscores, and when decompiling, we replace these characters with spaces, BUT ONLY IF they have a space before, otherwise the underscores will be kept..
GXT.Create("ac20","ddd,dd dd__ddd") // e.g. 1
Player.SetClothes(0@,"a c","ddd,dd ddd",0) // e.g. 2
--------- ⬇ when compiling ---------
GXT.Create("ac20","ddd,dd _dd__ddd") // e.g. 1
Player.SetClothes(0@,"a c","ddd,dd __ddd",0) // e.g. 2
--------- ⬇ when decompiling-------
GXT.Create("ac20","ddd,dd dd__ddd") // e.g. 1
Player.SetClothes(0@,"a c","ddd,dd ddd",0) // e.g. 2
@x87 forgive me.
It is that in 3.8.0.0 I had as if I saw that the compiler respected the spaces, but I saw it wrong.
In fact it was about to reopen the theme. I also found some problems IN THE CLASSES
The IDE interprets commas (,) as a Space and when there are 2 or more Spaces, these are compiled as 1 only.
Exam.ple("a, b c d")// compiled to "a b c d"XXXX: "a, b c d")// compiled to "a, b c d"
The equality/assignment symbol (=) can't be included at Strings.
When the IDE comes across an OPCODE that contains a function like REST / CALLBACK (XXXX=-1,[...]), the opcode class goes crazy. The IDE copies and pastes the last value entered in the opcode, until the 35 spaces it allows are completed.
That is to say that from this:
There are times when it does not copy the last value, but 2 values at the same time.
You could include a parameter like % r to represent a REST / CALLBACK and prevent that error
; example
CallFunction, 0AA5,0,0, ("address% i""numParams% i""pop% r")
@MatiDragon-YT it happens as internally sanny unwraps -1 to the maximum allowed number of parameters in this game. you can also notice the same number is displayed as expected number of parameters for this opcode in the bottom panel.
to handle this behavior arguments type has been added in Sanny Builder Library. Classes are meant to understand that arguments is a variable set and act accordingly. So far it does not happen.
Activity
x87 commentedon Aug 29, 2020
Compiler can't replace spaces with underscores as this changes the content and may break the logic this string is for. "Hello world" and "Hello_world" are two different string literals.
Can you provide a real code that does not compile? Spaces in string literals should not cause compilation issues.
x87 commentedon Aug 29, 2020
I see that using "extended" params in classes may cause compilation issue:
e.g. this code works
but this does not
Is this the same issue that you experience?
MatiDragon-YT commentedon Aug 31, 2020
YES!!! I thought it was for something else...
x87 commentedon Sep 2, 2020
you can use User tools to achieve this:
MatiDragon-YT commentedon Sep 3, 2020
@x87 Yes I know... after sending the proposal I had remembered that program. I configured it, I tested it, it worked, and finally, I forgot to edit the footer of the message... sorry... but there was also something else he wanted to say to you and he didn't remember it.
But... now I do remember.
You know that the new gosub function that you implemented is tasty, delicious, exquisite, capable of delighting you and making you feel an orgasm and everything, but... do you think you can do something similar with it opcode 0AB1?
😀
x87 commentedon Sep 3, 2020
Absolutely, read my proposal here
x87 commentedon Oct 23, 2020
Related issue: compiler replaces comma in string literals with whitespace:
after decompilation becomes
MatiDragon-YT commentedon Oct 24, 2020
But the comma(
,), is already registered to be visible within the game.
How about this idea .. if 1 space is detected, compile it with the space, but if it is more than 2 spaces, compile with the underscores, and when decompiling, we replace these characters with spaces, BUT ONLY IF they have a space before, otherwise the underscores will be kept..--------- ⬇ when compiling ---------
--------- ⬇ when decompiling-------
4 remaining items
MatiDragon-YT commentedon Jun 9, 2021
@x87 forgive me.
It is that in 3.8.0.0 I had as if I saw that the compiler respected the spaces, but I saw it wrong.
In fact it was about to reopen the theme. I also found some problems IN THE CLASSES
The IDE interprets commas (
,) as a Space and when there are 2 or more Spaces, these are compiled as 1 only.The equality/assignment symbol (
=) can't be included at Strings.When the IDE comes across an OPCODE that contains a function like REST / CALLBACK (
XXXX=-1,[...]), the opcode class goes crazy. The IDE copies and pastes the last value entered in the opcode, until the 35 spaces it allows are completed.That is to say that from this:
becomes this:
There are times when it does not copy the last value, but 2 values at the same time.
You could include a parameter like
% rto represent a REST / CALLBACK and prevent that error[-]Replace spaces in's strings (only within classes)[/-][+]Problems in the members of the classes.[/+]x87 commentedon Jun 9, 2021
@MatiDragon-YT it happens as internally sanny unwraps
-1to the maximum allowed number of parameters in this game. you can also notice the same number is displayed as expected number of parameters for this opcode in the bottom panel.to handle this behavior
argumentstype has been added in Sanny Builder Library. Classes are meant to understand that arguments is a variable set and act accordingly. So far it does not happen.x87 commentedon Jun 10, 2021
@MatiDragon-YT I think the second issue you described warrants its own ticket. Let's keep this one for string parsing.
[-]Problems in the members of the classes.[/-][+]Compiler incorrectly treats string literals with some characters[/+]MatiDragon-YT commentedon Jul 2, 2021
Depending on how an OP is configured in the
classes.dbfile, theSTRINGtype values will be compiled in one way or another:I share my classes.db and others so you can check it out.
(sa.zip just for SB 3.8.0 alpha 4)
x87 commentedon Aug 28, 2023
0@ = Player.Money("this is some string")should not delete spaces
x87 commentedon Aug 7, 2024
fixed in 4.0.0