Skip to content
Snippets Groups Projects
Verified Commit 1e28dba9 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

refactor `error throw` in `error.nu`

parent 8e3d2851
No related branches found
No related tags found
1 merge request!117split `examples/` into `benchmarks/` and `bins/`
Pipeline #5268 passed
use error.nu "error throw"
export const WHITE = { r: 1.0, g: 1.0, b: 1.0 } export const WHITE = { r: 1.0, g: 1.0, b: 1.0 }
export const BLACK = { r: 0.0, g: 0.0, b: 0.0 } export const BLACK = { r: 0.0, g: 0.0, b: 0.0 }
export const RED = { r: 1.0, g: 0.0, b: 0.0 } export const RED = { r: 1.0, g: 0.0, b: 0.0 }
export const GREEN = { r: 0.0, g: 1.0, b: 0.0 } export const GREEN = { r: 0.0, g: 1.0, b: 0.0 }
export const BLUE = { r: 0.0, g: 0.0, b: 1.0 } export const BLUE = { r: 0.0, g: 0.0, b: 1.0 }
def "error throw" [err: record<err: string, label: string, span: record<start: int, end: int>>] {
error make {
msg: $"(ansi red_bold)($err.err)(ansi reset)",
label: {
text: $err.label,
span: $err.span,
},
}
}
export def "color from-floats" [ export def "color from-floats" [
r: float, r: float,
g: float, g: float,
......
export def "error throw" [err: record<err: string, label: string, span: record<start: int, end: int>>] {
error make {
msg: $"(ansi red_bold)($err.err)(ansi reset)",
label: {
text: $err.label,
span: $err.span,
},
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment