Implemented switch statements
This commit is contained in:
parent
09ec8d8446
commit
52d1de042c
10 changed files with 170 additions and 27 deletions
16
src/build/ast/Switch.go
Normal file
16
src/build/ast/Switch.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package ast
|
||||
|
||||
import (
|
||||
"git.akyoto.dev/cli/q/src/build/expression"
|
||||
)
|
||||
|
||||
// Switch represents a switch statement.
|
||||
type Switch struct {
|
||||
Cases []Case
|
||||
}
|
||||
|
||||
// Case represents a case inside a switch.
|
||||
type Case struct {
|
||||
Condition *expression.Expression
|
||||
Body AST
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue