Skip to content

Commit 8165b04

Browse files
committed
chore: remove dead code
1 parent 3d032bc commit 8165b04

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

glslt/src/transform/min_unit/dependency_dag.rs

-57
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,6 @@
11
use glsl_lang::ast::SmolStr;
22
use petgraph::graph::NodeIndex;
33

4-
#[derive(Clone, Copy)]
5-
enum ExtractIdentState {
6-
Init,
7-
Ident { start_position: usize },
8-
}
9-
10-
pub struct ExtractIdents<'i> {
11-
input: &'i str,
12-
current_position: usize,
13-
state: ExtractIdentState,
14-
}
15-
16-
impl<'i> Iterator for ExtractIdents<'i> {
17-
type Item = &'i str;
18-
19-
fn next(&mut self) -> Option<Self::Item> {
20-
// The rest of the string that wasn't parsed yet
21-
let remaining = &self.input[self.current_position..];
22-
23-
let mut last_index = self.current_position;
24-
25-
for (i, ch) in remaining.char_indices() {
26-
self.current_position = i;
27-
28-
match self.state {
29-
ExtractIdentState::Init => {
30-
// Initial state, look for a valid char
31-
if ch == '_' || ch.is_ascii_lowercase() || ch.is_ascii_uppercase() {
32-
self.state = ExtractIdentState::Ident { start_position: i };
33-
}
34-
}
35-
ExtractIdentState::Ident { start_position } => {
36-
// First char seen, look for following chars
37-
if ch == '_'
38-
|| ch.is_ascii_lowercase()
39-
|| ch.is_ascii_uppercase()
40-
|| ch.is_ascii_digit()
41-
{
42-
// Stay in the current state
43-
self.state = ExtractIdentState::Ident { start_position };
44-
} else {
45-
// Not an ident, reset state
46-
self.state = ExtractIdentState::Init;
47-
48-
// Return ident slice
49-
return Some(&self.input[start_position..=last_index]);
50-
}
51-
}
52-
}
53-
54-
last_index = i;
55-
}
56-
57-
None
58-
}
59-
}
60-
614
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
625
pub enum ExternalIdentifier {
636
/// Function definition

0 commit comments

Comments
 (0)