@andrivet/z80-assembler 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,25 +16,23 @@
16
16
  * License: GPLv3
17
17
  * Copyrights: Copyright (C) 2023 Sebastien Andrivet
18
18
  */
19
- import { PosInfo, SyntaxErr } from "../grammar/z80";
19
+ import { SyntaxErr } from "../grammar/z80";
20
+ import { Position } from "./Types";
20
21
  /**
21
22
  * A compilation error.
22
23
  * Une erreur de compilation.
23
24
  */
24
25
  declare class CompilationError extends Error {
25
- readonly filename: string;
26
- readonly pos: PosInfo;
26
+ readonly position: Position;
27
27
  /**
28
28
  * Constructor.
29
29
  * Constructeur.
30
- * @param filename Filename where the error occurred.
31
- * Fichier où s'est produite l'erreur.
32
- * @param pos Position (line, offset) where the error occurred.
33
- * Position (line, décalage) où s'est produite l'erreur.
30
+ * @param position Position (filename, line, offset) where the error occurred.
31
+ * Position (fichier, line, décalage) où s'est produite l'erreur.
34
32
  * @param message Description of the error.
35
33
  * Description de l'erreur.
36
34
  */
37
- constructor(filename: string, pos: PosInfo, message: string);
35
+ constructor(position: Position, message: string);
38
36
  /**
39
37
  * Format the error.
40
38
  * Formate l'erreur.
@@ -17,7 +17,7 @@
17
17
  * Copyrights: Copyright (C) 2023 Sebastien Andrivet
18
18
  *
19
19
  */
20
- import { Line } from "../grammar/z80";
20
+ import { Line, PosInfo } from "../grammar/z80";
21
21
  import { CompilationError } from "./Error";
22
22
  /**
23
23
  * A byte is represented by a number.
@@ -52,4 +52,11 @@ interface CompilationInfo {
52
52
  sld: string;
53
53
  errs: CompilationError[];
54
54
  }
55
- export { byte, bytes, Address, LinesInfo, CompilationInfo };
55
+ /**
56
+ * Position in a source file.
57
+ */
58
+ interface Position {
59
+ filename: string;
60
+ pos: PosInfo;
61
+ }
62
+ export { byte, bytes, Address, LinesInfo, CompilationInfo, Position };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrivet/z80-assembler",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "A Z80 assembler entirely written in Typescript and derived from a PEG grammar.",
5
5
  "author": "Sebastien Andrivet",
6
6
  "license": "GPLv3",