-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterpreterTypes.fs
More file actions
44 lines (39 loc) · 1.12 KB
/
InterpreterTypes.fs
File metadata and controls
44 lines (39 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module InterpreterTypes
open ProjectParser
exception InterpreterException of string
type ScopeLayer =
| ScopeGlobal
| TempBlock
| FuncLocal of string * int
| ScopeLocal of string
| ScopeInstance of string * int
type NoRefScope = ScopeLayer list
type ScopeRules =
| PersistentScope
type FuncType = string list * Stmt list
type Value =
| ValNone
| ValBool of bool
| ValInt of int
| ValString of string
| ValFunc of string list * Stmt list
| ValListReference of string
| ValReference of NoRefScope
| ValBuiltinFunc of (Value list -> Scope -> Value * Scope)
// Fake value types
| ValListInner of Value list
| ValOrderedNamespace of (string * OrderedNamespace) list
and RefType = ScopeRules list * Map<string, Value>
and Refs = Map<NoRefScope, RefType>
and Scope = NoRefScope * Refs
and EvalExpr =
| Unevaled of Expr
| Evaled of Value
and OrderedNamespace =
| ONSSubspace of (string * OrderedNamespace) list
| ONSVar of EvalExpr
| ONSFunc of FuncType
type Namespace =
| NSSubspace of Map<string, Namespace>
| NSVar of EvalExpr
| NSFunc of FuncType