Various command line applications use an Interpreter Directive to define how they should be run.
#! js -m foo
#! node foo
#! eshost foo
I propose we add this as a top level syntax to ECMA262 as a comment that can occur before a DirectivePrologue.
None
None
Module := HashBang (opt) ...
Script := HashBang (opt) ...
HashBang := "#!" SingleLineCommentChars (opt)
DirectivePrologue text should be changed to explicitly allow HashBang to occur in front of it.
@bmeck I would call this
Shebang
instead ofInterpreterDirective
(to avoid the word "directive") and it should just be the first non-terminal inScript
andModule
. Something like