Lua Scheme Dot Behavior

Discussion Forums discussion Lua Scheme Dot Behavior

This topic contains 0 voices and has 2 replies.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
February 18, 2010 at 10:10 pm #1131

ustor
Member

When . is used between identifiers as a lookup, it instead becomes a part of the identifier. It is clearly an operator (alias for ) but is not treated as such. Is this intentional behavior or just an oversight?

February 19, 2010 at 12:17 pm #16993

simon
Key Master

It’s not intentional on my part, but I didn’t write the lexer for LUA! You could provide some sample code and screen shots showing the error, and if it’s simple I’ll fix it and otherwise I’ll report a bug in Scintilla.

February 19, 2010 at 6:02 pm #16994

ustor
Member

Demonstrates current dot behavior (screenshot):

function example()

local s = "string" .. "concat"; -- .. operator spaced between strings

local c = "string".."concat"; -- .. operator unspaced between strings

local p = "He walked." -- not an operator, assimilated into string

local d = 10.2; -- not an operator, assimilated into number

local pos = { x = 0, y = 0 };

pos . x = 1; -- . operator spaced between identifiers

pos.y = 1; -- . operator unspaced between identifiers (this case fails)

end

On the final line of the function (pos.y = 1) the . should retain the operator color (red), but instead assumes the identifier color (white).

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.