feat: Add comments to AST nodes
This commit introduces support for comments within the AST nodes. Comments are now parsed by the lexer and stored within the `Token` struct. These comments are then propagated through various compiler phases, including the `Node` struct, ensuring they are preserved in the Abstract Syntax Tree. This change enhances the AST's ability to retain source code information, which can be valuable for debugging and analysis.
This commit is contained in:
@@ -298,6 +298,7 @@ impl<'a> Analyzer<'a> {
|
||||
Node {
|
||||
identity: node.identity.clone(),
|
||||
kind: new_kind,
|
||||
comments: node.comments.clone(),
|
||||
ty: NodeMetrics {
|
||||
original: node_rc,
|
||||
purity,
|
||||
|
||||
Reference in New Issue
Block a user