public SyntaxTreeNode Parse(TextReader templateReader, Type modelType) { var tokens = SuperSimpleTokenizer.Tokenize(templateReader).ToArray(); var firstToken = tokens.First(); if (firstToken.IsSyntaxToken && firstToken.Content.StartsWith("Master")) { return(SuperSimpleMasterPageParser.Parse(tokens, modelType)); } return(SuperSimpleTemplateParser.Parse(tokens, modelType)); }
internal void FinalizeCurrentSection() { if (!this.IsProcessingASection) { throw new VeilParserException("Found token @EndSection without a matching @Section"); } var node = SuperSimpleTemplateParser.Parse(this.tokensInCurrentSection, this.ModelType); this.sections.Add(this.CurrentSectionName, node); this.IsProcessingASection = false; this.CurrentSectionName = ""; this.tokensInCurrentSection.Clear(); }