Skip to content

Commit

Permalink
fix some syntax issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorenzi committed Oct 8, 2024
1 parent 6b26266 commit 8964895
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/asm/parser/directive_const.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::*;
use crate::*;


pub fn parse(
report: &mut diagn::Report,
walker: &mut syntax::Walker,
_header_span: diagn::Span)
-> Result<AstSymbol, ()>
-> Result<asm::AstSymbol, ()>
{
let mut no_emit = false;

Expand Down Expand Up @@ -50,11 +50,11 @@ pub fn parse(
let expr = expr::parse(report, walker)?;
walker.expect_linebreak(report)?;

Ok(AstSymbol {
Ok(asm::AstSymbol {
decl_span,
hierarchy_level,
name,
kind: AstSymbolKind::Constant(AstSymbolConstant {
kind: asm::AstSymbolKind::Constant(asm::AstSymbolConstant {
expr,
}),
no_emit,
Expand Down
8 changes: 4 additions & 4 deletions src/asm/parser/directive_if.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{*, asm::AstTopLevel};
use crate::*;


#[derive(Clone, Debug)]
Expand Down Expand Up @@ -36,7 +36,7 @@ pub fn parse(
fn parse_braced_block(
report: &mut diagn::Report,
walker: &mut syntax::Walker)
-> Result<AstTopLevel, ()>
-> Result<asm::AstTopLevel, ()>
{
walker.expect(report, syntax::TokenKind::BraceOpen)?;

Expand All @@ -53,7 +53,7 @@ fn parse_braced_block(
fn parse_else_blocks(
report: &mut diagn::Report,
walker: &mut syntax::Walker)
-> Result<Option<AstTopLevel>, ()>
-> Result<Option<asm::AstTopLevel>, ()>
{
if !walker.next_useful_is(0, syntax::TokenKind::Hash) ||
!walker.next_useful_is(1, syntax::TokenKind::Identifier)
Expand Down Expand Up @@ -93,7 +93,7 @@ fn parse_else_blocks(
walker,
header_span)?;

let ast_toplevel = AstTopLevel {
let ast_toplevel = asm::AstTopLevel {
nodes: vec![asm::AstAny::DirectiveIf(ast_if)],
};

Expand Down
2 changes: 1 addition & 1 deletion src/asm/parser/fields.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::*;
use crate::*;


pub struct AstFields
Expand Down
8 changes: 4 additions & 4 deletions src/asm/parser/symbol.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::*;
use crate::*;


#[derive(Clone, Debug)]
Expand Down Expand Up @@ -32,7 +32,7 @@ pub struct AstSymbolConstant
pub fn parse(
report: &mut diagn::Report,
walker: &mut syntax::Walker)
-> Result<AstAny, ()>
-> Result<asm::AstAny, ()>
{
let mut decl_span = diagn::Span::new_dummy();
let mut hierarchy_level = 0;
Expand All @@ -53,7 +53,7 @@ pub fn parse(
let expr = expr::parse(report, walker)?;
walker.expect_linebreak(report)?;

Ok(AstAny::Symbol(AstSymbol {
Ok(asm::AstAny::Symbol(AstSymbol {
decl_span,
hierarchy_level,
name,
Expand All @@ -70,7 +70,7 @@ pub fn parse(
let tk_colon = walker.expect(report, syntax::TokenKind::Colon)?;
decl_span = decl_span.join(tk_colon.span);

Ok(AstAny::Symbol(AstSymbol {
Ok(asm::AstAny::Symbol(AstSymbol {
decl_span,
hierarchy_level,
name,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn assemble_str_to_binary(

let mut report = diagn::Report::new();
let mut fileserver = util::FileServerMock::new();
fileserver.add(virtual_filename, src.clone());
fileserver.add(virtual_filename, src);

let opts = asm::AssemblyOptions::new();

Expand Down

0 comments on commit 8964895

Please sign in to comment.