✅ [v2] Unable to parse continuation section inside enclosure Topic is solved

Report problems with documented functionality
User avatar
lvalkov
Posts: 39
Joined: 08 Mar 2019, 16:39

✅ [v2] Unable to parse continuation section inside enclosure

05 Apr 2019, 15:41

This issue has been resolved as of:
v2.0-a105-acb6f3cb wrote:Fixed quoted continuation sections inside continuation expressions.

Given:

Code: Select all

boxes := () => (
	MsgBox('
	(
		Multi.
		Line.
		Text.
	)'), 
	MsgBox('Another function.')
)

%boxes%()
A continuation-section nested inside a continuation-by-enclosure cannot be parsed properly, resulting in the following error message:

Code: Select all

E:\enclosure.ahk (1) : ==> Missing "'"
     Specifically: boxes := () => ( MsgBox('Multi.
Line.
Text.'),
To resolve this issue, one can place the first expression on the same line, where the continuation-by-enclosure block began:

Code: Select all

boxes := () => (MsgBox('
	(
		Multi.
		Line.
		Text.
	)'), 
	MsgBox('Another function.')
)
I am of the opinion that this should be supported without having to resort to the workaround, since continuation-by-enclosure blocks, which do not contain nested continuation-sections, are presently being parsed correctly:

Code: Select all

boxes := () => (
	MsgBox('Multi.`nLine.`nText.'),
	MsgBox('Another function.')
)


I was torn between posting in the AHK v2 Dev subforum and here. Apologies if only AHK v1 bugs were meant to be reported here. I did so because it seemed only fitting.
Last edited by lvalkov on 27 Sep 2019, 17:30, edited 1 time in total.
lexikos
Posts: 6668
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: [v2] Unable to parse continuation section inside enclosure

21 Sep 2019, 02:39

Continuation sections within continuation expressions can be parsed correctly. For example:

Code: Select all

boxes := () => (
	MsgBox(
	(Join`s.`s
        A_ScriptDir
        Chr(92)
        A_ScriptName
	)), 
	MsgBox('Another function.')
)
%boxes%()
Unlike continuation sections, continuation expressions are not intended to permit strings to span multiple lines. The problem is that if the continuation section is parsed within the continuation expression, the "illegal" unclosed string is detected before the continuation section is considered. (If the continuation section starts on the second line, it is parsed first, since continuation sections apply to all lines of code, not just expressions.)

Commit 919a3c91 should fix it.
User avatar
lvalkov
Posts: 39
Joined: 08 Mar 2019, 16:39

Re: [v2] Unable to parse continuation section inside enclosure  Topic is solved

27 Sep 2019, 17:27

Confirmed resolved. Thank you for this update.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests