Commit 62a4a52a authored by Andrei Paskevich's avatar Andrei Paskevich

Lexer: [# "fname" line bcol ecol ] and [## "fname" line col] for location tags

This makes it more consistent with the [@...] syntax for generic tags.
parent 3b710a36
......@@ -132,13 +132,13 @@ let op_char_1234 = op_char_1 | op_char_234
let op_char_pref = ['!' '?']
rule token = parse
| "##" space* ("\"" ([^ '\010' '\013' '"' ]* as file) "\"")?
space* (dec+ as line) space* (dec+ as char) space* "##"
| "[##" space* ("\"" ([^ '\010' '\013' '"' ]* as file) "\"")?
space* (dec+ as line) space* (dec+ as char) space* "]"
{ Lexlib.update_loc lexbuf file (int_of_string line) (int_of_string char);
token lexbuf }
| "#" space* "\"" ([^ '\010' '\013' '"' ]* as file) "\""
| "[#" space* "\"" ([^ '\010' '\013' '"' ]* as file) "\""
space* (dec+ as line) space* (dec+ as bchar) space*
(dec+ as echar) space* "#"
(dec+ as echar) space* "]"
{ POSITION (Loc.user_position file (int_of_string line)
(int_of_string bchar) (int_of_string echar)) }
| "[@" space* ([^ ' ' '\n' ']']+ (' '+ [^ ' ' '\n' ']']+)* as lbl) space* ']'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment