From b3da13251c2067580957bc20a5497350984ae2e2 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Mon, 15 Jun 2020 18:16:03 +0200 Subject: [PATCH] Added comments. --- src/passes/01-parser/cameligo/AST.ml | 4 ++++ src/passes/01-parser/cameligo/Parser.mly | 13 ++++++------- src/passes/01-parser/pascaligo/AST.ml | 4 ++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/passes/01-parser/cameligo/AST.ml b/src/passes/01-parser/cameligo/AST.ml index 60c9c0157..abe29b615 100644 --- a/src/passes/01-parser/cameligo/AST.ml +++ b/src/passes/01-parser/cameligo/AST.ml @@ -400,6 +400,10 @@ and cond_expr = { ifnot : expr } +(* Code injection. Note how the field [language] wraps a region in + another: the outermost region covers the header "[%" and + the innermost covers the . *) + and code_inj = { language : string reg reg; code : expr; diff --git a/src/passes/01-parser/cameligo/Parser.mly b/src/passes/01-parser/cameligo/Parser.mly index de79c2854..807bc6dd3 100644 --- a/src/passes/01-parser/cameligo/Parser.mly +++ b/src/passes/01-parser/cameligo/Parser.mly @@ -121,11 +121,10 @@ type_decl: "type" type_name "=" type_expr { Scoping.check_reserved_name $2; let region = cover $1 (type_expr_to_region $4) in - let value = { - kwd_type = $1; - name = $2; - eq = $3; - type_expr = $4} + let value = {kwd_type = $1; + name = $2; + eq = $3; + type_expr = $4} in {region; value} } type_expr: @@ -710,6 +709,6 @@ seq_expr: code_inj: "" expr "]" { - let region = cover $1.region $3 - and value = {language=$1; code=$2; rbracket=$3} + let region = cover $1.region $3 + and value = {language=$1; code=$2; rbracket=$3} in {region; value} } diff --git a/src/passes/01-parser/pascaligo/AST.ml b/src/passes/01-parser/pascaligo/AST.ml index 0fd1cb70b..5b66b1967 100644 --- a/src/passes/01-parser/pascaligo/AST.ml +++ b/src/passes/01-parser/pascaligo/AST.ml @@ -436,6 +436,10 @@ and for_collect = { block : block reg } +(* Code injection. Note how the field [language] wraps a region in + another: the outermost region covers the header "[%" and + the innermost covers the . *) + and code_inj = { language : string reg reg; code : expr;