Commit 53a4ae1c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-11-25 16:10:56 by cvscast] Empty log message

Original author: cvscast
Date: 2002-11-25 16:11:30+00:00
parent 40b9f4e3
...@@ -35,6 +35,12 @@ classes ...@@ -35,6 +35,12 @@ classes
let c = int_of_string s in let c = int_of_string s in
assert ( c < 256 ); (* TODO: handle Unicode *) assert ( c < 256 ); (* TODO: handle Unicode *)
Char.chr c Char.chr c
let rec tag_of_tag s i =
match s.[i] with
| '\008' | '\009' | '\010' | '\013' | '\032' -> tag_of_tag s (i+1)
| _ -> String.sub s i (String.length s - i)
} }
...@@ -48,9 +54,9 @@ rule token = parse ...@@ -48,9 +54,9 @@ rule token = parse
} }
| uppercase identchar* ( ':' identchar+)* { "UIDENT",Lexing.lexeme lexbuf } | uppercase identchar* ( ':' identchar+)* { "UIDENT",Lexing.lexeme lexbuf }
| ascii_digit+ { "INT",Lexing.lexeme lexbuf } | ascii_digit+ { "INT",Lexing.lexeme lexbuf }
| "<" (lowercase | uppercase) identchar* { | "<" blank* (lowercase | uppercase) identchar* {
let s = Lexing.lexeme lexbuf in let s = Lexing.lexeme lexbuf in
"TAG", String.sub s 1 (String.length s - 1) "TAG", tag_of_tag s 1
} }
| [ "<>=.,:;+-*/@&{}[]()|?`!" ] | [ "<>=.,:;+-*/@&{}[]()|?`!" ]
| "->" | "::" | ";;" | "--" | ":=" | "\\" | "->" | "::" | ";;" | "--" | ":=" | "\\"
......
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