コード例 #1
0
func NewEmptyStmtListNode(sourcePosInfo attrib) (interfaces.StmtList, error) {
	stmt := stmt.NewEmptyStmtList()
	stmt.SetSourceInfo(sourcePosInfo.(token.Pos))
	return stmt, nil
}
コード例 #2
0
func TestFormIdentifierExtraction(t *testing.T) {
	exampleEmptyForm := "form TestForm {}"

	exampleOutputForm := stmt.NewForm(vari.NewVarID("TestForm"), stmt.NewEmptyStmtList())
	testStmtParse(t, exampleEmptyForm, exampleOutputForm)
}
コード例 #3
0
func NewStmtListNode(stmtElt attrib) (interfaces.StmtList, error) {
	stmtEltTypeAsserted := stmtElt.(interfaces.Stmt)
	stmt := stmt.NewEmptyStmtList()
	stmt.SetSourceInfo(stmtEltTypeAsserted.SourceInfo())
	return stmt.AddStmt(stmtEltTypeAsserted), nil
}