helper_method_conditional_comment.go
func newHelperMethodConditionalComment(ln *line, rslt *result, src *source, parent element, opts *Options) (*helperMethodConditionalComment, error) {
	switch len(ln.tokens) {
	case 2:
		return nil, fmt.Errorf("no comment type is specified [file: %s][line: %d]", ln.fileName(), ln.no)
	case 3:
		return nil, fmt.Errorf("no condition is specified [file: %s][line: %d]", ln.fileName(), ln.no)
	}

	commentType := ln.tokens[2]

	if commentType != commentTypeHidden && commentType != commentTypeRevealed {
		return nil, fmt.Errorf("the comment type is invalid [file: %s][line: %d]", ln.fileName(), ln.no)
	}

	e := &helperMethodConditionalComment{
		elementBase: newElementBase(ln, rslt, src, parent, opts),
		commentType: commentType,
		condition:   strings.Join(ln.tokens[3:], space),
	}

	return e, nil
}
func newHelperMethodConditionalComment(ln *line, rslt *result, src *source, parent element, opts *Options) (*helperMethodConditionalComment, error) {
	switch len(ln.tokens) {
	case 2:
		return nil, fmt.Errorf("no comment type is specified [file: %s][line: %d]", ln.fileName(), ln.no)
	case 3:
		return nil, fmt.Errorf("no condition is specified [file: %s][line: %d]", ln.fileName(), ln.no)
	}

	commentType := ln.tokens[2]

	if commentType != commentTypeHidden && commentType != commentTypeRevealed {
		return nil, fmt.Errorf("the comment type is invalid [file: %s][line: %d]", ln.fileName(), ln.no)
	}

	e := &helperMethodConditionalComment{
		elementBase: newElementBase(ln, rslt, src, parent, opts),
		commentType: commentType,
		condition:   strings.Join(ln.tokens[3:], space),
	}

	return e, nil
}
func newHelperMethodConditionalComment ( ln * line , rslt * result , src * source , parent element , opts * Options ) ( * helperMethodConditionalComment , error ) { switch len ( ln . tokens ) { case 2 : return nil , fmt . Errorf ( " " , ln . fileName ( ) , ln . no ) case 3 : return nil , fmt . Errorf ( " " , ln . fileName ( ) , ln . no ) } commentType := ln . tokens [ 2 ] if commentType != commentTypeHidden && commentType != commentTypeRevealed { return nil , fmt . Errorf ( " " , ln . fileName ( ) , ln . no ) } e := & helperMethodConditionalComment { elementBase : newElementBase ( ln , rslt , src , parent , opts ) , commentType : commentType , condition : strings . Join ( ln . tokens [ 3 : ] , space ) , } return e , nil }
// newHelperMethodConditionalComment creates and returns an HTML comment.
newHelperMethodConditionalComment creates and returns an HTML comment .