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
4c067dcc
Commit
4c067dcc
authored
Jun 26, 2014
by
Julien Lopez
Browse files
Fix in lexer
parent
17b988b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser/ulexer.ml
View file @
4c067dcc
...
...
@@ -223,10 +223,14 @@ let rec token = lexer
let
s
=
get_stored_string
()
in
return_loc
start
(
L
.
lexeme_end
lexbuf
)
(
STRING
s
)
|
"'"
"
\\
"
?
_
"'"
->
let
s
=
L
.
utf8_lexeme
lexbuf
in
let
s
=
String
.
make
1
(
s
.
[
String
.
length
s
-
2
])
in
return
lexbuf
(
CHAR
s
)
|
"'"
qname
->
L
.
rollback
lexbuf
;
(
fun
_
->
lexer
|
"'"
->
let
start
=
L
.
lexeme_start
lexbuf
in
string
(
L
.
lexeme_start
lexbuf
)
'\''
lexbuf
;
let
s
=
get_stored_string
()
in
return_loc
start
(
L
.
lexeme_end
lexbuf
)
(
CHAR
s
)
|
_
->
assert
false
)
()
lexbuf
|
"'"
ncname
->
let
s
=
L
.
utf8_lexeme
lexbuf
in
let
s
=
String
.
sub
s
1
(
String
.
length
s
-
1
)
in
return
lexbuf
(
PTYPE
s
)
...
...
@@ -273,11 +277,14 @@ and token2 = lexer
let
s
=
get_stored_string
()
in
return_loc
start
(
L
.
lexeme_end
lexbuf
)
(
STRING
s
)
|
"'"
[
^
'\''
]
+
"'"
->
let
s
=
L
.
utf8_lexeme
lexbuf
in
let
s
=
String
.
sub
s
1
(
String
.
length
s
-
2
)
in
let
s
=
unescape
s
(
L
.
lexeme_start
lexbuf
)
in
return
lexbuf
(
STRING2
s
)
|
"('"
qname
")"
->
L
.
rollback
lexbuf
;
(
fun
_
->
lexer
|
"'"
->
let
start
=
L
.
lexeme_start
lexbuf
in
string
(
L
.
lexeme_start
lexbuf
)
'\''
lexbuf
;
let
s
=
get_stored_string
()
in
return_loc
start
(
L
.
lexeme_end
lexbuf
)
(
STRING2
s
)
|
_
->
assert
false
)
()
lexbuf
|
"('"
ncname
")"
->
let
s
=
L
.
utf8_lexeme
lexbuf
in
let
s
=
String
.
sub
s
2
(
String
.
length
s
-
3
)
in
return
lexbuf
(
PTYPE
s
)
...
...
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