update readme, fix compiler error range

This commit is contained in:
gluaxspeed 2021-08-13 20:02:43 -07:00
parent 0702be2a18
commit 12fe626485
18 changed files with 28 additions and 28 deletions

View File

@ -23,42 +23,42 @@ These are the different kinds of errors that are made in this crate. Note that i
### ASG
The errors for the `leo-asg` crate. It's error codes will range from 0-999, and be prefixed with the characters `ASG`.
The errors for the `leo-asg` crate. Its error codes will range from 3_000-3_999 and be prefixed with the characters `ASG`.
### AST
The errors for the `leo-ast` crate. It's error codes will range from 1_000-1_999, and be prefixed with the characters `AST`.
The errors for the `leo-ast` crate. Its error codes will range from 2_000-2_999 and be prefixed with the characters `AST`.
### CLI
The errors for the `leo-lang` crate. It's error codes will range from 7_000-7_999, and be prefixed with the characters `CLI`.
The errors for the `leo-lang` crate. Its error codes will range from 7_000-7_999 and be prefixed with the characters `CLI`.
### Compiler
The errors for the `leo-compiler` crate. It's error codes will range from 2_000-2_999, and be prefixed with the characters `CMP`.
The errors for the `leo-compiler` crate. Its error codes will range from 6_000-6_999 and be prefixed with the characters `CMP`.
### Import
The errors for the `leo-imports` crate. It's error codes will range from 3_000-3_999, and be prefixed with the characters `IMP`.
The errors for the `leo-imports` crate. Its error codes will range from 4_000-4_999 and be prefixed with the characters `IMP`.
### Input
The errors for the `leo-input` crate. For right now they just have an exit code of 1, as they aren't ported.
The errors for the `leo-input` crate. For right now, they have an exit code of 1, as they aren't ported.
The reason they aren't ported is due to a desire for 0 deps in case this crate moves to SnarkVM.
### Package
The errors for the `leo-package` crate. It's error codes will range from 4_000-4_999, and be prefixed with the characters `PAK`.
The errors for the `leo-package` crate. Its error codes will range from 5_000-5_999 and be prefixed with the characters `PAK`.
### Parser
The errors for the `leo-parser` crate. It's error codes will range from 5_000-5_999, and be prefixed with the characters `PAR`.
The errors for the `leo-parser` crate. Its error codes will range from 0-999 and be prefixed with the characters `PAR`.
### SnarkVM
The errors from SnarkVM that bubble up into Leo in some situations. For right now they just have an exit code of 1.
When SnarkVM implments better error codes and messages we can just bubble them up.
The errors from SnarkVM that bubble up into Leo in some situations. For right now, they have an exit code of 1.
When SnarkVM implements better error codes and messages, we can bubble them up.
### State
The errors for the `leo-state` crate. It's error codes will range from 6000-6_999, and be prefixed with the characters `STA`.
The errors for the `leo-state` crate. Its error codes will range from 1_000-1_999 and be prefixed with the characters `STA`.

View File

@ -24,7 +24,7 @@ use std::{
create_errors!(
/// CompilerError enum that represents all the errors for the `leo-compiler` crate.
CompilerError,
exit_code_mask: 7000i32,
exit_code_mask: 6000i32,
error_code_prefix: "CMP",
/// For when the test function has invalid test context.

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377006]: Formatter given 1 containers and found 0 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"{}\");\n | ^^^^"
- "Error [ECMP0376006]: Formatter given 1 containers and found 0 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"{}\");\n | ^^^^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377006]: Formatter given 0 containers and found 1 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"\", 1u32);\n | ^^^^^^^^"
- "Error [ECMP0376006]: Formatter given 0 containers and found 1 parameters\n --> compiler-test:4:17\n |\n 4 | console.log(\"\", 1u32);\n | ^^^^^^^^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377029]: Expected input variable `a` to be non-constant. Move input variable `a` to [main] section of input file\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^"
- "Error [ECMP0376029]: Expected input variable `a` to be non-constant. Move input variable `a` to [main] section of input file\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377035]: Input variable a declared twice\n --> compiler-test:3:21\n |\n 3 | function main(const a: u32) {\n | ^"
- "Error [ECMP0376035]: Input variable a declared twice\n --> compiler-test:3:21\n |\n 3 | function main(const a: u32) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377031]: Input array dimensions mismatch expected 1, found array dimensions 2\n --> compiler-test:3:15\n |\n 3 | function main(x: [i16; 2]) {\n | ^"
- "Error [ECMP0376031]: Input array dimensions mismatch expected 1, found array dimensions 2\n --> compiler-test:3:15\n |\n 3 | function main(x: [i16; 2]) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:15\n |\n 3 | function main(x: (u8, bool, u8)) {\n | ^"
- "Error [ECMP0376032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:15\n |\n 3 | function main(x: (u8, bool, u8)) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377035]: Input variable a declared twice\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^"
- "Error [ECMP0376035]: Input variable a declared twice\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377031]: Input array dimensions mismatch expected 2, found array dimensions 1\n --> compiler-test:3:21\n |\n 3 | function main(const x: [i16; 2]) {\n | ^"
- "Error [ECMP0376031]: Input array dimensions mismatch expected 2, found array dimensions 1\n --> compiler-test:3:21\n |\n 3 | function main(const x: [i16; 2]) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:21\n |\n 3 | function main(const x: (u8, bool, u8)) {\n | ^"
- "Error [ECMP0376032]: Input tuple size mismatch expected 3, found tuple with length 2\n --> compiler-test:3:21\n |\n 3 | function main(const x: (u8, bool, u8)) {\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377037]: Mismatched types. Expected register output type `u8`, found type `bool`.\n --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n | ^"
- "Error [ECMP0376037]: Mismatched types. Expected register output type `u8`, found type `bool`.\n --> compiler-test:3:1\n |\n 3 | function main() -> bool {\n|\n 4 | ...\n|\n 5 | }\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377083]: integer operation failed due to the signed integer error `Integer overflow`\n --> compiler-test:5:15\n |\n 5 | const b = -a;\n | ^^"
- "Error [ECMP0376083]: integer operation failed due to the signed integer error `Integer overflow`\n --> compiler-test:5:15\n |\n 5 | const b = -a;\n | ^^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u128) {}\n | ^"
- "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u128) {}\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u16) {}\n | ^"
- "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u16) {}\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {}\n | ^"
- "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u32) {}\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u64) {}\n | ^"
- "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u64) {}\n | ^"

View File

@ -2,4 +2,4 @@
namespace: Compile
expectation: Fail
outputs:
- "Error [ECMP0377089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u8) {}\n | ^"
- "Error [ECMP0376089]: failed to parse `-2` as expected integer type\n --> compiler-test:3:15\n |\n 3 | function main(a: u8) {}\n | ^"