Skip to content
Snippets Groups Projects

Add complete rework of scheme language and conversion to binary representation

Merged Maik Wojcieszak requested to merge scheme-bin into master
1 file
+ 48
0
Compare changes
  • Side-by-side
  • Inline
+ 48
0
# Binary representation of an ujo scheme
module ujsbin_base
: doc """Base types for ujs binary format.""";
container = int32
: in (
48 : doc "list",
49 : doc "map",
50 : doc "table"
) : doc "Container type IDs";
atomic = int32
: in (
1 : doc "float64",
2 : doc "float32",
3 : doc "float16",
4 : doc "string"
) : doc "atomic type IDs";
type = variant of [
container,
atomic
];
types = list of type;
# constraint definitions
notnull = list [
int8 : doc "constraint id = 1"
: in (1),
bool : doc "True means null is not a valid value"
] : doc "If true the value can't be null";
constraint = variant of [notnull];
constraints = list of constraint;
# defining a data field
typedef = list [
types : name TypeIDs : doc "A list of possible basic types",
constraints : name Constraints : doc "constraint defintion for this type"
];
listdef = list of typedef;
Loading