A.9 Scripts and Modules
SourceFile: ImplementationSourceFile DeclarationSourceFile
ImplementationSourceFile: ImplementationScript ImplementationModule
DeclarationSourceFile: DeclarationScript DeclarationModule
ImplementationScript: ImplementationScriptElementsopt
ImplementationScriptElements: ImplementationScriptElement ImplementationScriptElements ImplementationScriptElement
ImplementationScriptElement: ImplementationElement AmbientModuleDeclaration
ImplementationElement: Statement LexicalDeclaration FunctionDeclaration GeneratorDeclaration ClassDeclaration InterfaceDeclaration TypeAliasDeclaration EnumDeclaration NamespaceDeclaration AmbientDeclaration ImportAliasDeclaration
DeclarationScript: DeclarationScriptElementsopt
DeclarationScriptElements: DeclarationScriptElement DeclarationScriptElements DeclarationScriptElement
DeclarationScriptElement: DeclarationElement AmbientModuleDeclaration
DeclarationElement: InterfaceDeclaration TypeAliasDeclaration NamespaceDeclaration AmbientDeclaration ImportAliasDeclaration
ImplementationModule: ImplementationModuleElementsopt
ImplementationModuleElements: ImplementationModuleElement ImplementationModuleElements ImplementationModuleElement
ImplementationModuleElement: ImplementationElement ImportDeclaration ImportAliasDeclaration ImportRequireDeclaration ExportImplementationElement ExportDefaultImplementationElement ExportListDeclaration ExportAssignment
DeclarationModule: DeclarationModuleElementsopt
DeclarationModuleElements: DeclarationModuleElement DeclarationModuleElements DeclarationModuleElement
DeclarationModuleElement: DeclarationElement ImportDeclaration ImportAliasDeclaration ExportDeclarationElement ExportDefaultDeclarationElement ExportListDeclaration ExportAssignment
ImportRequireDeclaration: import
BindingIdentifier =
require
(
StringLiteral )
;
ExportImplementationElement: export
VariableStatement export
LexicalDeclaration export
FunctionDeclaration export
GeneratorDeclaration export
ClassDeclaration export
InterfaceDeclaration export
TypeAliasDeclaration export
EnumDeclaration export
NamespaceDeclaration export
AmbientDeclaration export
ImportAliasDeclaration
ExportDeclarationElement: export
InterfaceDeclaration export
TypeAliasDeclaration export
AmbientDeclaration export
ImportAliasDeclaration
ExportDefaultImplementationElement: export
default
FunctionDeclaration export
default
GeneratorDeclaration export
default
ClassDeclaration export
default
AssignmentExpression ;
ExportDefaultDeclarationElement: export
default
AmbientFunctionDeclaration export
default
AmbientClassDeclaration export
default
IdentifierReference ;
ExportListDeclaration: export
*
FromClause ;
export
ExportClause FromClause ;
export
ExportClause ;
ExportAssignment: export
=
IdentifierReference ;