Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
desolation
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Owen Hayes
desolation
Commits
0f8f1650
Commit
0f8f1650
authored
2 years ago
by
MarvelousAnything
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some clippy issues.
parent
d31d3265
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/lex/lexer.rs
+9
-3
9 additions, 3 deletions
src/lex/lexer.rs
src/lex/token.rs
+3
-6
3 additions, 6 deletions
src/lex/token.rs
src/lex/types.rs
+3
-3
3 additions, 3 deletions
src/lex/types.rs
src/parser/mod.rs
+1
-1
1 addition, 1 deletion
src/parser/mod.rs
with
16 additions
and
13 deletions
src/lex/lexer.rs
+
9
−
3
View file @
0f8f1650
...
...
@@ -344,7 +344,7 @@ impl Lexer {
"Collected integer: {} at {}:{}[{}] to {}:{}[{}]"
,
integer
,
start
.1
,
start
.2
,
start
.0
,
self
.line_no
,
self
.col_no
,
self
.index
);
TokenType
::
Literal
(
LiteralToken
::
Integer
Literal
(
integer
))
TokenType
::
Literal
(
LiteralToken
::
Integer
(
integer
))
}
'"'
=>
{
self
.advance
()
?
;
...
...
@@ -353,7 +353,7 @@ impl Lexer {
"Collected string:
\"
{}
\"
at {}:{}[{}] to {}:{}[{}]"
,
string
,
start
.1
,
start
.2
,
start
.0
,
self
.line_no
,
self
.col_no
,
self
.index
);
TokenType
::
Literal
(
LiteralToken
::
String
Literal
(
string
))
TokenType
::
Literal
(
LiteralToken
::
String
(
string
))
}
'\''
=>
{
self
.advance
()
?
;
...
...
@@ -366,7 +366,7 @@ impl Lexer {
"Collected character literal: {:?} at {}:{}[{}] to {}:{}[{}]"
,
character
,
start
.1
,
start
.2
,
start
.0
,
self
.line_no
,
self
.col_no
,
self
.index
);
TokenType
::
Literal
(
LiteralToken
::
Character
Literal
(
character
))
TokenType
::
Literal
(
LiteralToken
::
Character
(
character
))
}
'#'
=>
{
debug!
(
...
...
@@ -382,3 +382,9 @@ impl Lexer {
Ok
(
token
)
}
}
impl
Default
for
Lexer
{
fn
default
()
->
Self
{
Self
::
new
()
}
}
This diff is collapsed.
Click to expand it.
src/lex/token.rs
+
3
−
6
View file @
0f8f1650
...
...
@@ -52,21 +52,18 @@ impl Token {
pub
fn
is_integer_literal
(
&
self
)
->
bool
{
matches!
(
self
.token_type
,
TokenType
::
Literal
(
LiteralToken
::
Integer
Literal
(
_
))
TokenType
::
Literal
(
LiteralToken
::
Integer
(
_
))
)
}
pub
fn
is_string_literal
(
&
self
)
->
bool
{
matches!
(
self
.token_type
,
TokenType
::
Literal
(
LiteralToken
::
StringLiteral
(
_
))
)
matches!
(
self
.token_type
,
TokenType
::
Literal
(
LiteralToken
::
String
(
_
)))
}
pub
fn
is_character_literal
(
&
self
)
->
bool
{
matches!
(
self
.token_type
,
TokenType
::
Literal
(
LiteralToken
::
Character
Literal
(
_
))
TokenType
::
Literal
(
LiteralToken
::
Character
(
_
))
)
}
...
...
This diff is collapsed.
Click to expand it.
src/lex/types.rs
+
3
−
3
View file @
0f8f1650
...
...
@@ -81,7 +81,7 @@ impl SyntaxToken {
#[derive(Debug,
Eq,
PartialEq,
Clone)]
pub
enum
LiteralToken
{
Character
Literal
(
char
),
Integer
Literal
(
i64
),
String
Literal
(
String
),
Character
(
char
),
Integer
(
i64
),
String
(
String
),
}
This diff is collapsed.
Click to expand it.
src/parser/mod.rs
+
1
−
1
View file @
0f8f1650
...
...
@@ -6,7 +6,7 @@ pub struct Parser {
impl
Parser
{
// This should parse a token stream into an AST.
pub
fn
parse
(
tokens
:
TokenStream
)
{
pub
fn
parse
(
_
tokens
:
TokenStream
)
{
todo!
(
"Implement parser"
);
}
}
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