-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1248c34
commit 4bef7d8
Showing
90 changed files
with
8,670 additions
and
9,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
use crate::*; | ||
|
||
|
||
pub fn collect( | ||
report: &mut diagn::Report, | ||
ast: &mut asm::AstTopLevel, | ||
decls: &mut asm::ItemDecls) | ||
-> Result<(), ()> | ||
decls: &mut asm::ItemDecls, | ||
) -> Result<(), ()> | ||
{ | ||
for any_node in &mut ast.nodes | ||
{ | ||
let asm::AstAny::DirectiveBank(ref mut node) = any_node | ||
else { continue }; | ||
else | ||
{ | ||
continue; | ||
}; | ||
|
||
if node.item_ref.is_some() | ||
{ | ||
continue; | ||
} | ||
|
||
|
||
let item_ref = decls.bankdefs.get_by_name_global( | ||
report, | ||
node.name_span, | ||
&node.name)?; | ||
|
||
let item_ref = decls | ||
.bankdefs | ||
.get_by_name_global(report, node.name_span, &node.name)?; | ||
|
||
node.item_ref = Some(item_ref); | ||
} | ||
|
||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
use crate::*; | ||
|
||
|
||
pub fn collect( | ||
report: &mut diagn::Report, | ||
ast: &mut asm::AstTopLevel, | ||
decls: &mut asm::ItemDecls) | ||
-> Result<(), ()> | ||
decls: &mut asm::ItemDecls, | ||
) -> Result<(), ()> | ||
{ | ||
for any_node in &mut ast.nodes | ||
{ | ||
let asm::AstAny::DirectiveBankdef(ref mut node) = any_node | ||
else { continue }; | ||
else | ||
{ | ||
continue; | ||
}; | ||
|
||
if node.item_ref.is_some() | ||
{ | ||
continue; | ||
} | ||
|
||
|
||
let item_ref = decls.bankdefs.declare( | ||
report, | ||
node.name_span, | ||
&util::SymbolContext::new_global(), | ||
node.name.clone(), | ||
0, | ||
util::SymbolKind::Other)?; | ||
|
||
util::SymbolKind::Other, | ||
)?; | ||
|
||
node.item_ref = Some(item_ref); | ||
} | ||
|
||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
use crate::*; | ||
|
||
|
||
pub fn collect( | ||
report: &mut diagn::Report, | ||
ast: &mut asm::AstTopLevel, | ||
decls: &mut asm::ItemDecls) | ||
-> Result<(), ()> | ||
decls: &mut asm::ItemDecls, | ||
) -> Result<(), ()> | ||
{ | ||
for any_node in &mut ast.nodes | ||
{ | ||
let asm::AstAny::DirectiveFn(ref mut node) = any_node | ||
else { continue }; | ||
else | ||
{ | ||
continue; | ||
}; | ||
|
||
if node.item_ref.is_some() | ||
{ | ||
continue; | ||
} | ||
|
||
|
||
let item_ref = decls.symbols.declare( | ||
report, | ||
node.name_span, | ||
&util::SymbolContext::new_global(), | ||
node.name.clone(), | ||
0, | ||
util::SymbolKind::Function)?; | ||
|
||
util::SymbolKind::Function, | ||
)?; | ||
|
||
node.item_ref = Some(item_ref); | ||
} | ||
|
||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
use crate::*; | ||
|
||
|
||
pub fn collect( | ||
report: &mut diagn::Report, | ||
ast: &mut asm::AstTopLevel, | ||
decls: &mut asm::ItemDecls) | ||
-> Result<(), ()> | ||
decls: &mut asm::ItemDecls, | ||
) -> Result<(), ()> | ||
{ | ||
for any_node in &mut ast.nodes | ||
{ | ||
let asm::AstAny::DirectiveRuledef(ref mut node) = any_node | ||
else { continue }; | ||
else | ||
{ | ||
continue; | ||
}; | ||
|
||
if node.item_ref.is_some() | ||
{ | ||
continue; | ||
} | ||
|
||
|
||
let name = node.name | ||
let name = node | ||
.name | ||
.clone() | ||
.unwrap_or_else(|| | ||
decls.ruledefs.generate_anonymous_name()); | ||
.unwrap_or_else(|| decls.ruledefs.generate_anonymous_name()); | ||
|
||
let item_ref = decls.ruledefs.declare( | ||
report, | ||
node.name_span, | ||
&util::SymbolContext::new_global(), | ||
name, | ||
0, | ||
util::SymbolKind::Other)?; | ||
|
||
util::SymbolKind::Other, | ||
)?; | ||
|
||
node.item_ref = Some(item_ref); | ||
} | ||
|
||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.