1 |
|
2 | module nil8
|
3 | {
|
4 |
|
5 | # Very similar to core/value.asdl, which JSON8 is deserialized to.
|
6 | #
|
7 | # Right now we're keeping them separate because we want to write a standalone
|
8 | # Yaks compiler, with no dependency on Oils.
|
9 | #
|
10 | # Later I think that Null Bool Int Float Str can either be:
|
11 | # - defined as shared constants
|
12 | # - be "inlined" inside any sum type, because of pointer tagging
|
13 |
|
14 | nvalue =
|
15 | Null
|
16 | | Bool(bool b)
|
17 | | Int(int i)
|
18 | | Float(float f)
|
19 |
|
20 | # I wonder if we want nvalue.Char for translating to C?
|
21 | # Could be literal \\ and \n and \'a' or something
|
22 |
|
23 | # string literal e.g. "foo" or b'\yff'
|
24 | | Str(str s)
|
25 |
|
26 | # either Identifier like func main
|
27 | # or operator like + or ++
|
28 | | Symbol(str s)
|
29 |
|
30 | | List(List[nvalue] items)
|
31 | | Record(str name, List[nvalue] args, Dict[str, nvalue] named)
|
32 | }
|
33 |
|