With/End With usage problem with Asciiz/String members
There is false positive error generated when string members are manipulated inside With/End With
While numeric members of UDT are handled correctly in With/End With, STRING/ASCIIZ based ones seem to have problem.
The issue seems to be related to recently introduced checking for double concatenation.
The reason seems to be fact, that ThinBASIC supports the following symbols for string concatenation:
. (like in PHP)
Dim s1, s2, s3 As String
s1 = "Hi" + ", how is it going?" ' -- Valid syntax
s2 = "Hi" & ", how is it going?" ' -- Valid syntax
s3 = "Hi" . ", how is it going?" ' -- Valid syntax
And here is code demonstrating the issue:
sName As String
sSurName As String
sCompleteName As String
Dim human As Record
' -- This is OK
human.sName = "John"
human.sSurName = "Carmack"
human.sCompleteName = human.sName + human.sSurName
' -- This does not work
.sName = "John"
.sSurName = "Carmack"
.sCompleteName = .sName + .sSurName
The problem is the parser found + and ., and it false positively expects these to be two concatenation operators. That would be true in other case, but not inside With/End With.
I think the usage of dot as concatenation operator might cause even more trouble, because it was introduced before UDTs were supported in ThinBASIC and it clashes with the dotted syntax a bit.