protected override void VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
 {
     using (StartNodeObject(exportNamedDeclaration))
     {
         Member("declaration", exportNamedDeclaration.Declaration.As <INode>());
         Member("specifiers", exportNamedDeclaration.Specifiers);
         Member("source", exportNamedDeclaration.Source);
     }
 }
Exemple #2
0
 private void ExtractExports(ModuleData module, ExportNamedDeclaration namedDeclaration)
 {
     // export var { a: alias, b } = { a: 0, b: 1 };
     if (namedDeclaration.Declaration != null)
     {
         ExtractExports(module, namedDeclaration.Declaration);
     }
     // export { a as alias };
     else
     {
         ExtractExports(module, namedDeclaration.Specifiers);
     }
 }
 protected override void VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
 {
     if (exportNamedDeclaration.Source != null)
     {
         _substitutions.Add(exportNamedDeclaration.Range, StringSegment.Empty);
     }
     else if (exportNamedDeclaration.Declaration != null)
     {
         _substitutions.Add(exportNamedDeclaration.Range, GetContentSegment(_module.Content, exportNamedDeclaration.Declaration.Range));
     }
     else
     {
         _substitutions.Add(exportNamedDeclaration.Range, StringSegment.Empty);
     }
 }
Exemple #4
0
        private TypeDeclaration VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
        {
            var decl = exportNamedDeclaration.Declaration != null
                ? VisitStatementListItem(exportNamedDeclaration.Declaration)
                : null;

            foreach (ExportSpecifier exportSpecifier in exportNamedDeclaration.Specifiers)
            {
                VisitExportSpecifier(exportSpecifier);
            }

            Token source = exportNamedDeclaration.Source != null
                ? VisitLiteral(exportNamedDeclaration.Source)
               : null;

            Logger.LogDebug($"{nameof(ExportNamedDeclaration)} processing is not implemented"); // TODO

            return(decl is TypeDeclaration typeDeclaration ? typeDeclaration : null);
        }
Exemple #5
0
 public virtual void VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
 {
 }
Exemple #6
0
 protected virtual void VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
 {
 }
Exemple #7
0
 protected internal override void VisitExportNamedDeclaration(ExportNamedDeclaration exportNamedDeclaration)
 {
     VisitingExportNamedDeclaration?.Invoke(this, exportNamedDeclaration);
     base.VisitExportNamedDeclaration(exportNamedDeclaration);
     VisitedExportNamedDeclaration?.Invoke(this, exportNamedDeclaration);
 }