From 8f4ed1153995dc25c6afd9cc77ec552f00611476 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 c39a54de5..76654aac3 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 f5ab7c61c..21c1d9b12 100644 --- a/src/passes/01-parser/pascaligo/AST.ml +++ b/src/passes/01-parser/pascaligo/AST.ml @@ -426,6 +426,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;