Module Dune_lang.CstSource

Concrete syntax tree

Sourcemodule Comment = Lexer.Token.Comment
Sourcetype t =
  1. | Atom of Stdune.Loc.t * Atom.t
  2. | Quoted_string of Stdune.Loc.t * string
  3. | Template of Template.t
  4. | List of Stdune.Loc.t * t list
  5. | Comment of Stdune.Loc.t * Comment.t
Sourceval loc : t -> Stdune.Loc.t
Sourceval fetch_legacy_comments : t -> file_contents:string -> t

Replace all the Comment Legacy by Comment (Lines _) by extracting the contents of comments from the original file.

Sourceval abstract : t -> Ast.t option
Sourceval concrete : Ast.t -> t
Sourceval to_dyn : t -> Stdune.Dyn.t
Sourceval to_sexp : t -> Dune_lang__.T.t option
Sourceval extract_comments : t list -> (Stdune.Loc.t * Comment.t) list

Return all the comments contained in a concrete syntax tree

Sourceval tokenize : t list -> (Stdune.Loc.t * Lexer.Token.t) list