Example #1
0
        //public bool NameEqual(string name)
        //{
        //    int index = name.LastIndexOf('.');
        //    if (index == -1)
        //        return this.Equal(new Declaration(name));
        //    else
        //        return this.Equal(new Declaration(name.Substring(0, index), new Declaration(name.Substring(index + 1))));
        //}

        //public void AddField(Declaration field)
        //{
        //    Fields.Add(field);
        //}

        public void AddSibling(Declaration sibling)
        {
            Siblings.Add(sibling);
        }
Example #2
0
        private void AddDeclarationsForTableField(LuaBlockNode block, LuaModel model, Declaration namespaces, LuaNode expr)
        {
            if (expr is LuaTableNode)
            {
                foreach (var field in ((LuaTableNode)expr).FieldList)
                {
                    AddDeclarationsForTableField(block, model, namespaces, field);
                }
            }

            if (expr is LuaField && ((LuaField)expr).Name != null)
            {
                LuaNode     variable    = ((LuaField)expr).Name;
                Declaration declaration = new Declaration(variable.AsString, String.Empty, model.FilePath,
                                                          new ScopeSpan(variable.Span.EndPosition,
                                                                        variable.EndLine,
                                                                        block.Span.EndPosition,
                                                                        block.EndLine),
                                                          namespaces);

                block.Locals.Add(declaration);
                AddDeclarationsForTableField(block, model, declaration, ((LuaField)expr).Expression);
            }
        }
Example #3
0
 public Declaration(string name, string description, string filepath, ScopeSpan scope, LuaDeclarationType type, Declaration nameSpace)
 {
     Name        = name;
     Description = description;
     FilePath    = filepath;
     Scope       = scope;
     Type        = type;
     NameSpace   = nameSpace;
 }