let name_of_line ?(pos=Pos.unknown) line =
let line = (line : Line.t :> string) in
let n = String.length line in
if n = 0 || line.[0] <> '@' then
error
"invalid name"
(pos, line)
<:sexp_of< Pos.t * string >>
else
Ok (String.sub line ~pos:1 ~len:(n-1))