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

Weird acceptation of here document #114

Open
Niols opened this issue Oct 31, 2019 · 0 comments
Open

Weird acceptation of here document #114

Niols opened this issue Oct 31, 2019 · 0 comments

Comments

@Niols
Copy link
Member

Niols commented Oct 31, 2019

Consider the following here document:

cat <<EOF
a `b' c
d `e' f `g' h
EOF

Dash refuses it. I think it is probably the right thing to do. Morbig's parsing is quite weird anyway here:

[
    "Word",
    "a `b' c\nd `e' f `g' h\n",
    [
	[ "WordLiteral", "a " ],
	[
	    "WordSubshell",
	    [ "SubShellKindBackQuote" ],
	    [
		[...]

                "SimpleCommand_CmdName_CmdSuffix",
                [
		    "CmdName_Word",
		    [
			"Word",
			"b' c\nd `e'",
			[
			    [ "WordLiteral", "b" ],
			    [
				"WordSingleQuoted",
				[
				    "Word",
				    " c\nd `e",
				    [
					[
					    "WordLiteral",
					    " c\nd `e"
					]
				    ]
				]
			    ]
			]
		    ]
		],
		[
		    "CmdSuffix_Word",
		    [
			"Word",
			"f",
			[ [ "WordName", "f" ] ]
		    ]
		]
	    ]
	],
	[ "WordLiteral", "g' h\n" ]
    ]
]

How can g' h be a literal?

@Niols Niols added this to the Software Heritage milestone Oct 31, 2019
Niols added a commit that referenced this issue Nov 25, 2019
yurug pushed a commit that referenced this issue Feb 12, 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

1 participant