0
votes

I'm looking into an OCaml file and I suspect it should be a polymorphic variable type (I don't know OCaml, so maybe very off):

type loc = Loc.t
   and meta_bool =
    [ BTrue
    | BFalse
    | BAnt of string ]
   and rec_flag =
    [ ReRecursive
    | ReNil
    | ReAnt of string ]

However, according to the syntax of OCaml

polymorphic-variant-type    
    ::=  [ [ | ] tag-spec  { | tag-spec } ]  
    ∣    [> [ tag-spec ]  { | tag-spec } ]  
    ∣    [< [ | ] tag-spec-full  { | tag-spec-full }  [ > { `tag-name }+ ] ] 

Inside [] if we don't use a backtick, we cannot use an uppercase identifier. tag-spec cannot be anything that starts with uppercase.

Am I looking at the correct grammar rule or there is something else going on in this file?

1

1 Answers

2
votes

In the original OCaml concrete syntax, there must be a backtick. Looks like that your example is in the OCaml revised syntax.