Added comments.

This commit is contained in:
Christian Rinderknecht 2020-06-15 18:16:03 +02:00
parent 05923fbb4c
commit b3da13251c
3 changed files with 14 additions and 7 deletions

View File

@ -400,6 +400,10 @@ and cond_expr = {
ifnot : expr ifnot : expr
} }
(* Code injection. Note how the field [language] wraps a region in
another: the outermost region covers the header "[%<language>" and
the innermost covers the <language>. *)
and code_inj = { and code_inj = {
language : string reg reg; language : string reg reg;
code : expr; code : expr;

View File

@ -121,11 +121,10 @@ type_decl:
"type" type_name "=" type_expr { "type" type_name "=" type_expr {
Scoping.check_reserved_name $2; Scoping.check_reserved_name $2;
let region = cover $1 (type_expr_to_region $4) in let region = cover $1 (type_expr_to_region $4) in
let value = { let value = {kwd_type = $1;
kwd_type = $1; name = $2;
name = $2; eq = $3;
eq = $3; type_expr = $4}
type_expr = $4}
in {region; value} } in {region; value} }
type_expr: type_expr:
@ -710,6 +709,6 @@ seq_expr:
code_inj: code_inj:
"<lang>" expr "]" { "<lang>" expr "]" {
let region = cover $1.region $3 let region = cover $1.region $3
and value = {language=$1; code=$2; rbracket=$3} and value = {language=$1; code=$2; rbracket=$3}
in {region; value} } in {region; value} }

View File

@ -436,6 +436,10 @@ and for_collect = {
block : block reg block : block reg
} }
(* Code injection. Note how the field [language] wraps a region in
another: the outermost region covers the header "[%<language>" and
the innermost covers the <language>. *)
and code_inj = { and code_inj = {
language : string reg reg; language : string reg reg;
code : expr; code : expr;