Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser checks quotes in command substitution comments #7866

Closed
OwenAR opened this issue Mar 26, 2021 · 2 comments · Fixed by #8695
Closed

Parser checks quotes in command substitution comments #7866

OwenAR opened this issue Mar 26, 2021 · 2 comments · Fixed by #8695
Labels
bug Something that's not working as intended
Milestone

Comments

@OwenAR
Copy link
Contributor

OwenAR commented Mar 26, 2021

Is this a bug in the parser, such that it sees unbalanced quotes within a comment (within this context (command substitution?) as an error, or..?

This works:

	echo (
	test ""
	and echo a # comment 1 ''
	or  echo b # comment 2 ''
	)

But this gets an error:

	echo (
	test ""
	and echo a # comment 1 '''
	or  echo b # comment 2 ''
	)
	fish: Unexpected end of string, quotes are not balanced
	and echo a # '
	             ^

(fish, version 2.7.1 (ppa 3.2.1-1~focal))

(
Also work:

	echo (
	test ""
	and echo a # comment 1 '''
	or  echo b # comment 2 '''
	)
	echo (
	test ""
	and echo a # comment 1 '
	or  echo b # comment 2 '
	)

and of course:

	echo (
	test ""
	and echo a # comment 1
	or  echo b # comment 2
	)

...

a few other notes:

✔️ works:

	echo (
	test ""
	and echo a # comment 1 '
	or  echo b # comment 2
	#'
	)

❌ fails:

	echo (
	test ""
	and echo a # comment 1 '
	or  echo b # comment 2
	) #'

❌ fails:

	echo (
	test ""
	and echo a # comment 1 '
	or  echo b # comment 2
	)
	#'

✔️ works:

	echo ( #'
	test ""
	and echo a # comment 1 '
	or  echo b # comment 2
	)

)

@OwenAR OwenAR changed the title Is this a bug in the parser, such that it sees unbalances quotes within a comment in this context (command substitution?) as an error, or...? Is this a bug in the parser, such that it sees unbalanced quotes within a comment in this context (command substitution?) as an error, or...? Mar 26, 2021
@faho faho changed the title Is this a bug in the parser, such that it sees unbalanced quotes within a comment in this context (command substitution?) as an error, or...? Parser checks quotes in command substitution comments Mar 26, 2021
@faho faho added the bug Something that's not working as intended label Mar 26, 2021
@faho
Copy link
Member

faho commented Mar 26, 2021

Yup, that's a bug.

I took the liberty of retitling this because we do prefer the title to fit into a text message (it was 141 characters).

@faho faho added this to the fish-future milestone Mar 26, 2021
@OwenAR
Copy link
Contributor Author

OwenAR commented Mar 27, 2021

(Yeah of course retitle, thanks! I just went with erring on the side of overly descriptive to start cuz I didn't know the right terms for things.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants