Skip to content

Commit 66dde6e

Browse files
committed
some sig stuff
1 parent 039e3d5 commit 66dde6e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

crates/map-gen/src/yarn/map.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,43 @@ pub enum YarnParseError {
213213
ImpossibleArgument
214214
}
215215

216+
217+
218+
#[derive(Debug)]
219+
enum YarnSigType<'a> {
220+
Class(&'a str),
221+
Bool,
222+
Byte,
223+
Char,
224+
Short,
225+
Int,
226+
Long,
227+
Float,
228+
Double,
229+
Void
230+
}
231+
impl ToString for YarnSigType<'_> {
232+
fn to_string(&self) -> String {
233+
match self {
234+
YarnSigType::Class(s) => s.to_string(),
235+
YarnSigType::Bool => "bool".to_string(),
236+
YarnSigType::Byte => "u8".to_string(),
237+
YarnSigType::Char => "char".to_string(),
238+
YarnSigType::Short => "i16".to_string(),
239+
YarnSigType::Int => "i32".to_string(),
240+
YarnSigType::Long => "i64".to_string(),
241+
YarnSigType::Float => "f32".to_string(),
242+
YarnSigType::Double => "f64".to_string(),
243+
YarnSigType::Void => "()".to_string()
244+
}
245+
}
246+
}
247+
#[derive(Debug)]
248+
enum YarnSigTypes<'a> {
249+
Method(Vec<YarnSigType<'a>>,),
250+
Field(YarnSigType<'a>)
251+
}
252+
216253
impl<'a> Yarn<'a> {
217254

218255
pub fn new() -> Self {
@@ -222,6 +259,10 @@ impl<'a> Yarn<'a> {
222259
}
223260
}
224261

262+
pub fn resolve_sig(sig: &str) {
263+
264+
}
265+
225266
pub fn run_str(&mut self,s :&str) -> Result<Arc<RwLock<Class>>,YarnParseError> {
226267
let tokens = YarnTokens::lexer(&s);
227268

0 commit comments

Comments
 (0)