OILS / data_lang / nil8.asdl View on Github | oilshell.org

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