Compare commits
No commits in common. "1f977d5913aca473dd585e1c66e7dbb05c47637f" and "4243a5d48240ca1dd1c94e784ab2795702a6ccb3" have entirely different histories.
1f977d5913
...
4243a5d482
|
@ -23,26 +23,3 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo test --lib
|
cargo test --lib
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
clippy:
|
|
||||||
runso-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- id: checkout
|
|
||||||
name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- id: setup-rust
|
|
||||||
name: setup rust
|
|
||||||
uses: https://github.com/ningenMe/setup-rustup@v1.1.0
|
|
||||||
with:
|
|
||||||
rust-version: nightly
|
|
||||||
- id: cargo-clippy
|
|
||||||
name: cargo clippy
|
|
||||||
run: |
|
|
||||||
cargo clippy --fix --lib -p glsl-lexer
|
|
||||||
shell: bash
|
|
||||||
- id: commit
|
|
||||||
name: commit
|
|
||||||
uses: https://github.com/EndBug/add-and-commit@v9
|
|
||||||
with:
|
|
||||||
author_name: [Clippy]
|
|
||||||
|
|
||||||
|
|
|
@ -81,11 +81,11 @@
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-8wkkYGr1dPSnX9oVMX8D6dTOROXKOYpBTKfriA0sEBI=",
|
"narHash": "sha256-8wkkYGr1dPSnX9oVMX8D6dTOROXKOYpBTKfriA0sEBI=",
|
||||||
"path": "/nix/store/wdwf2qq1sqhs0nig8rffrq5dbpwr27v6-source/flake.systems.nix",
|
"path": "/nix/store/7v3i06afpf7zfq4cwingjhfhmbc6vbqi-source/flake.systems.nix",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/wdwf2qq1sqhs0nig8rffrq5dbpwr27v6-source/flake.systems.nix",
|
"path": "/nix/store/7v3i06afpf7zfq4cwingjhfhmbc6vbqi-source/flake.systems.nix",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
];
|
];
|
||||||
rust-toolchain = pkgs.symlinkJoin {
|
rust-toolchain = pkgs.symlinkJoin {
|
||||||
name = "rust-toolchain";
|
name = "rust-toolchain";
|
||||||
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.clippy pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
|
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,10 +37,10 @@ impl crate::Lexer {
|
||||||
let mut is_swizzle = false;
|
let mut is_swizzle = false;
|
||||||
|
|
||||||
while let Some(c) = self.current_char {
|
while let Some(c) = self.current_char {
|
||||||
if c.is_ascii_digit() {
|
if c.is_digit(10) {
|
||||||
number.push(c);
|
number.push(c);
|
||||||
self.advance();
|
self.advance();
|
||||||
} else if c == '.' && self.peek().map_or(false, |c| c.is_ascii_digit())
|
} else if c == '.' && self.peek().map_or(false, |c| c.is_digit(10))
|
||||||
|| self.peek() == Some('f')
|
|| self.peek() == Some('f')
|
||||||
{
|
{
|
||||||
if number.is_empty() {
|
if number.is_empty() {
|
||||||
|
|
|
@ -105,7 +105,7 @@ impl Lexer {
|
||||||
tokens.push(Token::Whitespace);
|
tokens.push(Token::Whitespace);
|
||||||
} else if c.is_alphabetic() || c == '_' {
|
} else if c.is_alphabetic() || c == '_' {
|
||||||
tokens.push(self.consume_identifier_or_keyword());
|
tokens.push(self.consume_identifier_or_keyword());
|
||||||
} else if c.is_ascii_digit() {
|
} else if c.is_digit(10) {
|
||||||
tokens.push(self.consume_number());
|
tokens.push(self.consume_number());
|
||||||
} else if c == '/' && self.peek() == Some('/') {
|
} else if c == '/' && self.peek() == Some('/') {
|
||||||
tokens.push(self.consume_comment());
|
tokens.push(self.consume_comment());
|
||||||
|
|
Loading…
Reference in a new issue