Page 1 of 1

"End of Line Expected" When Additional Parameters After String

Posted: Tue May 22, 2018 1:51 pm
by Poorman65
I am trying to create a Custom-Defined Statement that will contain more than one String. It appears that the parser is not able to handle any parameters after the first String in the Statement.

Here is an example:

Code: Select all

showTimedImage 2 me x y z "a string"  q r s "another string"
In this example I get an "end of line expected" on the parameter 'q'.

and here is the actual example of my custom statement:

Code: Select all

showTimedImage 2 "Riley S01_Vixens_Riley_Initial" waitress "Hey!"
In this example I get an "end of line expected" on the parameter 'waitress '.

Is it possible to have multiple Strings in a Statement or will I have to break this into two Statements?

Re: "End of Line Expected" When Additional Parameters After String

Posted: Tue May 22, 2018 1:57 pm
by Ocelot
How your Custom-Defined Statement defined?

Re: "End of Line Expected" When Additional Parameters After String

Posted: Tue May 22, 2018 4:06 pm
by Remix
lexer.string will match ", ', or even ` through until the last occurrence of same on the line

Use something like:

Code: Select all

### pseudo code

    curpos = lexer.pos
    
    if lexer.python_string():

        value = lexer.text[ curpos:lexer.pos ] 

Re: "End of Line Expected" When Additional Parameters After String

Posted: Tue May 22, 2018 4:51 pm
by Poorman65
Got myself in the middle of trying something else. I'll post once I can get back to trying this again later.