about summary refs log tree commit diff
path: root/README.md
diff options
context:
space:
mode:
authorMelonai <einebeere@gmail.com>2020-05-10 01:46:29 +0200
committerMelonai <einebeere@gmail.com>2020-05-10 01:46:29 +0200
commita00a8a867cae381982c7b8b77f07836ab4a504ed (patch)
treef36ded8eedce38fccda418e689b11fbe0b3a45dd /README.md
parent9e48090f0b25e7104e1aee86bbd6a04fcdcbb250 (diff)
downloadshorest-a00a8a867cae381982c7b8b77f07836ab4a504ed.tar.zst
shorest-a00a8a867cae381982c7b8b77f07836ab4a504ed.zip
js restructure
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions
ghlight .gp { color: #DDD } /* Generic.Prompt */ .highlight .gs { color: #DDD } /* Generic.Strong */ .highlight .gu { color: #DDD } /* Generic.Subheading */ .highlight .gt { color: #DDD } /* Generic.Traceback */ .highlight .kc { color: #F00 } /* Keyword.Constant */ .highlight .kd { color: #F00 } /* Keyword.Declaration */ .highlight .kn { color: #F00 } /* Keyword.Namespace */ .highlight .kp { color: #F00 } /* Keyword.Pseudo */ .highlight .kr { color: #F00 } /* Keyword.Reserved */ .highlight .kt { color: #EE82EE } /* Keyword.Type */ .highlight .ld { color: #DDD } /* Literal.Date */ .highlight .m { color: #F0F } /* Literal.Number */ .highlight .s { color: #87CEEB } /* Literal.String */ .highlight .na { color: #DDD } /* Name.Attribute */ .highlight .nb { color: #DDD } /* Name.Builtin */ .highlight .nc { color: #DDD } /* Name.Class */ .highlight .no { color: #7FFFD4 } /* Name.Constant */ .highlight .nd { color: #DDD } /* Name.Decorator */ .highlight .ni { color: #DDD } /* Name.Entity */ .highlight .ne { color: #DDD } /* Name.Exception */ .highlight .nf { color: #FF0 } /* Name.Function */ .highlight .nl { color: #DDD } /* Name.Label */ .highlight .nn { color: #DDD } /* Name.Namespace */ .highlight .nx { color: #DDD } /* Name.Other */ .highlight .py { color: #DDD } /* Name.Property */ .highlight .nt { color: #DDD } /* Name.Tag */ .highlight .nv { color: #EEDD82 } /* Name.Variable */ .highlight .ow { color: #F00 } /* Operator.Word */ .highlight .pm { color: #DDD } /* Punctuation.Marker */ .highlight .w { color: #DDD } /* Text.Whitespace */ .highlight .mb { color: #F0F } /* Literal.Number.Bin */ .highlight .mf { color: #F0F } /* Literal.Number.Float */ .highlight .mh { color: #F0F } /* Literal.Number.Hex */ .highlight .mi { color: #F0F } /* Literal.Number.Integer */ .highlight .mo { color: #F0F } /* Literal.Number.Oct */ .highlight .sa { color: #87CEEB } /* Literal.String.Affix */ .highlight .sb { color: #87CEEB } /* Literal.String.Backtick */ .highlight .sc { color: #87CEEB } /* Literal.String.Char */ .highlight .dl { color: #87CEEB } /* Literal.String.Delimiter */ .highlight .sd { color: #87CEEB } /* Literal.String.Doc */ .highlight .s2 { color: #87CEEB } /* Literal.String.Double */ .highlight .se { color: #87CEEB } /* Literal.String.Escape */ .highlight .sh { color: #87CEEB } /* Literal.String.Heredoc */ .highlight .si { color: #87CEEB } /* Literal.String.Interpol */ .highlight .sx { color: #87CEEB } /* Literal.String.Other */ .highlight .sr { color: #87CEEB } /* Literal.String.Regex */ .highlight .s1 { color: #87CEEB } /* Literal.String.Single */ .highlight .ss { color: #87CEEB } /* Literal.String.Symbol */ .highlight .bp { color: #DDD } /* Name.Builtin.Pseudo */ .highlight .fm { color: #FF0 } /* Name.Function.Magic */ .highlight .vc { color: #EEDD82 } /* Name.Variable.Class */ .highlight .vg { color: #EEDD82 } /* Name.Variable.Global */ .highlight .vi { color: #EEDD82 } /* Name.Variable.Instance */ .highlight .vm { color: #EEDD82 } /* Name.Variable.Magic */ .highlight .il { color: #F0F } /* Literal.Number.Integer.Long */
package ast

import "jinx/pkg/libs/source"

type StmtKind int

const (
	StmtKindEmpty StmtKind = iota
	StmtKindUse
	StmtKindGlobal
	StmtKindFnDecl
	StmtKindTypeDecl
	StmtKindVarDecl
	StmtKindIf
	StmtKindForCond
	StmtKindForIn
	StmtKindTry
	StmtKindReturn
	StmtKindContinue
	StmtKindBreak
	StmtKindThrow
	StmtKindExpr
)

type Stmt StmtT[any]

type StmtT[T any] struct {
	At    source.Loc
	Kind  StmtKind
	Value T
}

type StmtUse struct {
	Globals []IdentNode
	Module IdentNode
	Author  IdentNode
}

type StmtGlobal struct {
	Name IdentNode
}

type StmtFnDecl struct {
	Name IdentNode
	Args []IdentNode
	Body BlockNode
}

type StmtTypeDecl struct {
	Name    IdentNode
	Methods []TypeMethodNode
}

type StmtVarDecl struct {
	Name  IdentNode
	Value Expr
}

type StmtIf struct {
	Conds []CondNode
}

type StmtForCond struct {
	Cond Expr
	Do   BlockNode
}

type StmtForIn struct {
	Name       IdentNode
	Collection Expr
	Do         BlockNode
}

type StmtTry struct {
	Try         BlockNode
	CatchedName IdentNode
	Catch       BlockNode
	Finally     BlockNode
}

type StmtReturn struct {
	Value Expr
}

type StmtContinue struct{}

type StmtBreak struct{}

type StmtThrow struct {
	Value Expr
}

type StmtExpr struct {
	Value Expr
}

type StmtEmpty struct{}