You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1651 Reporter: administrator Status: resolved (set by @damiendoligez on 2012-09-11T07:18:11Z) Resolution: suspended Priority: normal Severity: minor Category: documentation Monitored by: "Hendrik Tews" smithjoshuab
Bug description
Hi,
Appendix A (quotations) of the camlp4 reference manual is
incorrect or incomplete in the following cases:
there are no quotations documented for the two types
MLast.row_field and MLast.with_constr. Further there is no
location function "loc_of_..." defined for these two types.
for the following constructors from MLast there is no
quotation or the given quotation contains errors:
the following quotations do not work as given, they produce
the following error messages:
<:patt< { $ppl$ } >>: record.
Parse error: '=' expected after [patt_label_ident] (in [label_patt])
<:module_expr< ( $me$ : $mt$ ) ] >>: module type constraint.
Parse error: end of input expected after [module expression] (in [module
expression])
<:class_type< object $s$$list:csil$ end >>: class object type
Parse error: ';' expected after [class signature item] (in [class
type])
<:class_str_item< method $s$ : $t$ >>: method.
Parse error: '=' expected after [type] (in [class structure item])
<:class_str_item< method private $s$ : $t$ >>: private method.
Parse error: '=' expected after [type] (in [class structure item])
the quotation
<:class_sig_item< value $mut:m$$s$ = $t$ >>: value.
should be
<:class_sig_item< value $mut:m$$s$ : $t$ >> ....
For the compilation of these errors I used the attached ocaml
file. It would be nice if the next camlp4 release would contain
an example file with a complete pattern match over the syntax
tree written entirely with quotations.
Indeed, the camlp4 referenced here has become camlp5. Maybe the camlp5 maintainer would like to have a look at this PR, but this is not about the core OCaml distribution anymore.
Original bug ID: 1651
Reporter: administrator
Status: resolved (set by @damiendoligez on 2012-09-11T07:18:11Z)
Resolution: suspended
Priority: normal
Severity: minor
Category: documentation
Monitored by: "Hendrik Tews" smithjoshuab
Bug description
Hi,
Appendix A (quotations) of the camlp4 reference manual is
incorrect or incomplete in the following cases:
there are no quotations documented for the two types
MLast.row_field and MLast.with_constr. Further there is no
location function "loc_of_..." defined for these two types.
for the following constructors from MLast there is no
quotation or the given quotation contains errors:
ExVrn (_, )
ExSnd (, _, )
ExOvr (, )
ExOlb (, _, )
ExNew (, )
ExLmd (, _, _, )
PaVrn (, )
PaTyp (, )
PaRec (, )
PaOlb (, _, _, )
PaLab (, _, )
PaFlo (, )
PaArr (, )
TyObj (, , true)
SgInc (, )
SgDir (, _, )
SgClt (, )
SgCls (, )
StInc (, )
StDir (, _, )
StClt (, )
StCls (, )
MeTyc (, _, )
CtSig (, _, )
CrMth (, _, _, _, _)
the following error messages:
<:patt< {$ppl$ } >>: record.
Parse error: '=' expected after [patt_label_ident] (in [label_patt])
<:module_expr< ($me$ : $mt$ ) ] >>: module type constraint.
Parse error: end of input expected after [module expression] (in [module
expression])
<:class_type< object$s$ $list:csil$ end >>: class object type
Parse error: ';' expected after [class signature item] (in [class
type])
<:class_str_item< method$s$ : $t$ >>: method.
Parse error: '=' expected after [type] (in [class structure item])
<:class_str_item< method private$s$ : $t$ >>: private method.
Parse error: '=' expected after [type] (in [class structure item])
<:class_sig_item< value$mut:m$ $s$ = $t$ >>: value.
should be
<:class_sig_item< value$mut:m$ $s$ : $t$ >> ....
For the compilation of these errors I used the attached ocaml
file. It would be nice if the next camlp4 release would contain
an example file with a complete pattern match over the syntax
tree written entirely with quotations.
Bye,
Hendrik
(* A.2 Quotation expr *)
let f = function$e1$ . $e2$ >> -> ()$anti:e$ >> -> ()$e1$ $e2$ >> -> ()$e1$ .( $e2$ ) >> -> ()$list:el$ |] >> -> ()$e1$ := $e2$ >> -> ()$chr:c$ >> -> ()
| <:expr<
| <:expr<
| <:expr<
| <:expr<
| <:expr< [|
| <:expr<
| <:expr<
(* in new version *)$e$ :> $t$ ) >> -> ()$e$ : $t1$ :> $t2$ ) >> -> ()
| <:expr< (
| <:expr< (
| <:expr<$flo:s$ >> -> ()$s$ = $e1$ $to:b$ $e2$ do { $list:el$ } >> -> ()$list:pwel$ ] >> -> ()$e1$ then $e2$ else $e3$ >> -> ()$int:s$ >> -> ()
| <:expr< for
| <:expr< fun [
| <:expr< if
| <:expr<
(* in new version *)$i$ : $e$ >> -> ()$e$ >> -> ()
| <:expr< ~
| <:expr< lazy
| <:expr< let$rec:b$ $list:pel$ in $e$ >> -> ()$lid:s$ >> -> ()$e$ with [ $list:pwel$ ] >> -> ()$list:eel$ } >> -> ()$list:el$ } >> -> ()$e1$ .[ $e2$ ] >> -> ()$str:s$ >> -> ()$e$ with [ $list:pwel$ ] >> -> ()$list:el$ ) >> -> ()$e$ : $t$ ) >> -> ()$uid:s$ >> -> ()$e$ do { $list:el$ } >> -> ()
| <:expr<
| <:expr< match
| <:expr< {
| <:expr< do {
| <:expr<
| <:expr<
| <:expr< try
| <:expr< (
| <:expr< (
| <:expr<
| <:expr< while
(* missing
(ExVrn (_, )|ExSnd (, _, )|ExOvr (, )|ExOlb (, _, )|ExNew (, )|
ExLmd (, _, _, _))
*)
(* A.3 Quotation patt *)
let f = function$p1$ . $p2$ >> -> ()$anti:e$ >> -> ()$p1$ as $p2$ ) >> -> ()$p1$ $p2$ >> -> ()$chr:c$ >> -> ()$int:s$ >> -> ()$lid:i$ >> -> ()$p1$ | $p2$ >> -> ()$p1$ .. $p2$ >> -> ()
| <:patt<
| <:patt<
| <:patt< (
| <:patt< _ >> -> ()
| <:patt<
| <:patt<
| <:patt<
| <:patt<
| <:patt<
| <:patt<
(* | <:patt< {$ppl$ } >> -> () )
( error message
Parse error: '=' expected after [patt_label_ident] (in [label_patt])
*)
| <:patt<$str:s$ >> -> ()$list:pl$ ) >> -> ()$p$ : $t$ ) >> -> ()$uid:s$ >> -> ()
| <:patt< (
| <:patt< (
| <:patt<
(*missing
(PaVrn (_, )|PaTyp (, )|PaRec (, )|PaOlb (, _, _, )|PaLab (, _, )|
PaFlo (, )|PaArr (, _))
*)
(* A.5 Quotation ctyp *)
let f = function$t1$ . $t2$ >> -> ()$t1$ as $t2$ >> -> ()$t1$ $t2$ >> -> ()$t1$ -> $t2$ >> -> ()$list:sl$ >> -> ()$s$ : $t$ >> -> ()$lid:s$ >> -> ()$t1$ == $t2$ >> -> ()$list:fl$ > >> -> ()$s$ : $t$ >> -> ()
| <:ctyp<
| <:ctyp<
| <:ctyp< _ >> -> ()
| <:ctyp<
| <:ctyp<
| <:ctyp< #
| <:ctyp< ~
| <:ctyp<
| <:ctyp<
| <:ctyp< <
| <:ctyp< ?
(* was$list:sl$ : $t$ >> -> ()
| <:ctyp< !
but fixed in new docs *)
| <:ctyp< !$list:sl$ . $t$ >> -> ()
| <:ctyp< '$s$ >> -> ()$list:sbtl$ } >> -> ()$list:stll$ ] >> -> ()$list:tl$ ) >> -> ()$uid:s$ >> -> ()$list:rfl$ |] >> -> ()
| <:ctyp< {
| <:ctyp< [
| <:ctyp< (
| <:ctyp<
| <:ctyp< [|
(*missing
TyObj (_, _, true)
*)
(* A.6 Quotation sig_item *)
let f = function$list:sil$ end >> -> ()$s$ of $list:tl$ >> -> ()$s$ : $t$ = $list:sl$ >> -> ()$s$ : $mt$ >> -> ()$s$ = $mt$ >> -> ()$sl$ >> -> ()$list:sslt$ >> -> ()$s$ : $t$ >> -> ()
| <:sig_item< declare
| <:sig_item< exception
| <:sig_item< external
| <:sig_item< module
| <:sig_item< module type
| <:sig_item< open
| <:sig_item< type
| <:sig_item< value
(* missing
(SgInc (_, )|SgDir (, _, )|SgClt (, )|SgCls (, _))
*)
(* A.7 Quotation str_item *)
let f = function$list:stl$ end >> -> ()$s$ of $list:tl$ >> -> ()$exp:e$ >> -> ()$s$ : $t$ = $list:sl$ >> -> ()$s$ = $me$ >> -> ()$s$ = $mt$ >> -> ()$sl$ >> -> ()$list:sslt$ >> -> ()$rec:b$ $list:pel$ >> -> ()
| <:str_item< declare
| <:str_item< exception
| <:str_item<
| <:str_item< external
| <:str_item< module
| <:str_item< module type
| <:str_item< open
| <:str_item< type
| <:str_item< value
(*missing
(StInc (_, )|StDir (, _, )|StClt (, )|StCls (, _))
*)
(* A.8 Quotation module_type *)
let f = function$mt1$ . $mt2$ >> -> ()$mt1$ $mt2$ >> -> ()$s$ : $mt1$ ) -> $mt2$ >> -> ()$lid:i$ >> -> ()
| <:module_type<
| <:module_type<
| <:module_type< functor (
| <:module_type<
(* in new version *)
| <:module_type< '$i$ >> -> ()
| <:module_type< sig$list:sil$ end >> -> ()$uid:i$ >> -> ()$mt$ with $list:wcl$ >> -> ()
| <:module_type<
| <:module_type<
(* A.9 Quotation module_expr *)
let f = function$me1$ . $me2$ >> -> ()$me1$ $me2$ >> -> ()$s$ : $mt$ ) -> $me$ >> -> ()$list:stl$ end >> -> ()
| <:module_expr<
| <:module_expr<
| <:module_expr< functor (
| <:module_expr< struct
(*$me$ : $mt$ ) ] >> -> ()
| <:module_expr< (
error :
Parse error: end of input expected after [module expression] (in [module
expression])
*)
| <:module_expr<$uid:i$ >> -> ()
(*missing
MeTyc (_, _, _)
*)
(* A.10 Quotation class_expr *)
let f = function$ce$ $e$ >> -> ()$list:sl$ [ $list:tl$ ] >> -> ()$p$ -> $ce$ >> -> ()$rec:b$ $list:lb$ in $ce$ >> -> ()$p$ $list:csil$ end >> -> ()$ce$ : $ct$ ) >> -> ()
| <:class_expr<
| <:class_expr<
| <:class_expr< fun
| <:class_expr< let
| <:class_expr< object
| <:class_expr< (
(* A.11 Quotation class_type *)
let f = function$list:sl$ [ $list:tl$ ] >> -> ()$t$ ] -> $ct$ >> -> ()
| <:class_type<
| <:class_type< [
(*$s$ $list:csil$ end >> -> ()
| <:class_type< object
error:
Parse error: ';' expected after [class signature item] (in [class type])
)
( missing
CtSig (_, _, _)
*)
(* A.12 Quotation class_sig_item *)
let f = function$t1$ = $t2$ >> -> ()$list:csil$ end >> -> ()$ct$ >> -> ()$s$ : $t$ >> -> ()$s$ : $t$ >> -> ()
| <:class_sig_item< type
| <:class_sig_item< declare
| <:class_sig_item< inherit
| <:class_sig_item< method
| <:class_sig_item< method private
(*$mut:m$ $s$ = $t$ >> -> ()
| <:class_sig_item< value
error
Parse error: ':' expected after [label] (in [class signature item])
should be$mut:m$ $s$ : $t$ >> -> ()
*)
| <:class_sig_item< value
| <:class_sig_item< method virtual$s$ : $t$ >> -> ()$s$ : $t$ >> -> ()
| <:class_sig_item< method virtual private
(* A.13 Quotation class_str_item *)
let f = function$list:csil$ end >> -> ()$t1$ = $t2$ >> -> ()$ct$ >> -> ()$e$ >> -> ()
| <:class_str_item< declare
| <:class_str_item< type
| <:class_str_item< inherit
| <:class_str_item< initializer
(*$s$ : $t$ >> -> ()
| <:class_str_item< method
error
Parse error: '=' expected after [type] (in [class structure item])
*)
(*$s$ : $t$ >> -> ()
| <:class_str_item< method private
error
Parse error: '=' expected after [type] (in [class structure item])
*)
| <:class_str_item< method virtual$s$ : $t$ >> -> ()$s$ : $t$ >> -> ()$mut:m$ $s$ = $t$ >> -> ()
| <:class_str_item< method virtual private
| <:class_str_item< value
(*missing
CrMth (_, _, _, _, _)
*)
(* missing types
and row_field =
and with_constr =
*)
(*** Local Variables: )
( version-control: t )
( kept-new-versions: 5 )
( compile-command: "ocamlc -pp "camlp4o q_MLast.cmo" -c -I "
camlp4 -where
" quotation_test.ml" )( delete-old-versions: t )
( End: ***)
The text was updated successfully, but these errors were encountered: