aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-09-27 08:46:24 +0900
committerAstatin <astatin@redacted>2024-09-27 08:46:24 +0900
commite543410ac3b4787b9922ef065a703482c3aeeb1f (patch)
tree2ae8f30a61b58cfa1f0f0e0124447e718bde9279
parent7657996ad68689b437f742516f0f285e53e8f0e3 (diff)
Fix JR offset inside of macros + line number in error messages
-rw-r--r--macros.go2
-rw-r--r--main.go10
2 files changed, 6 insertions, 6 deletions
diff --git a/macros.go b/macros.go
index e08562c..30ab64a 100644
--- a/macros.go
+++ b/macros.go
@@ -173,7 +173,7 @@ func MacroParse(
if err != nil {
return err
}
- new_instructions, err := secondPass("MACRO$"+definedMacroName, macroContent, offset, state)
+ new_instructions, err := secondPass("MACRO$"+definedMacroName, macroContent, 0, state)
if err != nil {
return err
}
diff --git a/main.go b/main.go
index 8100e43..1968fb2 100644
--- a/main.go
+++ b/main.go
@@ -56,7 +56,7 @@ func firstPass(
return nil, fmt.Errorf(
"File %s, line %d:\nLabel %s is already defined",
input_file_name,
- line_nb,
+ line_nb+1,
label,
)
}
@@ -83,7 +83,7 @@ func firstPass(
return nil, fmt.Errorf(
"File %s, line %d (1st pass|macro):\n%w",
input_file_name,
- line_nb,
+ line_nb+1,
err,
)
}
@@ -93,7 +93,7 @@ func firstPass(
return nil, fmt.Errorf(
"File %s, line %d (1st pass):\n%w",
input_file_name,
- line_nb,
+ line_nb+1,
err,
)
}
@@ -136,7 +136,7 @@ func secondPass(
return nil, fmt.Errorf(
"File %s, line %d (2nd pass|macro):\n%w",
input_file_name,
- line_nb,
+ line_nb+1,
err,
)
}
@@ -146,7 +146,7 @@ func secondPass(
return nil, fmt.Errorf(
"File %s, line %d (2nd pass): %w",
input_file_name,
- line_nb,
+ line_nb+1,
err,
)
}