public ImportStatementCompletionProvider(
			ICompletionDataGenerator gen, 
			ImportStatement.ImportBindings imbBind)
            : base(gen)
        {
            this.impBind = imbBind;
        }
Exemplo n.º 2
0
        public virtual void VisitImport(ImportStatement.ImportBindings i)
        {
            if (i.Module != null)
            {
                i.Module.Accept(this);
            }

            if (i.SelectedSymbols != null)
            {
                foreach (var imp in i.SelectedSymbols)
                {
                    if (imp != null)
                    {
                        imp.Accept(this);
                    }
                }
            }
        }
Exemplo n.º 3
0
        ImportStatement.ImportBindings ImportBindings(ImportStatement.Import imp)
        {
            var importBindings = new ImportStatement.ImportBindings { Module=imp };

            bool init = true;
            while (laKind == Comma || init)
            {
                if (init)
                    init = false;
                else
                    Step();

                var symbolAlias = Expect(Identifier) ?
                    new IdentifierDeclaration(t.Value){ Location = t.Location, EndLocation = t.EndLocation } :
                    (IsEOF ? new IdentifierDeclaration(DTokens.IncompleteIdHash) : null);

                if (laKind == Assign)
                {
                    Step();
                    if (Expect (Identifier))
                        importBindings.SelectedSymbols.Add (new ImportStatement.ImportBinding (new IdentifierDeclaration (t.Value) {
                            Location = t.Location,
                            EndLocation = t.EndLocation
                        }, symbolAlias));
                    else if(IsEOF)
                        importBindings.SelectedSymbols.Add (new ImportStatement.ImportBinding (new IdentifierDeclaration (DTokens.IncompleteIdHash), symbolAlias));
                }
                else if(symbolAlias != null)
                    importBindings.SelectedSymbols.Add(new ImportStatement.ImportBinding(symbolAlias));
            }

            return importBindings;
        }
Exemplo n.º 4
0
        ImportStatement.ImportBindings ImportBindings(ImportStatement.Import imp)
        {
            var importBindings = new ImportStatement.ImportBindings { Module=imp };
            LastParsedObject = importBindings;

            bool init = true;
            while (laKind == Comma || init)
            {
                if (init)
                    init = false;
                else
                    Step();

                if (Expect(Identifier))
                {
                    var symbolAlias = new IdentifierDeclaration(t.Value){ Location = t.Location, EndLocation = t.EndLocation };

                    if (laKind == Assign)
                    {
                        Step();
                        if (Expect (Identifier))
                            importBindings.SelectedSymbols.Add (new ImportStatement.ImportBinding (new IdentifierDeclaration (t.Value) {
                                Location = t.Location,
                                EndLocation = t.EndLocation
                            }, symbolAlias));
                    }
                    else
                        importBindings.SelectedSymbols.Add(new ImportStatement.ImportBinding(symbolAlias));
                }
            }

            if (!IsEOF)
                LastParsedObject = null;

            return importBindings;
        }
Exemplo n.º 5
0
        ImportStatement.ImportBindings ImportBindings(ImportStatement.Import imp)
        {
            var importBindings = new ImportStatement.ImportBindings { Module=imp };
            LastParsedObject = importBindings;

            bool init = true;
            while (laKind == Comma || init)
            {
                if (init)
                    init = false;
                else
                    Step();

                if (Expect(Identifier))
                {
                    if (laKind == Assign)
                    {
                        var symbolAlias = t.Value;
                        Step();
                        if (Expect(Identifier))
                            importBindings.SelectedSymbols.Add(new KeyValuePair<string, string>(symbolAlias, t.Value));
                    }
                    else
                        importBindings.SelectedSymbols.Add(new KeyValuePair<string, string>(t.Value, null));
                }
            }

            if (!IsEOF)
                LastParsedObject = null;

            return importBindings;
        }