Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
b5c29546
Commit
b5c29546
authored
Aug 25, 2014
by
Pietro Abate
Browse files
Merge branch 'master' of
https://git.cduce.org/cduce
parents
70b9b43b
09de9094
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser/ulexer.ml
View file @
b5c29546
...
...
@@ -186,6 +186,8 @@ let regexp qname = (ncname ':')? ncname
(* Should be [^ xml_letter ] *)
let
regexp
not_xml_letter
=
[
^
'
A'
-
'
Z'
'
a'
-
'
z'
'
0
'
-
'
9
'
'
_'
]
let
regexp
character
=
_
|
'\\'
[
'\\'
'
"' '
\'
'] | "
\\
n
" | "
\\
t
" | "
\\
r
"
| '
\\
' 'x' ['0'-'9' 'a'-'f' 'A'-'F']+ ';' | '
\\
' ['0'-'9']+ ';'
let illegal lexbuf =
error
...
...
@@ -226,7 +228,7 @@ let rec token = lexer
string
(
L
.
lexeme_start
lexbuf
)
'
"' lexbuf;
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s)
|
"'"
"
\\
"
?
_
"'"
->
| "
'
"
character
"
'
" ->
L.rollback lexbuf;
(fun _ -> lexer
| "
'
" -> let start = L.lexeme_start lexbuf in
...
...
@@ -280,7 +282,7 @@ and token2 = lexer
string (L.lexeme_start lexbuf) '"' lexbuf;
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s)
|
"'"
"
\\
"
?
_
"'--'"
"
\\
"
?
_
"'"
| "'"
character "'--'" character
"'"
| "'" [^ '\'']+ "'" not_xml_letter ->
L.rollback lexbuf;
(fun _ -> lexer
...
...
@@ -345,7 +347,7 @@ and token2toplevel = lexer
string (L.lexeme_start lexbuf) '"' lexbuf;
let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s)
|
"'"
"
\\
"
?
_
"'--'"
"
\\
"
?
_
"'"
| "'"
character "'--'" character
"'"
| "'" ((";"[^ ";'"]) | [^ ";'"])* ";"? "'" not_xml_letter ->
L.rollback lexbuf;
(fun _ -> lexer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment