Currently the script editor uses
Code: Select all
function lineIsContinued pLine
return word -1 of pLine is "\"
end lineIsContinued
http://quality.livecode.com/show_bug.cgi?id=8228 (because the \ is followed by a comment)
http://quality.livecode.com/show_bug.cgi?id=8328 (because the last word of
Code: Select all
(" something ") \
Code: Select all
") \
Code: Select all
put "a" &\
"b" into tVar
Code: Select all
char -1 of word -1 of pLine
The char method has issues with this:
Code: Select all
put "a" into tVar --don't continue this line! \
put "b" into tVar2
This is the best I can come up with:
Code: Select all
function lineIsContinued pLine
local tTokens, tFirstChar
put token 1 to -1 of pLine into tTokens
put offset(tTokens, pLine) into tFirstChar
put "get a" into char tFirstChar to tFirstChar + length(tTokens) of pLine
put return & "& b" after pLine
compileCheck pLine
return the result
end lineIsContinued
on compileCheck pScript
local tCompileTest, tCompileResult
--checks to see if the message compiles
lock messages
create script only stack "compilationTest"
put "on compileTest" & cr & pScript & cr & "end compileTest" into tCompileTest
set the script of stack "compilationTest" to tCompileTest
put the result into tCompileResult
delete stack "compilationTest"
unlock messages
return tCompileResult is not empty
end compileCheck
Code: Select all
/* put "a" into */ put "a" into /* put "a" into */ /
tVar