Finish implementation of typescript generator.
The implementation is still untested and will have issues
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
error::Error,
|
||||
fmt::Display,
|
||||
fmt::{Debug, Display},
|
||||
hash::{Hash, Hasher},
|
||||
};
|
||||
|
||||
@ -13,8 +13,9 @@ use crate::parser::{
|
||||
|
||||
static BUILT_INS: [&str; 6] = ["int", "float", "string", "boolean", "bytes", "void"];
|
||||
|
||||
pub trait Definition {
|
||||
pub trait Definition: Debug {
|
||||
fn get_position(&self) -> ParserPosition;
|
||||
fn get_name(&self) -> String;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -186,6 +187,9 @@ impl Definition for TypeDefinition {
|
||||
fn get_position(&self) -> ParserPosition {
|
||||
self.position.clone()
|
||||
}
|
||||
fn get_name(&self) -> String {
|
||||
self.name.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -205,6 +209,9 @@ impl Definition for EnumDefinition {
|
||||
fn get_position(&self) -> ParserPosition {
|
||||
self.position.clone()
|
||||
}
|
||||
fn get_name(&self) -> String {
|
||||
self.name.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -225,6 +232,9 @@ impl Definition for ServiceDefinition {
|
||||
fn get_position(&self) -> ParserPosition {
|
||||
self.position.clone()
|
||||
}
|
||||
fn get_name(&self) -> String {
|
||||
self.name.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
Reference in New Issue
Block a user