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

Two reserved keywords in a row should be considered both "well separated"? #105

Open
Niols opened this issue Apr 1, 2019 · 3 comments
Open
Assignees

Comments

@Niols
Copy link
Member

Niols commented Apr 1, 2019

Let us have a look at:

{ for foo in a b c; do
      bar
  done }

refused by Morbig because of the } after done but accepted by Dash and Bash. I wonder if being "well separated" works when the previous word is already a reserved word. After all, we never separate after a reserved word, it's only important before.

@Niols Niols added this to the Software Heritage milestone Apr 1, 2019
@Niols
Copy link
Member Author

Niols commented Oct 30, 2019

@yurug Do you think this is a bug in Morbig? Or a different interpretation of the standard?

@Niols
Copy link
Member Author

Niols commented Oct 30, 2019

Actually, in 2.4 Reserved Words, it is said:

Reserved words are words that have special meaning to the shell; see Shell Commands. The following words shall be recognized as reserved words:

!             do            esac          in
{             done          fi            then
}             elif          for           until
case          else          if            while

This recognition shall only occur when none of the characters is quoted and when the word is used as:

  • The first word of a command
  • The first word following one of the reserved words other than case, for, or in
  • […]

@Niols
Copy link
Member Author

Niols commented Oct 30, 2019

So this should, in my opinion, be a bug in Morbig and has actually nothing to do with "well separated" keywords (for which I can't find a reference anymore).

Niols added a commit that referenced this issue Nov 25, 2019
yurug pushed a commit that referenced this issue Feb 12, 2023
github-actions bot pushed a commit that referenced this issue Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants