go2hx

manual

github

Module: stdgo.text.template.parse

(view library index)

Overview

Index

Constants

import stdgo.text.template.parse.Parse
final nodeAction:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeAction.nodeAction
final nodeBool:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeBool.nodeBool
final nodeBreak:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeBreak.nodeBreak
final nodeChain:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeChain.nodeChain
final nodeCommand:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeCommand.nodeCommand
final nodeComment:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeComment.nodeComment
final nodeContinue:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeContinue.nodeContinue
final nodeDot:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeDot.nodeDot
final nodeField:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeField.nodeField
final nodeIdentifier:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeIdentifier.nodeIdentifier
final nodeIf:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeIf.nodeIf
final nodeList:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeList.nodeList
final nodeNil:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeNil.nodeNil
final nodeNumber:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeNumber.nodeNumber
final nodePipe:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodePipe.nodePipe
final nodeRange:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeRange.nodeRange
final nodeString:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeString.nodeString
final nodeTemplate:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeTemplate.nodeTemplate
final nodeText:stdgo.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeText.nodeText
final nodeVariable:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeVariable.nodeVariable
final nodeWith:stdgo._internal.text.template.parse.NodeType = stdgo._internal.text.template.parse.Parse_nodeWith.nodeWith
final parseComments:stdgo.text.template.parse.Mode = stdgo._internal.text.template.parse.Parse_parseComments.parseComments
final skipFuncCheck:stdgo._internal.text.template.parse.Mode = stdgo._internal.text.template.parse.Parse_skipFuncCheck.skipFuncCheck

Classes

import stdgo.text.template.parse.*

class Parse

{
    	token_3661234 = t.peekNonSpace()
    	pipe = t.newPipeline(token_3661234.pos, token_3661234.line, nil)
    	gotoNext = 3661353
    	_ = gotoNext == 3661353
    	if v_3661364 = t.peekNonSpace(); v_3661364.typ == 21 {
    		gotoNext = 3661409
    		_ = gotoNext == 3661409
    		t.next()
    		tokenAfterVariable_3661725 = t.peek()
    		next_3661758 = t.peekNonSpace()
    		_ = 0
    		gotoNext = 3661785
    		_ = gotoNext == 3661785
    		switch {
    		case next_3661758.typ == 6, next_3661758.typ == 7:
    			gotoNext = 3661796
    			_ = gotoNext == 3661796
    			pipe.IsAssign = next_3661758.typ == 6
    			t.nextNonSpace()
    			pipe.Decl = append(pipe.Decl, t.newVariable(v_3661364.pos, v_3661364.val))
    			t.vars = append(t.vars, v_3661364.val)
    			gotoNext = 3662626
    		case next_3661758.typ == 2 && next_3661758.val == ",":
    			gotoNext = 3662010
    			_ = gotoNext == 3662010
    			t.nextNonSpace()
    			pipe.Decl = append(pipe.Decl, t.newVariable(v_3661364.pos, v_3661364.val))
    			t.vars = append(t.vars, v_3661364.val)
    			if context == "range" && len(pipe.Decl) < 2 {
    				gotoNext = 3662219
    				_ = gotoNext == 3662219
    				_ = 0
    				gotoNext = 3662225
    				_ = gotoNext == 3662225
    				switch t.peekNonSpace().typ {
    				case 21, 16, 17:
    					gotoNext = 3662259
    					_ = gotoNext == 3662259
    					gotoNext = 3661353
    					gotoNext = 3662462
    				default:
    					gotoNext = 3662386
    					_ = gotoNext == 3662386
    					t.errorf("range can only initialize variables")
    					gotoNext = 3662462
}
    				gotoNext = 3662462
    			} else {
    				gotoNext = 3662462
}
    			_ = gotoNext == 3662462
    			t.errorf("too many declarations in %s", context)
    			gotoNext = 3662626
    		case tokenAfterVariable_3661725.typ == 18:
    			gotoNext = 3662513
    			_ = gotoNext == 3662513
    			t.backup3(v_3661364, tokenAfterVariable_3661725)
    			gotoNext = 3662626
    		default:
    			gotoNext = 3662593
    			_ = gotoNext == 3662593
    			t.backup2(v_3661364)
    			gotoNext = 3662626
}
    		gotoNext = 3662626
    	} else {
    		gotoNext = 3662626
}
    	_ = gotoNext == 3662626
    	_ = 0
    	gotoNext = 3662626
    	_ = gotoNext == 3662626
    	if true {
    		gotoNext = 3662630
    		_ = gotoNext == 3662630
    		token_3662641 = t.nextNonSpace()
    		gotoNext = 3662634
    		_ = gotoNext == 3662634
    		switch token_3662641 = t.nextNonSpace(); token_3662641.typ {
    		case end:
    			gotoNext = 3662682
    			_ = gotoNext == 3662682
    			t.checkPipeline(pipe, context)
    			return
    			gotoNext = 3663038
    		case 1, 3, 5, 26, 9, 10, 13, 31, 15, 19, 21, 12:
    			gotoNext = 3662784
    			_ = gotoNext == 3662784
    			t.backup()
    			pipe.append(t.command())
    			gotoNext = 3663038
    		default:
    			gotoNext = 3662990
    			_ = gotoNext == 3662990
    			t.unexpected(token_3662641, context)
    			gotoNext = 3663038
}
    		gotoNext = 3662626
    	} else {
    		gotoNext = 3663038
}
    	_ = gotoNext == 3663038
    	gotoNext = -1
    }

Parse function isEmptyTree

function isEmptyTree(_n:stdgo.text.template.parse.Node):Bool

IsEmptyTree reports whether this tree (node) is empty of everything but space or comments.

(view code)

Parse function newIdentifier

function newIdentifier(_ident:String):stdgo.text.template.parse.IdentifierNode

NewIdentifier returns a new IdentifierNode with the given identifier name.

(view code)

Parse function new_

function new_(_name:String, _funcs:haxe.Rest<stdgo.GoMap<stdgo.GoString, stdgo.AnyInterface>>):stdgo.text.template.parse.Tree

New allocates a new parse tree with the given name.

(view code)

Parse function parse

function parse(_name:String, _text:String, _leftDelim:String, _rightDelim:String, _funcs:haxe.Rest<stdgo.GoMap<stdgo.GoString, stdgo.AnyInterface>>):stdgo.Tuple<stdgo.GoMap<stdgo.GoString, stdgo.Ref<stdgo._internal.text.template.parse.Tree>>, stdgo.Error>
Parse returns a map from template name to parse.Tree, created by parsing the
        templates described in the argument string. The top-level template will be
        given the specified name. If an error is encountered, parsing stops and an
        empty map is returned with the error.

(view code)

Typedefs

import stdgo.text.template.parse.*

typedef Mode

typedef Mode = stdgo._internal.text.template.parse.Mode;

typedef Node

typedef Node = stdgo._internal.text.template.parse.Node;

typedef NodeType

typedef NodeType = stdgo._internal.text.template.parse.NodeType;

typedef Pos

typedef Pos = stdgo._internal.text.template.parse.Pos;

typedef T_itemType

typedef T_itemType = stdgo._internal.text.template.parse.T_itemType;

typedef T_stateFn

typedef T_stateFn = stdgo._internal.text.template.parse.T_stateFn;

Abstracts

abstract T_item

(view file containing code)

abstract T_lexer

(view file containing code)

abstract T_lexOptions

(view file containing code)

abstract ListNode

(view file containing code)

abstract TextNode

(view file containing code)

abstract CommentNode

(view file containing code)

abstract PipeNode

(view file containing code)

abstract ActionNode

(view file containing code)

abstract CommandNode

(view file containing code)

abstract IdentifierNode

(view file containing code)

abstract VariableNode

(view file containing code)

abstract DotNode

(view file containing code)

abstract NilNode

(view file containing code)

abstract FieldNode

(view file containing code)

abstract ChainNode

(view file containing code)

abstract BoolNode

(view file containing code)

abstract NumberNode

(view file containing code)

abstract StringNode

(view file containing code)

abstract T_endNode

(view file containing code)

abstract T_elseNode

(view file containing code)

abstract BranchNode

(view file containing code)

abstract IfNode

(view file containing code)

abstract BreakNode

(view file containing code)

abstract ContinueNode

(view file containing code)

abstract RangeNode

(view file containing code)

abstract WithNode

(view file containing code)

abstract TemplateNode

(view file containing code)

abstract Tree

(view file containing code)