Struct SwitchCase
A case in switch flow.
Implements
Inherited Members
Namespace: Flame.Compiler.Flow
Assembly: Flame.Compiler.dll
Syntax
public struct SwitchCase : IEquatable<SwitchCase>
Constructors
| Improve this Doc View SourceSwitchCase(Constant, Branch)
Creates a switch case from a value and a branch.
Declaration
public SwitchCase(Constant value, Branch branch)
Parameters
| Type | Name | Description |
|---|---|---|
| Constant | value | The value for the switch case. |
| Branch | branch | A branch for the switch case. |
SwitchCase(ImmutableHashSet<Constant>, Branch)
Creates a switch case from a set of values and a branch.
Declaration
public SwitchCase(ImmutableHashSet<Constant> values, Branch branch)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Immutable.ImmutableHashSet<Constant> | values | A set of values for the switch case. |
| Branch | branch | A branch for the switch case. |
Properties
| Improve this Doc View SourceBranch
Gets the branch that is taken when any of the values in this switch case match the value being switched on.
Declaration
public Branch Branch { get; }
Property Value
| Type | Description |
|---|---|
| Branch | The switch case's branch. |
Values
Gets a set of all values for this switch case. If control reaches this switch case and any of these values match the value being switched on, then control is redirected to this switch case's branch target.
Declaration
public ImmutableHashSet<Constant> Values { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Immutable.ImmutableHashSet<Constant> | The switch case's values. |
Methods
| Improve this Doc View SourceEquals(SwitchCase)
Tests if this switch case equals another switch case.
Declaration
public bool Equals(SwitchCase other)
Parameters
| Type | Name | Description |
|---|---|---|
| SwitchCase | other | A switch case to compare with this switch case. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Operators
| Improve this Doc View SourceEquality(SwitchCase, SwitchCase)
Tests if two switch cases are equal.
Declaration
public static bool operator ==(SwitchCase left, SwitchCase right)
Parameters
| Type | Name | Description |
|---|---|---|
| SwitchCase | left | The first switch cases to compare. |
| SwitchCase | right | The second switch cases to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Inequality(SwitchCase, SwitchCase)
Tests if two switch cases are not equal.
Declaration
public static bool operator !=(SwitchCase left, SwitchCase right)
Parameters
| Type | Name | Description |
|---|---|---|
| SwitchCase | left | The first switch cases to compare. |
| SwitchCase | right | The second switch cases to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|