Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
infosec-ecomp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Putegnat Theo
infosec-ecomp
Commits
0b180ec2
Commit
0b180ec2
authored
2 years ago
by
Putegnat Theo
Browse files
Options
Downloads
Patches
Plain Diff
lexeur fonctionne sauf pour des commentaires
parent
4b71c93d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/e_regexp.ml
+1
-1
1 addition, 1 deletion
src/e_regexp.ml
src/lexer_generator.ml
+4
-2
4 additions, 2 deletions
src/lexer_generator.ml
with
5 additions
and
3 deletions
src/e_regexp.ml
+
1
−
1
View file @
0b180ec2
...
...
@@ -97,7 +97,7 @@ let list_regexp : (regexp * (string -> token option)) list =
(
keyword_regexp
">"
,
fun
_
->
Some
(
SYM_GT
));
(
keyword_regexp
"<="
,
fun
_
->
Some
(
SYM_LEQ
));
(
keyword_regexp
">="
,
fun
_
->
Some
(
SYM_GEQ
));
(
Cat
(
digit_regexp
,
plus
(
identifier_material
)
)
,
fun
s
->
Some
(
SYM_IDENTIFIER
s
));
(
plus
(
identifier_material
)
,
fun
s
->
Some
(
SYM_IDENTIFIER
s
));
(* end TODO *)
(
Cat
(
keyword_regexp
"//"
,
Cat
(
Star
(
char_range
(
List
.
filter
(
fun
c
->
c
<>
'\n'
)
alphabet
))
,
...
...
This diff is collapsed.
Click to expand it.
src/lexer_generator.ml
+
4
−
2
View file @
0b180ec2
...
...
@@ -390,8 +390,10 @@ let tokenize_one (d : dfa) (w: char list) : lexer_result * char list =
|
Some
qnext
->
match
List
.
assoc_opt
qnext
d
.
dfa_final
with
|
None
->
recognize
qnext
r
(
current_token
@
[
c
])
last_accepted
|
Some
t
->
recognize
qnext
r
(
current_token
@
[
c
])
(
LRtoken
(
Option
.
get
(
t
(
string_of_char_list
(
current_token
@
[
c
]))))
,
r
)
|
Some
t
->
match
t
(
string_of_char_list
(
current_token
@
[
c
]))
with
|
None
->
recognize
qnext
r
(
current_token
@
[
c
])
(
LRskip
,
r
)
|
Some
token
->
recognize
qnext
r
(
current_token
@
[
c
])
(
LRtoken
token
,
r
)
in
recognize
d
.
dfa_initial
w
[]
(
LRerror
,
w
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment