OpamParser.FullPosOpamParser transitional module with full position types
Providing a custom lexbuf argument allows you, for example, to set the initial lexing position. For the first argument, you may use the OpamLexer.token lexing function:
let lexbuf = Lexing.from_string input in
lexbuf.Lexing.lex_curr_p <- current_position;
OpamParser.value OpamLexer.token lexbufval main : (Lexing.lexbuf -> OpamBaseParser.token) -> Lexing.lexbuf -> OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.opamfilePrincipal parser: given a lexbuf and the filename it was read from, returns an OpamParserTypes.FullPos.opamfile record parsed from it.
val value : (Lexing.lexbuf -> OpamBaseParser.token) -> Lexing.lexbuf -> OpamParserTypes.FullPos.valueLower-level function just returning a single OpamParserTypes.FullPos.value from a given lexer.
val string : string -> OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.opamfileParse the content of a file already read to a string. Note that for CRLF-detection to work on Windows, it is necessary to read the original file using binary mode on Windows!
val channel : in_channel -> OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.opamfileParse the content of a file from an already-opened channel. Note that for CRLF-detection to work on Windows, it is necessary for the channel to be in binary mode!
Parse the content of a file. The file is opened in binary mode, so CRLF-detection works on all platforms.
value parsersval value_from_string : string -> OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.valueParse the first value in the given string. file_name is used for lexer positions.
val value_from_channel : in_channel -> OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.valueParse the first value from the given channel. file_name is used for lexer positions.
val value_from_file : OpamParserTypes.FullPos.file_name -> OpamParserTypes.FullPos.valueParse the first value from the given file.
val to_value : OpamParserTypes.FullPos.value -> OpamParserTypes.valueval to_section : OpamParserTypes.FullPos.opamfile_section -> OpamParserTypes.opamfile_sectionval to_item : OpamParserTypes.FullPos.opamfile_item -> OpamParserTypes.opamfile_itemval to_opamfile : OpamParserTypes.FullPos.opamfile -> OpamParserTypes.opamfile