summary refs log tree commit diff
path: root/source/xi_lib/parser_utils.ml
blob: 0600d8b786a26a682130c4c15a34d45a3d9465c9 (plain) (blame)
1
2
3
4
5
6
7
exception InvalidToken of Ast.location * string

let mkLocation pos = 
    let line   = pos.Lexing.pos_lnum in
    let column = pos.Lexing.pos_cnum - pos.Lexing.pos_bol + 1 in
    let file   = pos.Lexing.pos_fname in
    Ast.Location {line; column; file}