public ImportStatementCompletionProvider(
			ICompletionDataGenerator gen, 
			ImportStatement.ImportBindings imbBind)
            : base(gen)
        {
            this.impBind = imbBind;
        }
예제 #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);
                    }
                }
            }
        }
예제 #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;
        }
예제 #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;
        }
예제 #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;
        }