Page 1 of 1

Trivial parsing issue with Gui , Add

Posted: 13 Aug 2019, 04:36
by pneumatic

Code: Select all

#SingleInstance , Force
				  
;Works				  
Gui , Add , Text , % "x" . (2+2) 
				  . " y4 w35 h15" , Text

;Doesn't work				  
Gui , Add , Text , % "x" . (2+2) 
				  . " y24 w35 h15" , Text:
				  
;Works
Gui , Add , Text , % "x" . (2+2) 
				  . " y44 w35 h15" , % "Text:"
				  
		  
Gui , Show , w250 h65 Center , Gui
return

GuiClose:
ExitApp
return

Image

Re: Trivial parsing issue with Gui , Add

Posted: 17 Aug 2019, 03:35
by lexikos
The issue is with parsing of continuation lines that end with a colon and do not begin with a comma.

Code: Select all

MsgBox 0, % ""
  . "Title", Ends with a colon:
This seems to be intended, although based on a false premise:
// With the exception of lines starting with a comma, the last character of any
// legitimate continuation line can't be a colon because expressions can't end
// in a colon. The only exception is the ternary operator's colon, but that is
// very rare because it requires the line after it also be a continuation line
// or section, which is unusual to say the least -- so much so that it might be
// too obscure to even document as a known limitation. Anyway, by excluding lines
// that end with a colon from consideration ambiguity with normal labels
// and non-single-line hotkeys and hotstrings is eliminated.
Another workaround is to move , Text: to the next line.