Skip to content

Commit f78373b

Browse files
committed
remove remnants of punctuation tokens
1 parent 40db345 commit f78373b

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/scope_name.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// TODO: punctuation components
2-
#![allow(dead_code)]
3-
41
use std::collections::VecDeque;
52
use std::fmt::Display;
63
use std::ops::Range;
@@ -9,9 +6,6 @@ use swc_ecma_visit::swc_ecma_ast as ast;
96

107
use crate::swc::convert_span;
118

12-
#[derive(Debug)]
13-
pub(crate) struct SyntaxToken;
14-
159
/// An abstract scope name which can consist of multiple [`NameComponent`]s.
1610
#[derive(Debug)]
1711
pub struct ScopeName {
@@ -52,7 +46,6 @@ impl NameComponent {
5246
match &self.inner {
5347
NameComponentInner::Interpolation(s) => s,
5448
NameComponentInner::SourceIdentifierToken(t) => &t.sym,
55-
NameComponentInner::SourcePunctuationToken(_) => "",
5649
}
5750
}
5851

@@ -63,10 +56,6 @@ impl NameComponent {
6356
pub fn range(&self) -> Option<Range<u32>> {
6457
match &self.inner {
6558
NameComponentInner::SourceIdentifierToken(t) => Some(convert_span(t.span)),
66-
NameComponentInner::SourcePunctuationToken(_t) => {
67-
None
68-
//Some(convert_text_range(t.text_range()))
69-
}
7059
_ => None,
7160
}
7261
}
@@ -81,16 +70,10 @@ impl NameComponent {
8170
inner: NameComponentInner::SourceIdentifierToken(ident),
8271
}
8372
}
84-
pub(crate) fn punct(token: SyntaxToken) -> Self {
85-
Self {
86-
inner: NameComponentInner::SourcePunctuationToken(token),
87-
}
88-
}
8973
}
9074

9175
#[derive(Debug)]
9276
pub(crate) enum NameComponentInner {
9377
Interpolation(&'static str),
9478
SourceIdentifierToken(ast::Ident),
95-
SourcePunctuationToken(SyntaxToken),
9679
}

src/swc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use crate::Scopes;
1111
// TODO:
1212
// - getters / setters
1313
// - maybe even computed properties?
14-
// - "punctuation" tokens that allow inferring a name from an inlined call expression
1514

1615
pub fn parse_with_swc(src: &str) -> Scopes {
1716
let syntax = tracing::trace_span!("parsing source").in_scope(|| {

0 commit comments

Comments
 (0)