From 821c980e3ec1ca7178c8b245b69c291a72ad7380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzanne=20Dup=C3=A9ron?= Date: Wed, 29 Jan 2020 17:35:21 +0000 Subject: [PATCH 1/2] documentation for Declaration_constant --- src/stages/ast_simplified/types.ml | 7 +++++++ src/stages/ast_typed/types.ml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/stages/ast_simplified/types.ml b/src/stages/ast_simplified/types.ml index 69f564740..a941bf8fb 100644 --- a/src/stages/ast_simplified/types.ml +++ b/src/stages/ast_simplified/types.ml @@ -11,7 +11,14 @@ and type_expression = { } and declaration = | Declaration_type of (type_variable * type_expression) + + (* A Declaration_constant is described by + * a name + * an optional type annotation + * a boolean indicating whether it should be inlined + * an expression *) | Declaration_constant of (expression_variable * type_expression option * inline * expression) + (* | Macro_declaration of macro_declaration *) and expr = expression diff --git a/src/stages/ast_typed/types.ml b/src/stages/ast_typed/types.ml index cf4957613..d153a1cff 100644 --- a/src/stages/ast_typed/types.ml +++ b/src/stages/ast_typed/types.ml @@ -8,7 +8,13 @@ type program = declaration Location.wrap list and inline = bool and declaration = + (* A Declaration_constant is described by + * a name + a type-annotated expression + * a boolean indicating whether it should be inlined + * the environment before the declaration (the original environment) + * the environment after the declaration (i.e. with that new declaration added to the original environment). *) | Declaration_constant of (named_expression * inline * (full_environment * full_environment)) + (* | Macro_declaration of macro_declaration *) and environment_element_definition = From c534d6dff2b6b607bfc63ca1c0cbe1a38024d09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzanne=20Dup=C3=A9ron?= Date: Wed, 29 Jan 2020 17:37:10 +0000 Subject: [PATCH 2/2] Cleanup --- src/stages/ast_simplified/types.ml | 2 -- src/stages/ast_typed/types.ml | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/stages/ast_simplified/types.ml b/src/stages/ast_simplified/types.ml index a941bf8fb..94b64044f 100644 --- a/src/stages/ast_simplified/types.ml +++ b/src/stages/ast_simplified/types.ml @@ -19,8 +19,6 @@ and declaration = * an expression *) | Declaration_constant of (expression_variable * type_expression option * inline * expression) - (* | Macro_declaration of macro_declaration *) - and expr = expression and lambda = { diff --git a/src/stages/ast_typed/types.ml b/src/stages/ast_typed/types.ml index d153a1cff..4e3355ce4 100644 --- a/src/stages/ast_typed/types.ml +++ b/src/stages/ast_typed/types.ml @@ -15,8 +15,6 @@ and declaration = * the environment after the declaration (i.e. with that new declaration added to the original environment). *) | Declaration_constant of (named_expression * inline * (full_environment * full_environment)) - (* | Macro_declaration of macro_declaration *) - and environment_element_definition = | ED_binder | ED_declaration of (annotated_expression * free_variables)