Exemple #1
0
func (this *table) allocIfStates(expr *ast.StateExpr) {
	if expr.State != nil {
		this.allocState(expr.GetState())
		return
	}
	this.allocIfStates(expr.GetIfExpr().GetThenClause())
	this.allocIfStates(expr.GetIfExpr().GetElseClause())
}
Exemple #2
0
func compile(stateExpr *ast.StateExpr, nameToState NameToState, c Catcher) (StateExpr, error) {
	if stateExpr.State != nil {
		state, err := nameToState.NameToState(stateExpr.GetState())
		if err != nil {
			return nil, err
		}
		return &constState{state}, nil
	}
	return Compile(stateExpr.GetIfExpr(), nameToState, c)
}