pub struct Semantic {
pub symtab: Vec<(u32, SymbolData)>,
pub typetab: Vec<(u32, TypeData)>,
pub sym2type: Vec<(u32, u32)>,
pub node2sym: Vec<(NodeReference, u32)>,
pub node2type: Vec<(NodeReference, u32)>,
pub type_extra: TypeExtra,
pub primtypes: PrimTypes,
pub alias_symbols: Vec<(u32, u32)>,
pub shorthand_symbols: Vec<(NodeReference, u32)>,
}Fields§
§symtab: Vec<(u32, SymbolData)>§typetab: Vec<(u32, TypeData)>§sym2type: Vec<(u32, u32)>§node2sym: Vec<(NodeReference, u32)>§node2type: Vec<(NodeReference, u32)>§type_extra: TypeExtra§primtypes: PrimTypes§alias_symbols: Vec<(u32, u32)>§shorthand_symbols: Vec<(NodeReference, u32)>Implementations§
Source§impl Semantic
impl Semantic
Sourcepub fn get_shorthand_assignment_value_symbol(
&self,
location: &NodeReference,
) -> Option<u32>
pub fn get_shorthand_assignment_value_symbol( &self, location: &NodeReference, ) -> Option<u32>
Returns the value (local variable) symbol of an identifier in the shorthand property assignment.
This is necessary as an identifier in shorthand property assignment contains two meanings:
property name and property value. For example, in { x }, x is both the property name
and references the variable value.
§Arguments
location- The node reference to query
§Returns
Some(u32)- The symbol ID if found and has Value or Alias flagsNone- If no symbol is found or the symbol doesn’t have the required flags
§Reference
TypeScript implementation: https://github.com/microsoft/TypeScript/blob/9e8eaa1746b0d09c3cd29048126ef9cf24f29c03/src/compiler/checker.ts
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Semantic
impl<'de> Deserialize<'de> for Semantic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Semantic
impl RefUnwindSafe for Semantic
impl Send for Semantic
impl Sync for Semantic
impl Unpin for Semantic
impl UnwindSafe for Semantic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more