diff options
| author | Alasdair Armstrong | 2017-06-28 19:35:57 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-06-28 19:35:57 +0100 |
| commit | 7a20fdcb37a1e7ac0f86d455c616d0a39d9d92bd (patch) | |
| tree | b896676d09178f4f3a2447d431373f687ba6a2a2 /src/parse_ast.ml | |
| parent | 32a621d568081cc7f60102d35d84bece9bbd01c5 (diff) | |
User defined overloaded operators
New typechecker has no builtin overloaded operators - instead can now
write something in SAIL like:
overload (deinfix +) [id1; id2; id3]
to set up functions id1, id2, and id3 as overloadings for the +
operator. Any identifier can be overloaded, not just infix ones. This
is done in a backwards compatible way, so the old typechecker removes
the DEF_overload nodes from the ast so the various backends never see
it.
Diffstat (limited to 'src/parse_ast.ml')
| -rw-r--r-- | src/parse_ast.ml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parse_ast.ml b/src/parse_ast.ml index c6af651b..cfb09bf5 100644 --- a/src/parse_ast.ml +++ b/src/parse_ast.ml @@ -488,6 +488,7 @@ def = (* Top-level definition *) | DEF_type of type_def (* type definition *) | DEF_fundef of fundef (* function definition *) | DEF_val of letbind (* value definition *) + | DEF_overload of id * id list (* operator overload specifications *) | DEF_spec of val_spec (* top-level type constraint *) | DEF_default of default_typing_spec (* default kind and type assumptions *) | DEF_scattered of scattered_def (* scattered definition *) |
