Skip to content
Snippets Groups Projects
Commit a1b33d59 authored by Thibault Martin's avatar Thibault Martin Committed by Allan Blanchard
Browse files

Add regexp variable for identifiers

parent c46c5a73
No related branches found
No related tags found
No related merge requests found
...@@ -350,6 +350,7 @@ let rP = ['P''p']['+''-']? rD+ ...@@ -350,6 +350,7 @@ let rP = ['P''p']['+''-']? rD+
let rFS = ('f'|'F'|'l'|'L'|'d'|'D') let rFS = ('f'|'F'|'l'|'L'|'d'|'D')
let rIS = ('u'|'U'|'l'|'L')* let rIS = ('u'|'U'|'l'|'L')*
let comment_line = "//" [^'\n']* let comment_line = "//" [^'\n']*
let rIdentifier = rL (rL | rD)*
(* Do not forget to update also the corresponding chr rule if you add (* Do not forget to update also the corresponding chr rule if you add
a supported escape sequence here. *) a supported escape sequence here. *)
...@@ -372,14 +373,14 @@ rule token = parse ...@@ -372,14 +373,14 @@ rule token = parse
then comment lexbuf then comment lexbuf
else lex_error lexbuf "unexpected block-comment opening" else lex_error lexbuf "unexpected block-comment opening"
} }
| '\\' ((rL (rL | rD)*) as plugin) "::" ((rL (rL | rD)*) as name) { | '\\' (rIdentifier as plugin) "::" (rIdentifier as name) {
let loc = Lexing.(lexeme_start_p lexbuf, lexeme_end_p lexbuf) in let loc = Lexing.(lexeme_start_p lexbuf, lexeme_end_p lexbuf) in
let cabsloc = Cil_datatype.Location.of_lexing_loc loc in let cabsloc = Cil_datatype.Location.of_lexing_loc loc in
let tok = identifier name cabsloc in let tok = identifier name cabsloc in
check_ext_plugin (fst cabsloc) plugin tok check_ext_plugin (fst cabsloc) plugin tok
} }
| '\\' rL (rL | rD)* { bs_identifier lexbuf } | '\\' rIdentifier { bs_identifier lexbuf }
| rL (rL | rD)* { | rIdentifier {
let loc = Lexing.(lexeme_start_p lexbuf, lexeme_end_p lexbuf) in let loc = Lexing.(lexeme_start_p lexbuf, lexeme_end_p lexbuf) in
let cabsloc = Cil_datatype.Location.of_lexing_loc loc in let cabsloc = Cil_datatype.Location.of_lexing_loc loc in
let s = lexeme lexbuf in let s = lexeme lexbuf in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment