From b798ac29c37299b2f761243ae92ab8f7c4c4d7f1 Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Tue, 30 Oct 2018 15:32:56 +0100 Subject: Initial commit --- source/xi_lib/parser_utils.ml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 source/xi_lib/parser_utils.ml (limited to 'source/xi_lib/parser_utils.ml') diff --git a/source/xi_lib/parser_utils.ml b/source/xi_lib/parser_utils.ml new file mode 100644 index 0000000..0600d8b --- /dev/null +++ b/source/xi_lib/parser_utils.ml @@ -0,0 +1,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} \ No newline at end of file -- cgit 1.4.1