private AddNodeToCurrentBlock ( |
||
node | ||
Результат |
private static void HandlePartial(HandlebarsParserState state) { var partialTemplateName = state.CurrentToken.Content.Substring(1).Trim(); var self = SyntaxTreeExpression.Self(state.BlockStack.GetCurrentModelType()); state.AddNodeToCurrentBlock(SyntaxTree.Include(partialTemplateName, self)); }
private static void HandleHelperStart(HandlebarsParserState state, IBlockHelperHandler helper) { var block = SyntaxTree.Block(state.CurrentLocation); var helperBlock = SyntaxTree.Helper(SyntaxTreeExpression.Helper(state.CurrentToken.Content.Substring(1), helper, state.CurrentLocation), block, state.CurrentLocation); state.AddNodeToCurrentBlock(helperBlock); state.BlockStack.PushModelInheritingBlock(block); }
private static void HandleUnless(HandlebarsParserState state) { var block = SyntaxTree.Block(state.CurrentLocation); var conditional = SyntaxTree.Conditional(state.ParseExpression(state.CurrentToken.Content.Substring(8), state.CurrentLocation.MoveIndex(8)), state.CurrentLocation, SyntaxTree.Block(state.CurrentLocation), block); state.AddNodeToCurrentBlock(conditional); state.BlockStack.PushModelInheritingBlock(block); }
private static void HandleIf(HandlebarsParserState state) { var block = SyntaxTree.Block(); var conditional = SyntaxTree.Conditional(state.ParseExpression(state.CurrentToken.Content.Substring(4)), block); state.AddNodeToCurrentBlock(conditional); state.BlockStack.PushModelInheritingBlock(block); }
private static void HandleWith(HandlebarsParserState state) { var withBlock = SyntaxTree.Block(); var modelExpression = state.ParseExpression(state.CurrentToken.Content.Substring(6).Trim()); state.AddNodeToCurrentBlock(SyntaxTree.ScopeNode(modelExpression, withBlock)); state.BlockStack.PushBlock(new HandlebarsParserBlock { Block = withBlock, ModelInScope = modelExpression.ResultType }); }
private static void HandleEach(HandlebarsParserState state) { var iteration = SyntaxTree.Iterate( state.ParseExpression(state.CurrentToken.Content.Substring(6)), SyntaxTree.Block() ); state.AddNodeToCurrentBlock(iteration); state.BlockStack.PushBlock(new HandlebarsParserBlock { Block = iteration.Body, ModelInScope = iteration.ItemType }); }
private static void HandleFlush(HandlebarsParserState state) { state.AddNodeToCurrentBlock(SyntaxTree.Flush(state.CurrentLocation)); }
private static void HandleEach(HandlebarsParserState state) { var iteration = SyntaxTree.Iterate( state.ParseExpression(state.CurrentToken.Content.Substring(6), state.CurrentLocation.MoveIndex(6)), state.CurrentLocation, SyntaxTree.Block(state.CurrentLocation) ); state.AddNodeToCurrentBlock(iteration); state.BlockStack.PushBlock(new HandlebarsParserBlock { Block = iteration.Body, ModelInScope = iteration.ItemType }); }
private static void HandleUnless(HandlebarsParserState state) { var block = SyntaxTree.Block(state.CurrentLocation); var conditional = SyntaxTree.Conditional(state.ParseExpression(state.CurrentToken.Content.Substring(8), state.CurrentLocation.MoveIndex(8)), state.CurrentLocation, SyntaxTree.Block(state.CurrentLocation), block); state.AddNodeToCurrentBlock(conditional); state.BlockStack.PushModelInheritingBlock(block); }
private static void HandleHelper(HandlebarsParserState state, IHelperHandler helper) { string expression = state.CurrentToken.Content; state.AddNodeToCurrentBlock(SyntaxTreeExpression.Helper(expression, helper, state.CurrentLocation)); }
private static void HandleHelperStart(HandlebarsParserState state, IBlockHelperHandler helper) { var block = SyntaxTree.Block(state.CurrentLocation); var helperBlock = SyntaxTree.Helper(SyntaxTreeExpression.Helper(state.CurrentToken.Content.Substring(1), helper, state.CurrentLocation), block, state.CurrentLocation); state.AddNodeToCurrentBlock(helperBlock); state.BlockStack.PushModelInheritingBlock(block); }
private static void HandleBody(HandlebarsParserState state) { state.AddNodeToCurrentBlock(SyntaxTree.Override(OverrideSectionName, state.CurrentLocation)); }
private static void HandleBody(HandlebarsParserState state) { state.AddNodeToCurrentBlock(SyntaxTree.Override(OverrideSectionName)); }
private static void HandleFlush(HandlebarsParserState state) { state.AddNodeToCurrentBlock(SyntaxTree.Flush()); }
private static void HandleHelper(HandlebarsParserState state, IHelperHandler helper) { string expression = state.CurrentToken.Content; state.AddNodeToCurrentBlock(SyntaxTreeExpression.Helper(expression, helper, state.CurrentLocation)); }
private static void HandleWith(HandlebarsParserState state) { var withBlock = SyntaxTree.Block(state.CurrentLocation); var modelExpression = state.ParseExpression(state.CurrentToken.Content.Substring(6), state.CurrentLocation.MoveIndex(6)); state.AddNodeToCurrentBlock(SyntaxTree.ScopeNode(modelExpression, withBlock, state.CurrentLocation)); state.BlockStack.PushBlock(new HandlebarsParserBlock { Block = withBlock, ModelInScope = modelExpression.ResultType }); }
private static void HandlePartial(HandlebarsParserState state) { var partialTemplateName = state.CurrentToken.Content.Substring(1).Trim(); var self = SyntaxTreeExpression.Self(state.BlockStack.GetCurrentModelType(), state.CurrentLocation); state.AddNodeToCurrentBlock(SyntaxTree.Include(partialTemplateName, self, state.CurrentLocation)); }
private static void HandleExpression(HandlebarsParserState state) { var expression = state.ParseExpression(state.CurrentToken.Content); state.AddNodeToCurrentBlock(SyntaxTree.WriteExpression(expression, state.CurrentToken.IsHtmlEscape)); }
private static void HandleExpression(HandlebarsParserState state) { var expression = state.ParseExpression(state.CurrentToken.Content, state.CurrentLocation); state.AddNodeToCurrentBlock(SyntaxTree.WriteExpression(expression, state.CurrentLocation, state.CurrentToken.IsHtmlEscape)); }
private static void HandleIf(HandlebarsParserState state) { var block = SyntaxTree.Block(); var conditional = SyntaxTree.Conditional(state.ParseExpression(state.CurrentToken.Content.Substring(4)), block); state.AddNodeToCurrentBlock(conditional); state.BlockStack.PushModelInheritingBlock(block); }