ConditionIsLiteral indicates whether the condition for the match is a literal with a given value.
(val ref.Val)
| 137 | |
| 138 | // ConditionIsLiteral indicates whether the condition for the match is a literal with a given value. |
| 139 | func (m *CompiledMatch) ConditionIsLiteral(val ref.Val) bool { |
| 140 | c := m.cond.NativeRep().Expr() |
| 141 | return c.Kind() == ast.LiteralKind && c.AsLiteral().Equal(val) == types.True |
| 142 | } |
| 143 | |
| 144 | // Output returns the compiled output expression associated with the match block, if set. |
| 145 | func (m *CompiledMatch) Output() *OutputValue { |