Пример #1
0
// QuestionNode adds question to symbol table, and dispatch to frontend
// rendering.
func (d Draw) QuestionNode(q *ast.QuestionNode) {

	qcpy := q.Clone()
	visible := plumbing.Hidden
	if 0 == d.nest {
		visible = plumbing.Visible
	}

	ftyp := ""
	if qcpy.Type() == ast.ScalarQuestionType {
		ftyp = qcpy.Primitive()
	}

	d.toFrontend <- &plumbing.Frontend{
		Type: plumbing.DrawQuestion,

		Identifier: qcpy.Identifier(),
		Label:      qcpy.Label(),
		FieldType:  ftyp,

		Visible: visible,
	}
}