forked from oils-for-unix/oils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnil8.asdl
31 lines (25 loc) · 845 Bytes
/
nil8.asdl
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
module nil8
{
# Very similar to core/value.asdl, which JSON8 is deserialized to.
#
# Right now we're keeping them separate because we want to write a standalone
# Yaks compiler, with no dependency on Oils.
#
# Later I think that Null Bool Int Float Str can either be:
# - defined as shared constants
# - be "inlined" inside any sum type, because of pointer tagging
nvalue =
Null
| Bool(bool b)
| Int(int i)
| Float(float f)
# I wonder if we want nvalue.Char for translating to C?
# Could be literal \\ and \n and \'a' or something
# string literal e.g. "foo" or b'\yff'
| Str(str s)
# either Identifier like func main
# or operator like + or ++
| Symbol(str s)
| List(List[nvalue] items)
| Record(str name, List[nvalue] args, Dict[str, nvalue] named)
}