openalgo-script 0.1.0-alpha.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.
- package/LICENSE +201 -0
- package/NOTICE +12 -0
- package/README.md +255 -0
- package/dist/core/ast/annotations.d.ts +56 -0
- package/dist/core/ast/annotations.d.ts.map +1 -0
- package/dist/core/ast/annotations.js +27 -0
- package/dist/core/ast/annotations.js.map +1 -0
- package/dist/core/ast/build.d.ts +25 -0
- package/dist/core/ast/build.d.ts.map +1 -0
- package/dist/core/ast/build.js +26 -0
- package/dist/core/ast/build.js.map +1 -0
- package/dist/core/ast/children.d.ts +15 -0
- package/dist/core/ast/children.d.ts.map +1 -0
- package/dist/core/ast/children.js +103 -0
- package/dist/core/ast/children.js.map +1 -0
- package/dist/core/ast/expressions.d.ts +178 -0
- package/dist/core/ast/expressions.d.ts.map +1 -0
- package/dist/core/ast/expressions.js +50 -0
- package/dist/core/ast/expressions.js.map +1 -0
- package/dist/core/ast/header.d.ts +50 -0
- package/dist/core/ast/header.d.ts.map +1 -0
- package/dist/core/ast/header.js +2 -0
- package/dist/core/ast/header.js.map +1 -0
- package/dist/core/ast/index.d.ts +30 -0
- package/dist/core/ast/index.d.ts.map +1 -0
- package/dist/core/ast/index.js +21 -0
- package/dist/core/ast/index.js.map +1 -0
- package/dist/core/ast/name.d.ts +24 -0
- package/dist/core/ast/name.d.ts.map +1 -0
- package/dist/core/ast/name.js +2 -0
- package/dist/core/ast/name.js.map +1 -0
- package/dist/core/ast/node.d.ts +34 -0
- package/dist/core/ast/node.d.ts.map +1 -0
- package/dist/core/ast/node.js +70 -0
- package/dist/core/ast/node.js.map +1 -0
- package/dist/core/ast/script.d.ts +57 -0
- package/dist/core/ast/script.d.ts.map +1 -0
- package/dist/core/ast/script.js +2 -0
- package/dist/core/ast/script.js.map +1 -0
- package/dist/core/ast/statements.d.ts +161 -0
- package/dist/core/ast/statements.d.ts.map +1 -0
- package/dist/core/ast/statements.js +10 -0
- package/dist/core/ast/statements.js.map +1 -0
- package/dist/core/ast/walk.d.ts +39 -0
- package/dist/core/ast/walk.d.ts.map +1 -0
- package/dist/core/ast/walk.js +54 -0
- package/dist/core/ast/walk.js.map +1 -0
- package/dist/core/catalogue/catalogue.generated.d.ts +1590 -0
- package/dist/core/catalogue/catalogue.generated.d.ts.map +1 -0
- package/dist/core/catalogue/catalogue.generated.js +162 -0
- package/dist/core/catalogue/catalogue.generated.js.map +1 -0
- package/dist/core/catalogue/index.d.ts +15 -0
- package/dist/core/catalogue/index.d.ts.map +1 -0
- package/dist/core/catalogue/index.js +4 -0
- package/dist/core/catalogue/index.js.map +1 -0
- package/dist/core/catalogue/lookup.d.ts +14 -0
- package/dist/core/catalogue/lookup.d.ts.map +1 -0
- package/dist/core/catalogue/lookup.js +19 -0
- package/dist/core/catalogue/lookup.js.map +1 -0
- package/dist/core/catalogue/template.d.ts +15 -0
- package/dist/core/catalogue/template.d.ts.map +1 -0
- package/dist/core/catalogue/template.js +33 -0
- package/dist/core/catalogue/template.js.map +1 -0
- package/dist/core/catalogue/types.d.ts +34 -0
- package/dist/core/catalogue/types.d.ts.map +1 -0
- package/dist/core/catalogue/types.js +6 -0
- package/dist/core/catalogue/types.js.map +1 -0
- package/dist/core/catalogue/values.generated.d.ts +565 -0
- package/dist/core/catalogue/values.generated.d.ts.map +1 -0
- package/dist/core/catalogue/values.generated.js +6 -0
- package/dist/core/catalogue/values.generated.js.map +1 -0
- package/dist/core/diagnostics/collector.d.ts +46 -0
- package/dist/core/diagnostics/collector.d.ts.map +1 -0
- package/dist/core/diagnostics/collector.js +55 -0
- package/dist/core/diagnostics/collector.js.map +1 -0
- package/dist/core/diagnostics/diagnostic.d.ts +40 -0
- package/dist/core/diagnostics/diagnostic.d.ts.map +1 -0
- package/dist/core/diagnostics/diagnostic.js +29 -0
- package/dist/core/diagnostics/diagnostic.js.map +1 -0
- package/dist/core/diagnostics/index.d.ts +12 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -0
- package/dist/core/diagnostics/index.js +3 -0
- package/dist/core/diagnostics/index.js.map +1 -0
- package/dist/core/index.d.ts +28 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lex/blocks.d.ts +51 -0
- package/dist/core/lex/blocks.d.ts.map +1 -0
- package/dist/core/lex/blocks.js +56 -0
- package/dist/core/lex/blocks.js.map +1 -0
- package/dist/core/lex/characters.d.ts +38 -0
- package/dist/core/lex/characters.d.ts.map +1 -0
- package/dist/core/lex/characters.js +50 -0
- package/dist/core/lex/characters.js.map +1 -0
- package/dist/core/lex/comments.d.ts +50 -0
- package/dist/core/lex/comments.d.ts.map +1 -0
- package/dist/core/lex/comments.js +64 -0
- package/dist/core/lex/comments.js.map +1 -0
- package/dist/core/lex/index.d.ts +12 -0
- package/dist/core/lex/index.d.ts.map +1 -0
- package/dist/core/lex/index.js +12 -0
- package/dist/core/lex/index.js.map +1 -0
- package/dist/core/lex/layout.d.ts +40 -0
- package/dist/core/lex/layout.d.ts.map +1 -0
- package/dist/core/lex/layout.js +143 -0
- package/dist/core/lex/layout.js.map +1 -0
- package/dist/core/lex/lexer.d.ts +13 -0
- package/dist/core/lex/lexer.d.ts.map +1 -0
- package/dist/core/lex/lexer.js +419 -0
- package/dist/core/lex/lexer.js.map +1 -0
- package/dist/core/lex/numbers.d.ts +22 -0
- package/dist/core/lex/numbers.d.ts.map +1 -0
- package/dist/core/lex/numbers.js +58 -0
- package/dist/core/lex/numbers.js.map +1 -0
- package/dist/core/lex/statements.d.ts +24 -0
- package/dist/core/lex/statements.d.ts.map +1 -0
- package/dist/core/lex/statements.js +90 -0
- package/dist/core/lex/statements.js.map +1 -0
- package/dist/core/lex/strings.d.ts +27 -0
- package/dist/core/lex/strings.d.ts.map +1 -0
- package/dist/core/lex/strings.js +92 -0
- package/dist/core/lex/strings.js.map +1 -0
- package/dist/core/lex/unexpected.d.ts +31 -0
- package/dist/core/lex/unexpected.d.ts.map +1 -0
- package/dist/core/lex/unexpected.js +114 -0
- package/dist/core/lex/unexpected.js.map +1 -0
- package/dist/core/parse/annotations.d.ts +4 -0
- package/dist/core/parse/annotations.d.ts.map +1 -0
- package/dist/core/parse/annotations.js +49 -0
- package/dist/core/parse/annotations.js.map +1 -0
- package/dist/core/parse/blocks.d.ts +18 -0
- package/dist/core/parse/blocks.d.ts.map +1 -0
- package/dist/core/parse/blocks.js +47 -0
- package/dist/core/parse/blocks.js.map +1 -0
- package/dist/core/parse/branches.d.ts +17 -0
- package/dist/core/parse/branches.d.ts.map +1 -0
- package/dist/core/parse/branches.js +66 -0
- package/dist/core/parse/branches.js.map +1 -0
- package/dist/core/parse/cursor.d.ts +119 -0
- package/dist/core/parse/cursor.d.ts.map +1 -0
- package/dist/core/parse/cursor.js +305 -0
- package/dist/core/parse/cursor.js.map +1 -0
- package/dist/core/parse/expressions.d.ts +57 -0
- package/dist/core/parse/expressions.d.ts.map +1 -0
- package/dist/core/parse/expressions.js +373 -0
- package/dist/core/parse/expressions.js.map +1 -0
- package/dist/core/parse/functions.d.ts +16 -0
- package/dist/core/parse/functions.d.ts.map +1 -0
- package/dist/core/parse/functions.js +92 -0
- package/dist/core/parse/functions.js.map +1 -0
- package/dist/core/parse/index.d.ts +13 -0
- package/dist/core/parse/index.d.ts.map +1 -0
- package/dist/core/parse/index.js +13 -0
- package/dist/core/parse/index.js.map +1 -0
- package/dist/core/parse/loops.d.ts +13 -0
- package/dist/core/parse/loops.d.ts.map +1 -0
- package/dist/core/parse/loops.js +78 -0
- package/dist/core/parse/loops.js.map +1 -0
- package/dist/core/parse/names.d.ts +34 -0
- package/dist/core/parse/names.d.ts.map +1 -0
- package/dist/core/parse/names.js +122 -0
- package/dist/core/parse/names.js.map +1 -0
- package/dist/core/parse/script.d.ts +23 -0
- package/dist/core/parse/script.d.ts.map +1 -0
- package/dist/core/parse/script.js +55 -0
- package/dist/core/parse/script.js.map +1 -0
- package/dist/core/parse/statements.d.ts +14 -0
- package/dist/core/parse/statements.d.ts.map +1 -0
- package/dist/core/parse/statements.js +292 -0
- package/dist/core/parse/statements.js.map +1 -0
- package/dist/core/parse/switches.d.ts +16 -0
- package/dist/core/parse/switches.d.ts.map +1 -0
- package/dist/core/parse/switches.js +98 -0
- package/dist/core/parse/switches.js.map +1 -0
- package/dist/core/render/index.d.ts +10 -0
- package/dist/core/render/index.d.ts.map +1 -0
- package/dist/core/render/index.js +10 -0
- package/dist/core/render/index.js.map +1 -0
- package/dist/core/render/terminal.d.ts +11 -0
- package/dist/core/render/terminal.d.ts.map +1 -0
- package/dist/core/render/terminal.js +51 -0
- package/dist/core/render/terminal.js.map +1 -0
- package/dist/core/source/index.d.ts +7 -0
- package/dist/core/source/index.d.ts.map +1 -0
- package/dist/core/source/index.js +2 -0
- package/dist/core/source/index.js.map +1 -0
- package/dist/core/source/source.d.ts +41 -0
- package/dist/core/source/source.d.ts.map +1 -0
- package/dist/core/source/source.js +67 -0
- package/dist/core/source/source.js.map +1 -0
- package/dist/core/span/index.d.ts +3 -0
- package/dist/core/span/index.d.ts.map +1 -0
- package/dist/core/span/index.js +2 -0
- package/dist/core/span/index.js.map +1 -0
- package/dist/core/span/span.d.ts +67 -0
- package/dist/core/span/span.d.ts.map +1 -0
- package/dist/core/span/span.js +27 -0
- package/dist/core/span/span.js.map +1 -0
- package/dist/core/tokens/index.d.ts +8 -0
- package/dist/core/tokens/index.d.ts.map +1 -0
- package/dist/core/tokens/index.js +2 -0
- package/dist/core/tokens/index.js.map +1 -0
- package/dist/core/tokens/kind.d.ts +53 -0
- package/dist/core/tokens/kind.d.ts.map +1 -0
- package/dist/core/tokens/kind.js +94 -0
- package/dist/core/tokens/kind.js.map +1 -0
- package/dist/core/tokens/token.d.ts +36 -0
- package/dist/core/tokens/token.d.ts.map +1 -0
- package/dist/core/tokens/token.js +2 -0
- package/dist/core/tokens/token.js.map +1 -0
- package/package.json +52 -0
- package/spec/README.md +48 -0
- package/spec/errors.json +3204 -0
- package/src/core/ast/annotations.ts +68 -0
- package/src/core/ast/build.ts +35 -0
- package/src/core/ast/children.ts +110 -0
- package/src/core/ast/expressions.ts +254 -0
- package/src/core/ast/header.ts +53 -0
- package/src/core/ast/index.ts +102 -0
- package/src/core/ast/name.ts +24 -0
- package/src/core/ast/node.ts +120 -0
- package/src/core/ast/script.ts +60 -0
- package/src/core/ast/statements.ts +193 -0
- package/src/core/ast/walk.ts +67 -0
- package/src/core/catalogue/catalogue.generated.ts +171 -0
- package/src/core/catalogue/index.ts +20 -0
- package/src/core/catalogue/lookup.ts +23 -0
- package/src/core/catalogue/template.ts +38 -0
- package/src/core/catalogue/types.ts +37 -0
- package/src/core/catalogue/values.generated.ts +160 -0
- package/src/core/diagnostics/collector.ts +87 -0
- package/src/core/diagnostics/diagnostic.ts +72 -0
- package/src/core/diagnostics/index.ts +12 -0
- package/src/core/index.ts +146 -0
- package/src/core/lex/blocks.ts +92 -0
- package/src/core/lex/characters.ts +56 -0
- package/src/core/lex/comments.ts +75 -0
- package/src/core/lex/index.ts +11 -0
- package/src/core/lex/layout.ts +188 -0
- package/src/core/lex/lexer.ts +486 -0
- package/src/core/lex/numbers.ts +77 -0
- package/src/core/lex/statements.ts +94 -0
- package/src/core/lex/strings.ts +119 -0
- package/src/core/lex/unexpected.ts +125 -0
- package/src/core/parse/annotations.ts +60 -0
- package/src/core/parse/blocks.ts +52 -0
- package/src/core/parse/branches.ts +77 -0
- package/src/core/parse/cursor.ts +348 -0
- package/src/core/parse/expressions.ts +441 -0
- package/src/core/parse/functions.ts +109 -0
- package/src/core/parse/index.ts +12 -0
- package/src/core/parse/loops.ts +97 -0
- package/src/core/parse/names.ts +135 -0
- package/src/core/parse/script.ts +64 -0
- package/src/core/parse/statements.ts +329 -0
- package/src/core/parse/switches.ts +105 -0
- package/src/core/render/index.ts +9 -0
- package/src/core/render/terminal.ts +62 -0
- package/src/core/source/index.ts +6 -0
- package/src/core/source/source.ts +102 -0
- package/src/core/span/index.ts +2 -0
- package/src/core/span/span.ts +84 -0
- package/src/core/tokens/index.ts +15 -0
- package/src/core/tokens/kind.ts +123 -0
- package/src/core/tokens/token.ts +39 -0
|
@@ -0,0 +1,1590 @@
|
|
|
1
|
+
/** The shape of spec/errors.json that this file was generated from. */
|
|
2
|
+
export declare const CATALOGUE_SCHEMA_VERSION = 1;
|
|
3
|
+
/** The language version the catalogue describes. */
|
|
4
|
+
export declare const CATALOGUE_LANGUAGE_VERSION = 1;
|
|
5
|
+
/** The word each stage is printed as, so a reader is told which part of the compiler spoke. */
|
|
6
|
+
export declare const STAGE_LABELS: {
|
|
7
|
+
readonly lex: "lexer";
|
|
8
|
+
readonly parse: "parser";
|
|
9
|
+
readonly check: "checker";
|
|
10
|
+
readonly runtime: "engine";
|
|
11
|
+
readonly host: "host";
|
|
12
|
+
};
|
|
13
|
+
export declare const ENTRIES: {
|
|
14
|
+
readonly OS1001: {
|
|
15
|
+
readonly code: "OS1001";
|
|
16
|
+
readonly title: "Unexpected character";
|
|
17
|
+
readonly severity: "error";
|
|
18
|
+
readonly stage: "lex";
|
|
19
|
+
readonly since: 1;
|
|
20
|
+
readonly autofix: true;
|
|
21
|
+
readonly message: "Unexpected character {char}. {suggestion}";
|
|
22
|
+
readonly fix: "Delete the character or replace it with the plain ASCII spelling the message names: a plain space for a non-breaking space, a straight quote for a typographic one, not for !, and for &&, or for ||, pow(a, b) for ^.";
|
|
23
|
+
readonly placeholders: readonly ["char", "suggestion"];
|
|
24
|
+
};
|
|
25
|
+
readonly OS1002: {
|
|
26
|
+
readonly code: "OS1002";
|
|
27
|
+
readonly title: "Tab in indentation";
|
|
28
|
+
readonly severity: "error";
|
|
29
|
+
readonly stage: "lex";
|
|
30
|
+
readonly since: 1;
|
|
31
|
+
readonly autofix: true;
|
|
32
|
+
readonly message: "This line is indented with a tab.";
|
|
33
|
+
readonly fix: "Replace the leading tabs with spaces. Four spaces per level is the convention and the formatter's output.";
|
|
34
|
+
readonly placeholders: readonly [];
|
|
35
|
+
};
|
|
36
|
+
readonly OS1003: {
|
|
37
|
+
readonly code: "OS1003";
|
|
38
|
+
readonly title: "Indentation does not match this block";
|
|
39
|
+
readonly severity: "error";
|
|
40
|
+
readonly stage: "lex";
|
|
41
|
+
readonly since: 1;
|
|
42
|
+
readonly autofix: true;
|
|
43
|
+
readonly message: "This line is indented {found} spaces; the block opened at line {line} is indented {expected}.";
|
|
44
|
+
readonly fix: "Indent this line to {expected} spaces to keep it in the block, or to {line}'s own indentation to end the block here.";
|
|
45
|
+
readonly placeholders: readonly ["found", "expected", "line"];
|
|
46
|
+
};
|
|
47
|
+
readonly OS1004: {
|
|
48
|
+
readonly code: "OS1004";
|
|
49
|
+
readonly title: "Unterminated string literal";
|
|
50
|
+
readonly severity: "error";
|
|
51
|
+
readonly stage: "lex";
|
|
52
|
+
readonly since: 1;
|
|
53
|
+
readonly autofix: false;
|
|
54
|
+
readonly message: "This string literal opens with {quote} and the line ends before a matching {quote}.";
|
|
55
|
+
readonly fix: "Close the string with a matching {quote} before the end of the line, and join text across lines with + and a continuation.";
|
|
56
|
+
readonly placeholders: readonly ["quote"];
|
|
57
|
+
};
|
|
58
|
+
readonly OS1005: {
|
|
59
|
+
readonly code: "OS1005";
|
|
60
|
+
readonly title: "Unknown escape sequence";
|
|
61
|
+
readonly severity: "error";
|
|
62
|
+
readonly stage: "lex";
|
|
63
|
+
readonly since: 1;
|
|
64
|
+
readonly autofix: true;
|
|
65
|
+
readonly message: "{sequence} is not an escape sequence.";
|
|
66
|
+
readonly fix: "Double the backslash to write one literally, or use one of the escapes the language defines.";
|
|
67
|
+
readonly placeholders: readonly ["sequence"];
|
|
68
|
+
};
|
|
69
|
+
readonly OS1006: {
|
|
70
|
+
readonly code: "OS1006";
|
|
71
|
+
readonly title: "Assignment used as a condition";
|
|
72
|
+
readonly severity: "error";
|
|
73
|
+
readonly stage: "parse";
|
|
74
|
+
readonly since: 1;
|
|
75
|
+
readonly autofix: true;
|
|
76
|
+
readonly message: "= assigns a value, and a condition needs a comparison.";
|
|
77
|
+
readonly fix: "Write == to compare, or move the assignment to its own line above the if.";
|
|
78
|
+
readonly placeholders: readonly [];
|
|
79
|
+
};
|
|
80
|
+
readonly OS1007: {
|
|
81
|
+
readonly code: "OS1007";
|
|
82
|
+
readonly title: "Semicolon";
|
|
83
|
+
readonly severity: "error";
|
|
84
|
+
readonly stage: "lex";
|
|
85
|
+
readonly since: 1;
|
|
86
|
+
readonly autofix: true;
|
|
87
|
+
readonly message: "; is not part of the language.";
|
|
88
|
+
readonly fix: "Delete the ; and put the second statement on its own line.";
|
|
89
|
+
readonly placeholders: readonly [];
|
|
90
|
+
};
|
|
91
|
+
readonly OS1008: {
|
|
92
|
+
readonly code: "OS1008";
|
|
93
|
+
readonly title: "Chained comparison";
|
|
94
|
+
readonly severity: "error";
|
|
95
|
+
readonly stage: "parse";
|
|
96
|
+
readonly since: 1;
|
|
97
|
+
readonly autofix: false;
|
|
98
|
+
readonly message: "A comparison cannot be chained: {op1} is already applied before {op2}.";
|
|
99
|
+
readonly fix: "Split it with and, naming the middle value twice: a < b and b < c.";
|
|
100
|
+
readonly placeholders: readonly ["op1", "op2"];
|
|
101
|
+
};
|
|
102
|
+
readonly OS1009: {
|
|
103
|
+
readonly code: "OS1009";
|
|
104
|
+
readonly title: "break or continue outside a loop";
|
|
105
|
+
readonly severity: "error";
|
|
106
|
+
readonly stage: "parse";
|
|
107
|
+
readonly since: 1;
|
|
108
|
+
readonly autofix: false;
|
|
109
|
+
readonly message: "{word} is only valid inside a for or a while body.";
|
|
110
|
+
readonly fix: "Move it inside the loop body, or write return to leave a function early.";
|
|
111
|
+
readonly placeholders: readonly ["word"];
|
|
112
|
+
};
|
|
113
|
+
readonly OS1010: {
|
|
114
|
+
readonly code: "OS1010";
|
|
115
|
+
readonly title: "Block header with no body";
|
|
116
|
+
readonly severity: "error";
|
|
117
|
+
readonly stage: "parse";
|
|
118
|
+
readonly since: 1;
|
|
119
|
+
readonly autofix: true;
|
|
120
|
+
readonly message: "{header} opens a block, and the next line is not indented more deeply.";
|
|
121
|
+
readonly fix: "Indent the body under the header, or delete the header line if the body is genuinely empty.";
|
|
122
|
+
readonly placeholders: readonly ["header"];
|
|
123
|
+
};
|
|
124
|
+
readonly OS1011: {
|
|
125
|
+
readonly code: "OS1011";
|
|
126
|
+
readonly title: "var with no initial value";
|
|
127
|
+
readonly severity: "error";
|
|
128
|
+
readonly stage: "parse";
|
|
129
|
+
readonly since: 1;
|
|
130
|
+
readonly autofix: true;
|
|
131
|
+
readonly message: "var {name} has no initial value.";
|
|
132
|
+
readonly fix: "Give it a starting value; var {name} = none is the empty start.";
|
|
133
|
+
readonly placeholders: readonly ["name"];
|
|
134
|
+
};
|
|
135
|
+
readonly OS1012: {
|
|
136
|
+
readonly code: "OS1012";
|
|
137
|
+
readonly title: "Bracket is never closed";
|
|
138
|
+
readonly severity: "error";
|
|
139
|
+
readonly stage: "parse";
|
|
140
|
+
readonly since: 1;
|
|
141
|
+
readonly autofix: false;
|
|
142
|
+
readonly message: "The {bracket} opened at line {line} is never closed.";
|
|
143
|
+
readonly fix: "Add the matching closer at the end of the argument list on line {line}.";
|
|
144
|
+
readonly placeholders: readonly ["bracket", "line"];
|
|
145
|
+
};
|
|
146
|
+
readonly OS1013: {
|
|
147
|
+
readonly code: "OS1013";
|
|
148
|
+
readonly title: "Mismatched closing bracket";
|
|
149
|
+
readonly severity: "error";
|
|
150
|
+
readonly stage: "parse";
|
|
151
|
+
readonly since: 1;
|
|
152
|
+
readonly autofix: true;
|
|
153
|
+
readonly message: "Found {found} where {expected} was expected, closing the {opener} opened at line {line}.";
|
|
154
|
+
readonly fix: "Change {found} to {expected}, which is what closes the {opener} opened at line {line}.";
|
|
155
|
+
readonly placeholders: readonly ["found", "expected", "opener", "line"];
|
|
156
|
+
};
|
|
157
|
+
readonly OS1014: {
|
|
158
|
+
readonly code: "OS1014";
|
|
159
|
+
readonly title: "Missing comma between arguments";
|
|
160
|
+
readonly severity: "error";
|
|
161
|
+
readonly stage: "parse";
|
|
162
|
+
readonly since: 1;
|
|
163
|
+
readonly autofix: true;
|
|
164
|
+
readonly message: "Two arguments run together; a comma is missing before {token}.";
|
|
165
|
+
readonly fix: "Put a comma between the two arguments.";
|
|
166
|
+
readonly placeholders: readonly ["token"];
|
|
167
|
+
};
|
|
168
|
+
readonly OS1015: {
|
|
169
|
+
readonly code: "OS1015";
|
|
170
|
+
readonly title: "Ternary with no second arm";
|
|
171
|
+
readonly severity: "error";
|
|
172
|
+
readonly stage: "parse";
|
|
173
|
+
readonly since: 1;
|
|
174
|
+
readonly autofix: false;
|
|
175
|
+
readonly message: "This ? has no matching :";
|
|
176
|
+
readonly fix: "Give the ternary both arms, and use none for the arm that should draw nothing.";
|
|
177
|
+
readonly placeholders: readonly [];
|
|
178
|
+
};
|
|
179
|
+
readonly OS1016: {
|
|
180
|
+
readonly code: "OS1016";
|
|
181
|
+
readonly title: "else does not follow an if";
|
|
182
|
+
readonly severity: "error";
|
|
183
|
+
readonly stage: "parse";
|
|
184
|
+
readonly since: 1;
|
|
185
|
+
readonly autofix: true;
|
|
186
|
+
readonly message: "This else is indented {found} spaces and the nearest if is indented {expected}.";
|
|
187
|
+
readonly fix: "Line the else up with its if, at {expected} spaces.";
|
|
188
|
+
readonly placeholders: readonly ["found", "expected"];
|
|
189
|
+
};
|
|
190
|
+
readonly OS1017: {
|
|
191
|
+
readonly code: "OS1017";
|
|
192
|
+
readonly title: "case or default in the wrong place";
|
|
193
|
+
readonly severity: "error";
|
|
194
|
+
readonly stage: "parse";
|
|
195
|
+
readonly since: 1;
|
|
196
|
+
readonly autofix: false;
|
|
197
|
+
readonly message: "{word} is only valid inside a switch, and default must be its last arm.";
|
|
198
|
+
readonly fix: "Move the arm inside the switch block, and put default after every case.";
|
|
199
|
+
readonly placeholders: readonly ["word"];
|
|
200
|
+
};
|
|
201
|
+
readonly OS1018: {
|
|
202
|
+
readonly code: "OS1018";
|
|
203
|
+
readonly title: "More than one statement on a line";
|
|
204
|
+
readonly severity: "error";
|
|
205
|
+
readonly stage: "parse";
|
|
206
|
+
readonly since: 1;
|
|
207
|
+
readonly autofix: false;
|
|
208
|
+
readonly message: "Unexpected {token} after the end of this statement.";
|
|
209
|
+
readonly fix: "Put {token} and what follows it on its own line, or supply the operator that was meant to join them.";
|
|
210
|
+
readonly placeholders: readonly ["token"];
|
|
211
|
+
};
|
|
212
|
+
readonly OS1019: {
|
|
213
|
+
readonly code: "OS1019";
|
|
214
|
+
readonly title: "Reserved word used as a name";
|
|
215
|
+
readonly severity: "error";
|
|
216
|
+
readonly stage: "parse";
|
|
217
|
+
readonly since: 1;
|
|
218
|
+
readonly autofix: false;
|
|
219
|
+
readonly message: "{word} is a reserved word and cannot be used as a name.";
|
|
220
|
+
readonly fix: "Rename it; {suggestion} keeps the meaning and is not reserved.";
|
|
221
|
+
readonly placeholders: readonly ["word", "suggestion"];
|
|
222
|
+
};
|
|
223
|
+
readonly OS1020: {
|
|
224
|
+
readonly code: "OS1020";
|
|
225
|
+
readonly title: "Incomplete for header";
|
|
226
|
+
readonly severity: "error";
|
|
227
|
+
readonly stage: "parse";
|
|
228
|
+
readonly since: 1;
|
|
229
|
+
readonly autofix: false;
|
|
230
|
+
readonly message: "A for header needs = start to end or in array; found {token}.";
|
|
231
|
+
readonly fix: "Write for i = 0 to size(values) - 1 for a counted loop, or for v in values to visit elements.";
|
|
232
|
+
readonly placeholders: readonly ["token"];
|
|
233
|
+
};
|
|
234
|
+
readonly OS1021: {
|
|
235
|
+
readonly code: "OS1021";
|
|
236
|
+
readonly title: "The version declaration is not first";
|
|
237
|
+
readonly severity: "error";
|
|
238
|
+
readonly stage: "parse";
|
|
239
|
+
readonly since: 1;
|
|
240
|
+
readonly autofix: true;
|
|
241
|
+
readonly message: "version must be the first line that is not blank and not a comment; line {line} came before it.";
|
|
242
|
+
readonly fix: "Move the version line to the top of the file, above the study or strategy declaration.";
|
|
243
|
+
readonly placeholders: readonly ["line"];
|
|
244
|
+
};
|
|
245
|
+
readonly OS1022: {
|
|
246
|
+
readonly code: "OS1022";
|
|
247
|
+
readonly title: "Expression expected";
|
|
248
|
+
readonly severity: "error";
|
|
249
|
+
readonly stage: "parse";
|
|
250
|
+
readonly since: 1;
|
|
251
|
+
readonly autofix: false;
|
|
252
|
+
readonly message: "An expression was expected after {token}.";
|
|
253
|
+
readonly fix: "Supply the missing operand, or delete the trailing {token}.";
|
|
254
|
+
readonly placeholders: readonly ["token"];
|
|
255
|
+
};
|
|
256
|
+
readonly OS1023: {
|
|
257
|
+
readonly code: "OS1023";
|
|
258
|
+
readonly title: "A function declared inside a block";
|
|
259
|
+
readonly severity: "error";
|
|
260
|
+
readonly stage: "parse";
|
|
261
|
+
readonly since: 1;
|
|
262
|
+
readonly autofix: false;
|
|
263
|
+
readonly message: "fn {name} is declared inside a block, and a function is declared at the top level of the file.";
|
|
264
|
+
readonly fix: "Move the whole declaration out to the top level of the file, and call {name} from inside the block.";
|
|
265
|
+
readonly placeholders: readonly ["name"];
|
|
266
|
+
};
|
|
267
|
+
readonly OS1024: {
|
|
268
|
+
readonly code: "OS1024";
|
|
269
|
+
readonly title: "Assignment to an indexed element";
|
|
270
|
+
readonly severity: "error";
|
|
271
|
+
readonly stage: "parse";
|
|
272
|
+
readonly since: 1;
|
|
273
|
+
readonly autofix: false;
|
|
274
|
+
readonly message: "An assignment writes to a name, and this target is an index into {name}.";
|
|
275
|
+
readonly fix: "Change an array element with set({name}, i, v), or assign to a plain name: the past of a series is computed and never written.";
|
|
276
|
+
readonly placeholders: readonly ["name"];
|
|
277
|
+
};
|
|
278
|
+
readonly OS1025: {
|
|
279
|
+
readonly code: "OS1025";
|
|
280
|
+
readonly title: "Assignment to a member";
|
|
281
|
+
readonly severity: "error";
|
|
282
|
+
readonly stage: "parse";
|
|
283
|
+
readonly since: 1;
|
|
284
|
+
readonly autofix: false;
|
|
285
|
+
readonly message: "An assignment writes to a name, and this target is the member {member} of {name}.";
|
|
286
|
+
readonly fix: "Assign to a plain name. Version 1 has no member assignment: a dot reads a member, and the members a script can reach are facts and functions the library and the host supply.";
|
|
287
|
+
readonly placeholders: readonly ["name", "member"];
|
|
288
|
+
};
|
|
289
|
+
readonly OS1026: {
|
|
290
|
+
readonly code: "OS1026";
|
|
291
|
+
readonly title: "Block comment";
|
|
292
|
+
readonly severity: "error";
|
|
293
|
+
readonly stage: "lex";
|
|
294
|
+
readonly since: 1;
|
|
295
|
+
readonly autofix: false;
|
|
296
|
+
readonly message: "{marker} does not open or close a comment. A comment is written // and runs to the end of its line.";
|
|
297
|
+
readonly fix: "Write // instead, and give every line of a commented region its own //, which every editor does with one keystroke.";
|
|
298
|
+
readonly placeholders: readonly ["marker"];
|
|
299
|
+
};
|
|
300
|
+
readonly OS1027: {
|
|
301
|
+
readonly code: "OS1027";
|
|
302
|
+
readonly title: "Malformed colour literal";
|
|
303
|
+
readonly severity: "error";
|
|
304
|
+
readonly stage: "lex";
|
|
305
|
+
readonly since: 1;
|
|
306
|
+
readonly autofix: false;
|
|
307
|
+
readonly message: "{written} is not a colour: a colour literal is # and six or eight hexadecimal digits.";
|
|
308
|
+
readonly fix: "Give it six hexadecimal digits, or eight where the last two are the alpha byte. A named colour or rgb(r, g, b) says the same thing without the digits.";
|
|
309
|
+
readonly placeholders: readonly ["written"];
|
|
310
|
+
};
|
|
311
|
+
readonly OS1028: {
|
|
312
|
+
readonly code: "OS1028";
|
|
313
|
+
readonly title: "A continuation line is not indented past its statement";
|
|
314
|
+
readonly severity: "error";
|
|
315
|
+
readonly stage: "lex";
|
|
316
|
+
readonly since: 1;
|
|
317
|
+
readonly autofix: true;
|
|
318
|
+
readonly message: "A continuation line must be indented more deeply than the line its statement began on; line {line} is indented {statement} and this line is indented {found}.";
|
|
319
|
+
readonly fix: "Indent this line further than the {statement} spaces on line {line}. Four more is the convention and the formatter's output.";
|
|
320
|
+
readonly placeholders: readonly ["found", "statement", "line"];
|
|
321
|
+
};
|
|
322
|
+
readonly OS1029: {
|
|
323
|
+
readonly code: "OS1029";
|
|
324
|
+
readonly title: "A name written against a number";
|
|
325
|
+
readonly severity: "error";
|
|
326
|
+
readonly stage: "lex";
|
|
327
|
+
readonly since: 1;
|
|
328
|
+
readonly autofix: false;
|
|
329
|
+
readonly message: "{written} is neither a number nor a name: the number literal ends at {number}, and a name cannot begin with a digit.";
|
|
330
|
+
readonly fix: "Write the value in a form the language has: a decimal literal, or 0x and hexadecimal digits. There is no binary form and no octal form, and an underscore separates digit groups only where a digit follows it. Where a number and a name were meant as two things, put an operator between them.";
|
|
331
|
+
readonly placeholders: readonly ["written", "number"];
|
|
332
|
+
};
|
|
333
|
+
readonly OS2001: {
|
|
334
|
+
readonly code: "OS2001";
|
|
335
|
+
readonly title: "Name is not defined here";
|
|
336
|
+
readonly severity: "error";
|
|
337
|
+
readonly stage: "check";
|
|
338
|
+
readonly since: 1;
|
|
339
|
+
readonly autofix: false;
|
|
340
|
+
readonly message: "{name} is not defined at this point in the file.";
|
|
341
|
+
readonly fix: "Assign {name} above this line, move this line below its assignment, or correct the spelling to {suggestion}.";
|
|
342
|
+
readonly placeholders: readonly ["name", "suggestion"];
|
|
343
|
+
};
|
|
344
|
+
readonly OS2002: {
|
|
345
|
+
readonly code: "OS2002";
|
|
346
|
+
readonly title: "The name already exists in an enclosing scope";
|
|
347
|
+
readonly severity: "error";
|
|
348
|
+
readonly stage: "check";
|
|
349
|
+
readonly since: 1;
|
|
350
|
+
readonly autofix: false;
|
|
351
|
+
readonly message: "{name} is already declared at line {line}, so a second one cannot be declared here.";
|
|
352
|
+
readonly fix: "Rename this one, or drop the inner declaration and let the assignment update the {name} at line {line}.";
|
|
353
|
+
readonly placeholders: readonly ["name", "line"];
|
|
354
|
+
};
|
|
355
|
+
readonly OS2003: {
|
|
356
|
+
readonly code: "OS2003";
|
|
357
|
+
readonly title: "Types do not match";
|
|
358
|
+
readonly severity: "error";
|
|
359
|
+
readonly stage: "check";
|
|
360
|
+
readonly since: 1;
|
|
361
|
+
readonly autofix: false;
|
|
362
|
+
readonly message: "{leftType} and {rightType} do not mix here.";
|
|
363
|
+
readonly fix: "Convert explicitly: text(x) for a string, number(s) for a number, bool(x) for a bool, or use a separate name for the second value. A plot, fill or level handle converts to nothing: leave it named at the top level, pass it to fill(), and use draw.line() or draw.box() where the script needs something it can keep.";
|
|
364
|
+
readonly placeholders: readonly ["leftType", "rightType"];
|
|
365
|
+
};
|
|
366
|
+
readonly OS2004: {
|
|
367
|
+
readonly code: "OS2004";
|
|
368
|
+
readonly title: "This value has no history";
|
|
369
|
+
readonly severity: "error";
|
|
370
|
+
readonly stage: "check";
|
|
371
|
+
readonly since: 1;
|
|
372
|
+
readonly autofix: false;
|
|
373
|
+
readonly message: "{expr} has no history, so [] cannot read a past value of it.";
|
|
374
|
+
readonly fix: "Assign the value to a name at the top level of the file, then read that name's history.";
|
|
375
|
+
readonly placeholders: readonly ["expr"];
|
|
376
|
+
};
|
|
377
|
+
readonly OS2005: {
|
|
378
|
+
readonly code: "OS2005";
|
|
379
|
+
readonly title: "Recursive call";
|
|
380
|
+
readonly severity: "error";
|
|
381
|
+
readonly stage: "check";
|
|
382
|
+
readonly since: 1;
|
|
383
|
+
readonly autofix: false;
|
|
384
|
+
readonly message: "{name} calls itself: {cycle}.";
|
|
385
|
+
readonly fix: "Rewrite it as a loop, or split the work into two functions that do not call each other.";
|
|
386
|
+
readonly placeholders: readonly ["name", "cycle"];
|
|
387
|
+
};
|
|
388
|
+
readonly OS2006: {
|
|
389
|
+
readonly code: "OS2006";
|
|
390
|
+
readonly title: "Assignment to a loop variable";
|
|
391
|
+
readonly severity: "error";
|
|
392
|
+
readonly stage: "check";
|
|
393
|
+
readonly since: 1;
|
|
394
|
+
readonly autofix: false;
|
|
395
|
+
readonly message: "{name} is this loop's variable and cannot be assigned inside the body.";
|
|
396
|
+
readonly fix: "Use break to leave early, or keep a separate name for the value the body changes.";
|
|
397
|
+
readonly placeholders: readonly ["name"];
|
|
398
|
+
};
|
|
399
|
+
readonly OS2007: {
|
|
400
|
+
readonly code: "OS2007";
|
|
401
|
+
readonly title: "The file has no declaration";
|
|
402
|
+
readonly severity: "error";
|
|
403
|
+
readonly stage: "check";
|
|
404
|
+
readonly since: 1;
|
|
405
|
+
readonly autofix: false;
|
|
406
|
+
readonly message: "A file needs one study() or strategy() declaration before any other statement.";
|
|
407
|
+
readonly fix: "Add study(\"Name\") as the first statement, or strategy(\"Name\") if the file places orders.";
|
|
408
|
+
readonly placeholders: readonly [];
|
|
409
|
+
};
|
|
410
|
+
readonly OS2008: {
|
|
411
|
+
readonly code: "OS2008";
|
|
412
|
+
readonly title: "More than one declaration";
|
|
413
|
+
readonly severity: "error";
|
|
414
|
+
readonly stage: "check";
|
|
415
|
+
readonly since: 1;
|
|
416
|
+
readonly autofix: false;
|
|
417
|
+
readonly message: "This file already declares {kind} at line {line}.";
|
|
418
|
+
readonly fix: "Delete this declaration and move the options you wanted onto the one at line {line}.";
|
|
419
|
+
readonly placeholders: readonly ["kind", "line"];
|
|
420
|
+
};
|
|
421
|
+
readonly OS2009: {
|
|
422
|
+
readonly code: "OS2009";
|
|
423
|
+
readonly title: "Unknown member of a namespace";
|
|
424
|
+
readonly severity: "error";
|
|
425
|
+
readonly stage: "check";
|
|
426
|
+
readonly since: 1;
|
|
427
|
+
readonly autofix: false;
|
|
428
|
+
readonly message: "{namespace} has no member named {member}.";
|
|
429
|
+
readonly fix: "Use one of {namespace}'s members; {suggestion} is the closest match to what was written.";
|
|
430
|
+
readonly placeholders: readonly ["namespace", "member", "suggestion"];
|
|
431
|
+
};
|
|
432
|
+
readonly OS2010: {
|
|
433
|
+
readonly code: "OS2010";
|
|
434
|
+
readonly title: "This name is not a function";
|
|
435
|
+
readonly severity: "error";
|
|
436
|
+
readonly stage: "check";
|
|
437
|
+
readonly since: 1;
|
|
438
|
+
readonly autofix: false;
|
|
439
|
+
readonly message: "{name} is {type}, not a function, so it cannot be called.";
|
|
440
|
+
readonly fix: "Remove the argument list to read the value, or call the function that was meant: {suggestion}.";
|
|
441
|
+
readonly placeholders: readonly ["name", "type", "suggestion"];
|
|
442
|
+
};
|
|
443
|
+
readonly OS2011: {
|
|
444
|
+
readonly code: "OS2011";
|
|
445
|
+
readonly title: "A condition must be a bool";
|
|
446
|
+
readonly severity: "error";
|
|
447
|
+
readonly stage: "check";
|
|
448
|
+
readonly since: 1;
|
|
449
|
+
readonly autofix: false;
|
|
450
|
+
readonly message: "This condition is {type}; a condition must be bool or none.";
|
|
451
|
+
readonly fix: "Write the test out: {name} > 0 for a count, isNone({name}) for absence, {name} != \"\" for a string.";
|
|
452
|
+
readonly placeholders: readonly ["type", "name"];
|
|
453
|
+
};
|
|
454
|
+
readonly OS2012: {
|
|
455
|
+
readonly code: "OS2012";
|
|
456
|
+
readonly title: "The two arms of the ternary have different types";
|
|
457
|
+
readonly severity: "error";
|
|
458
|
+
readonly stage: "check";
|
|
459
|
+
readonly since: 1;
|
|
460
|
+
readonly autofix: false;
|
|
461
|
+
readonly message: "The arms of this ? : are {leftType} and {rightType}.";
|
|
462
|
+
readonly fix: "Make both arms the same type with text() or number(), or use none for the empty arm.";
|
|
463
|
+
readonly placeholders: readonly ["leftType", "rightType"];
|
|
464
|
+
};
|
|
465
|
+
readonly OS2013: {
|
|
466
|
+
readonly code: "OS2013";
|
|
467
|
+
readonly title: "An array literal mixes types";
|
|
468
|
+
readonly severity: "error";
|
|
469
|
+
readonly stage: "check";
|
|
470
|
+
readonly since: 1;
|
|
471
|
+
readonly autofix: false;
|
|
472
|
+
readonly message: "This array holds {firstType} at index 0 and {otherType} at index {index}.";
|
|
473
|
+
readonly fix: "Make every element {firstType}, or keep two arrays and index them together.";
|
|
474
|
+
readonly placeholders: readonly ["firstType", "otherType", "index"];
|
|
475
|
+
};
|
|
476
|
+
readonly OS2014: {
|
|
477
|
+
readonly code: "OS2014";
|
|
478
|
+
readonly title: "A function cannot be used as a value";
|
|
479
|
+
readonly severity: "error";
|
|
480
|
+
readonly stage: "check";
|
|
481
|
+
readonly since: 1;
|
|
482
|
+
readonly autofix: false;
|
|
483
|
+
readonly message: "{name} is a function, and version 1 has no function values.";
|
|
484
|
+
readonly fix: "Call {name} with its arguments and use the value it returns.";
|
|
485
|
+
readonly placeholders: readonly ["name"];
|
|
486
|
+
};
|
|
487
|
+
readonly OS2015: {
|
|
488
|
+
readonly code: "OS2015";
|
|
489
|
+
readonly title: "The element type of this empty array is unknown";
|
|
490
|
+
readonly severity: "error";
|
|
491
|
+
readonly stage: "check";
|
|
492
|
+
readonly since: 1;
|
|
493
|
+
readonly autofix: false;
|
|
494
|
+
readonly message: "An empty array literal needs its element type from an annotation or from a first use.";
|
|
495
|
+
readonly fix: "Annotate the declaration, var hits: array<number> = [], or put the first element in with push(), unshift(), insert() or set() and let the type be read from that call.";
|
|
496
|
+
readonly placeholders: readonly [];
|
|
497
|
+
};
|
|
498
|
+
readonly OS2016: {
|
|
499
|
+
readonly code: "OS2016";
|
|
500
|
+
readonly title: "Unknown type in an annotation";
|
|
501
|
+
readonly severity: "error";
|
|
502
|
+
readonly stage: "check";
|
|
503
|
+
readonly since: 1;
|
|
504
|
+
readonly autofix: false;
|
|
505
|
+
readonly message: "{type} is not a type.";
|
|
506
|
+
readonly fix: "Use number, string, bool, color, array<T>, or an object type (line, label, box, polyline, table), with series in front for a per-bar value.";
|
|
507
|
+
readonly placeholders: readonly ["type"];
|
|
508
|
+
};
|
|
509
|
+
readonly OS2017: {
|
|
510
|
+
readonly code: "OS2017";
|
|
511
|
+
readonly title: "A function with this name is already declared";
|
|
512
|
+
readonly severity: "error";
|
|
513
|
+
readonly stage: "check";
|
|
514
|
+
readonly since: 1;
|
|
515
|
+
readonly autofix: false;
|
|
516
|
+
readonly message: "{name} is already declared as a function at line {line}.";
|
|
517
|
+
readonly fix: "Rename one of them, or give the one function a default argument that covers both uses.";
|
|
518
|
+
readonly placeholders: readonly ["name", "line"];
|
|
519
|
+
};
|
|
520
|
+
readonly OS2018: {
|
|
521
|
+
readonly code: "OS2018";
|
|
522
|
+
readonly title: "Duplicate parameter name";
|
|
523
|
+
readonly severity: "error";
|
|
524
|
+
readonly stage: "check";
|
|
525
|
+
readonly since: 1;
|
|
526
|
+
readonly autofix: false;
|
|
527
|
+
readonly message: "{name} appears twice in this parameter list.";
|
|
528
|
+
readonly fix: "Rename the second parameter, so every name in the list appears once.";
|
|
529
|
+
readonly placeholders: readonly ["name"];
|
|
530
|
+
};
|
|
531
|
+
readonly OS2019: {
|
|
532
|
+
readonly code: "OS2019";
|
|
533
|
+
readonly title: "This type cannot be an array element";
|
|
534
|
+
readonly severity: "error";
|
|
535
|
+
readonly stage: "check";
|
|
536
|
+
readonly since: 1;
|
|
537
|
+
readonly autofix: false;
|
|
538
|
+
readonly message: "array<{type}> is not a type: {type} cannot be an array element.";
|
|
539
|
+
readonly fix: "Use an element type an array holds: number, string, bool, color, line, label, box, polyline or table. A plot cannot be kept anywhere, so declare each plot at the top level and give it its own name.";
|
|
540
|
+
readonly placeholders: readonly ["type"];
|
|
541
|
+
};
|
|
542
|
+
readonly OS3001: {
|
|
543
|
+
readonly code: "OS3001";
|
|
544
|
+
readonly title: "Wrong number of arguments";
|
|
545
|
+
readonly severity: "error";
|
|
546
|
+
readonly stage: "check";
|
|
547
|
+
readonly since: 1;
|
|
548
|
+
readonly autofix: false;
|
|
549
|
+
readonly message: "{name} takes {expected} arguments and {found} were given.";
|
|
550
|
+
readonly fix: "Pass the arguments the signature names: {signature}.";
|
|
551
|
+
readonly placeholders: readonly ["name", "expected", "found", "signature"];
|
|
552
|
+
};
|
|
553
|
+
readonly OS3002: {
|
|
554
|
+
readonly code: "OS3002";
|
|
555
|
+
readonly title: "Unknown named argument";
|
|
556
|
+
readonly severity: "error";
|
|
557
|
+
readonly stage: "check";
|
|
558
|
+
readonly since: 1;
|
|
559
|
+
readonly autofix: false;
|
|
560
|
+
readonly message: "{name} has no argument called {argument}.";
|
|
561
|
+
readonly fix: "Use one of {names}; {suggestion} is the closest to what was written.";
|
|
562
|
+
readonly placeholders: readonly ["name", "argument", "names", "suggestion"];
|
|
563
|
+
};
|
|
564
|
+
readonly OS3003: {
|
|
565
|
+
readonly code: "OS3003";
|
|
566
|
+
readonly title: "This option must be a constant";
|
|
567
|
+
readonly severity: "error";
|
|
568
|
+
readonly stage: "check";
|
|
569
|
+
readonly since: 1;
|
|
570
|
+
readonly autofix: false;
|
|
571
|
+
readonly message: "{option} is read once, before the first bar, so it cannot depend on bar data.";
|
|
572
|
+
readonly fix: "Use a literal, or make it tunable with an input(): {option} = input(2, \"{option}\").";
|
|
573
|
+
readonly placeholders: readonly ["option"];
|
|
574
|
+
};
|
|
575
|
+
readonly OS3004: {
|
|
576
|
+
readonly code: "OS3004";
|
|
577
|
+
readonly title: "Argument is not a valid whole number";
|
|
578
|
+
readonly severity: "error";
|
|
579
|
+
readonly stage: "check";
|
|
580
|
+
readonly since: 1;
|
|
581
|
+
readonly autofix: false;
|
|
582
|
+
readonly message: "{name}'s {argument} must be a whole number {range}; {found} was given.";
|
|
583
|
+
readonly fix: "Pass a whole number inside {range}, and wrap a computed value in floor() or round().";
|
|
584
|
+
readonly placeholders: readonly ["name", "argument", "range", "found"];
|
|
585
|
+
};
|
|
586
|
+
readonly OS3005: {
|
|
587
|
+
readonly code: "OS3005";
|
|
588
|
+
readonly title: "Positional argument after a named one";
|
|
589
|
+
readonly severity: "error";
|
|
590
|
+
readonly stage: "check";
|
|
591
|
+
readonly since: 1;
|
|
592
|
+
readonly autofix: false;
|
|
593
|
+
readonly message: "A positional argument cannot follow a named one.";
|
|
594
|
+
readonly fix: "Name this argument too, or move it in front of the first named argument.";
|
|
595
|
+
readonly placeholders: readonly [];
|
|
596
|
+
};
|
|
597
|
+
readonly OS3006: {
|
|
598
|
+
readonly code: "OS3006";
|
|
599
|
+
readonly title: "This call must be at the top level";
|
|
600
|
+
readonly severity: "error";
|
|
601
|
+
readonly stage: "check";
|
|
602
|
+
readonly since: 1;
|
|
603
|
+
readonly autofix: false;
|
|
604
|
+
readonly message: "{name} defines part of the study's fixed shape and cannot appear inside {construct}.";
|
|
605
|
+
readonly fix: "Move the call to the top level and hide it per bar by passing none: plot(cond ? value : none, ...). Inside a request expression, read the value first and draw with it afterwards. A leg is not hidden by passing none: declare it at the top level and decide per bar whether to send it an order.";
|
|
606
|
+
readonly placeholders: readonly ["name", "construct"];
|
|
607
|
+
};
|
|
608
|
+
readonly OS3007: {
|
|
609
|
+
readonly code: "OS3007";
|
|
610
|
+
readonly title: "input() must be at the top level";
|
|
611
|
+
readonly severity: "error";
|
|
612
|
+
readonly stage: "check";
|
|
613
|
+
readonly since: 1;
|
|
614
|
+
readonly autofix: false;
|
|
615
|
+
readonly message: "input() builds one row of the settings dialog, which is read once before the first bar.";
|
|
616
|
+
readonly fix: "Move the input() to the top level and use the name it assigns inside the block.";
|
|
617
|
+
readonly placeholders: readonly [];
|
|
618
|
+
};
|
|
619
|
+
readonly OS3008: {
|
|
620
|
+
readonly code: "OS3008";
|
|
621
|
+
readonly title: "The value is not valid for this parameter";
|
|
622
|
+
readonly severity: "error";
|
|
623
|
+
readonly stage: "check";
|
|
624
|
+
readonly since: 1;
|
|
625
|
+
readonly autofix: false;
|
|
626
|
+
readonly message: "{argument} accepts {values}; {found} is not one of them.";
|
|
627
|
+
readonly fix: "Use one of {values}; {suggestion} is the closest to what was written.";
|
|
628
|
+
readonly placeholders: readonly ["argument", "values", "found", "suggestion"];
|
|
629
|
+
};
|
|
630
|
+
readonly OS3009: {
|
|
631
|
+
readonly code: "OS3009";
|
|
632
|
+
readonly title: "This option needs another option to be set";
|
|
633
|
+
readonly severity: "error";
|
|
634
|
+
readonly stage: "check";
|
|
635
|
+
readonly since: 1;
|
|
636
|
+
readonly autofix: false;
|
|
637
|
+
readonly message: "{option} = {value} requires {required}.";
|
|
638
|
+
readonly fix: "Set {required} in the declaration, or choose a value of {option} that stands on its own.";
|
|
639
|
+
readonly placeholders: readonly ["option", "value", "required"];
|
|
640
|
+
};
|
|
641
|
+
readonly OS3010: {
|
|
642
|
+
readonly code: "OS3010";
|
|
643
|
+
readonly title: "Two arguments that cannot both be given";
|
|
644
|
+
readonly severity: "error";
|
|
645
|
+
readonly stage: "check";
|
|
646
|
+
readonly since: 1;
|
|
647
|
+
readonly autofix: false;
|
|
648
|
+
readonly message: "{first} and {second} set the same thing two ways.";
|
|
649
|
+
readonly fix: "Keep one of the two: an absolute price or a distance from the entry, one colour for the whole band or a colour for each side, and on a leg described as a future neither right nor strikeOffset.";
|
|
650
|
+
readonly placeholders: readonly ["first", "second"];
|
|
651
|
+
};
|
|
652
|
+
readonly OS3011: {
|
|
653
|
+
readonly code: "OS3011";
|
|
654
|
+
readonly title: "Argument has the wrong type";
|
|
655
|
+
readonly severity: "error";
|
|
656
|
+
readonly stage: "check";
|
|
657
|
+
readonly since: 1;
|
|
658
|
+
readonly autofix: false;
|
|
659
|
+
readonly message: "{name}'s {argument} is {expected}; {found} was given.";
|
|
660
|
+
readonly fix: "Convert the value with text(), number() or bool(), or pass an expression of type {expected}.";
|
|
661
|
+
readonly placeholders: readonly ["name", "argument", "expected", "found"];
|
|
662
|
+
};
|
|
663
|
+
readonly OS3012: {
|
|
664
|
+
readonly code: "OS3012";
|
|
665
|
+
readonly title: "A required argument is missing";
|
|
666
|
+
readonly severity: "error";
|
|
667
|
+
readonly stage: "check";
|
|
668
|
+
readonly since: 1;
|
|
669
|
+
readonly autofix: false;
|
|
670
|
+
readonly message: "{name} requires {argument}, which has no default.";
|
|
671
|
+
readonly fix: "Pass {argument} at the call site, as the example shows: {example}.";
|
|
672
|
+
readonly placeholders: readonly ["name", "argument", "example"];
|
|
673
|
+
};
|
|
674
|
+
readonly OS3013: {
|
|
675
|
+
readonly code: "OS3013";
|
|
676
|
+
readonly title: "Argument given twice";
|
|
677
|
+
readonly severity: "error";
|
|
678
|
+
readonly stage: "check";
|
|
679
|
+
readonly since: 1;
|
|
680
|
+
readonly autofix: false;
|
|
681
|
+
readonly message: "{argument} is given twice at this call site.";
|
|
682
|
+
readonly fix: "Delete one of the two, keeping the value that was meant.";
|
|
683
|
+
readonly placeholders: readonly ["argument"];
|
|
684
|
+
};
|
|
685
|
+
readonly OS3014: {
|
|
686
|
+
readonly code: "OS3014";
|
|
687
|
+
readonly title: "limits() is in the wrong place";
|
|
688
|
+
readonly severity: "error";
|
|
689
|
+
readonly stage: "check";
|
|
690
|
+
readonly since: 1;
|
|
691
|
+
readonly autofix: false;
|
|
692
|
+
readonly message: "limits() appears at most once, immediately after the declaration; this one is at line {line}.";
|
|
693
|
+
readonly fix: "Move the limits() line directly under study(...) or strategy(...), and merge two calls into one.";
|
|
694
|
+
readonly placeholders: readonly ["line"];
|
|
695
|
+
};
|
|
696
|
+
readonly OS3015: {
|
|
697
|
+
readonly code: "OS3015";
|
|
698
|
+
readonly title: "limits() takes literal numbers";
|
|
699
|
+
readonly severity: "error";
|
|
700
|
+
readonly stage: "check";
|
|
701
|
+
readonly since: 1;
|
|
702
|
+
readonly autofix: false;
|
|
703
|
+
readonly message: "limits() is read before the first bar, so {option} must be a literal number.";
|
|
704
|
+
readonly fix: "Write the number: limits(loops = 50_000_000).";
|
|
705
|
+
readonly placeholders: readonly ["option"];
|
|
706
|
+
};
|
|
707
|
+
readonly OS3016: {
|
|
708
|
+
readonly code: "OS3016";
|
|
709
|
+
readonly title: "range must be a low and a high";
|
|
710
|
+
readonly severity: "error";
|
|
711
|
+
readonly stage: "check";
|
|
712
|
+
readonly since: 1;
|
|
713
|
+
readonly autofix: false;
|
|
714
|
+
readonly message: "range is [{low}, {high}]; it takes two numbers and the first must be below the second.";
|
|
715
|
+
readonly fix: "Write two numbers, lowest first: range = [0, 100].";
|
|
716
|
+
readonly placeholders: readonly ["low", "high"];
|
|
717
|
+
};
|
|
718
|
+
readonly OS3017: {
|
|
719
|
+
readonly code: "OS3017";
|
|
720
|
+
readonly title: "Two of these share a name";
|
|
721
|
+
readonly severity: "error";
|
|
722
|
+
readonly stage: "check";
|
|
723
|
+
readonly since: 1;
|
|
724
|
+
readonly autofix: false;
|
|
725
|
+
readonly message: "{kind} names must be unique in a file; {name} is also used at line {line}.";
|
|
726
|
+
readonly fix: "Rename one of them so each name appears once.";
|
|
727
|
+
readonly placeholders: readonly ["kind", "name", "line"];
|
|
728
|
+
};
|
|
729
|
+
readonly OS3018: {
|
|
730
|
+
readonly code: "OS3018";
|
|
731
|
+
readonly title: "The default is not in the options list";
|
|
732
|
+
readonly severity: "error";
|
|
733
|
+
readonly stage: "check";
|
|
734
|
+
readonly since: 1;
|
|
735
|
+
readonly autofix: false;
|
|
736
|
+
readonly message: "This input's default {default} is not one of options {values}.";
|
|
737
|
+
readonly fix: "Add {default} to options, or make the default one of the listed values.";
|
|
738
|
+
readonly placeholders: readonly ["default", "values"];
|
|
739
|
+
};
|
|
740
|
+
readonly OS3019: {
|
|
741
|
+
readonly code: "OS3019";
|
|
742
|
+
readonly title: "A declaration handle in an object argument";
|
|
743
|
+
readonly severity: "error";
|
|
744
|
+
readonly stage: "check";
|
|
745
|
+
readonly since: 1;
|
|
746
|
+
readonly autofix: false;
|
|
747
|
+
readonly message: "{name}'s {argument} is {expected}; {found} is a declaration handle, which has no value at run time.";
|
|
748
|
+
readonly fix: "Pass an object the script created with draw.line(), draw.box() or draw.label(), and change a plot's own appearance through the arguments of the plot call instead.";
|
|
749
|
+
readonly placeholders: readonly ["name", "argument", "expected", "found"];
|
|
750
|
+
};
|
|
751
|
+
readonly OS3020: {
|
|
752
|
+
readonly code: "OS3020";
|
|
753
|
+
readonly title: "fill needs two declared plots";
|
|
754
|
+
readonly severity: "error";
|
|
755
|
+
readonly stage: "check";
|
|
756
|
+
readonly since: 1;
|
|
757
|
+
readonly autofix: false;
|
|
758
|
+
readonly message: "fill's {argument} is {found}; it takes a plot declared by plot() or plotCandles().";
|
|
759
|
+
readonly fix: "Plot both edges at the top level, name each one, and pass the two names to fill().";
|
|
760
|
+
readonly placeholders: readonly ["argument", "found"];
|
|
761
|
+
};
|
|
762
|
+
readonly OS4001: {
|
|
763
|
+
readonly code: "OS4001";
|
|
764
|
+
readonly title: "History index is not usable";
|
|
765
|
+
readonly severity: "error";
|
|
766
|
+
readonly stage: "runtime";
|
|
767
|
+
readonly since: 1;
|
|
768
|
+
readonly autofix: false;
|
|
769
|
+
readonly message: "[{index}] is not a whole number of bars at or above zero.";
|
|
770
|
+
readonly fix: "Wrap the index in floor() or round(), and clamp a computed index with max(0, n).";
|
|
771
|
+
readonly placeholders: readonly ["index"];
|
|
772
|
+
};
|
|
773
|
+
readonly OS4002: {
|
|
774
|
+
readonly code: "OS4002";
|
|
775
|
+
readonly title: "History index is deeper than the retained depth";
|
|
776
|
+
readonly severity: "error";
|
|
777
|
+
readonly stage: "runtime";
|
|
778
|
+
readonly since: 1;
|
|
779
|
+
readonly autofix: false;
|
|
780
|
+
readonly message: "[{index}] reaches past the retained depth of {depth} bars.";
|
|
781
|
+
readonly fix: "Raise the depth in one place: limits(history = {suggested}).";
|
|
782
|
+
readonly placeholders: readonly ["index", "depth", "suggested"];
|
|
783
|
+
};
|
|
784
|
+
readonly OS4003: {
|
|
785
|
+
readonly code: "OS4003";
|
|
786
|
+
readonly title: "A whole number was required here";
|
|
787
|
+
readonly severity: "error";
|
|
788
|
+
readonly stage: "runtime";
|
|
789
|
+
readonly since: 1;
|
|
790
|
+
readonly autofix: false;
|
|
791
|
+
readonly message: "{name}'s {argument} was {found} on this bar; a whole number was required.";
|
|
792
|
+
readonly fix: "Round the value before passing it: floor() towards zero, round() to nearest.";
|
|
793
|
+
readonly placeholders: readonly ["name", "argument", "found"];
|
|
794
|
+
};
|
|
795
|
+
readonly OS4004: {
|
|
796
|
+
readonly code: "OS4004";
|
|
797
|
+
readonly title: "Array index out of range";
|
|
798
|
+
readonly severity: "error";
|
|
799
|
+
readonly stage: "runtime";
|
|
800
|
+
readonly since: 1;
|
|
801
|
+
readonly autofix: false;
|
|
802
|
+
readonly message: "Index {index} is outside {name}, which holds {size} elements.";
|
|
803
|
+
readonly fix: "Guard the read with size({name}), and index from size({name}) - 1 for the last element.";
|
|
804
|
+
readonly placeholders: readonly ["index", "name", "size"];
|
|
805
|
+
};
|
|
806
|
+
readonly OS4005: {
|
|
807
|
+
readonly code: "OS4005";
|
|
808
|
+
readonly title: "The drawing object no longer exists";
|
|
809
|
+
readonly severity: "error";
|
|
810
|
+
readonly stage: "runtime";
|
|
811
|
+
readonly since: 1;
|
|
812
|
+
readonly autofix: false;
|
|
813
|
+
readonly message: "This {kind} was deleted on bar {bar} and cannot be changed.";
|
|
814
|
+
readonly fix: "Assign none to the name on the same path as the delete, and test isNone() on it before changing the object.";
|
|
815
|
+
readonly placeholders: readonly ["kind", "bar"];
|
|
816
|
+
};
|
|
817
|
+
readonly OS4006: {
|
|
818
|
+
readonly code: "OS4006";
|
|
819
|
+
readonly title: "The array is empty";
|
|
820
|
+
readonly severity: "error";
|
|
821
|
+
readonly stage: "runtime";
|
|
822
|
+
readonly since: 1;
|
|
823
|
+
readonly autofix: false;
|
|
824
|
+
readonly message: "{name} cannot take an element from an empty array.";
|
|
825
|
+
readonly fix: "Test size(arr) > 0 before the call.";
|
|
826
|
+
readonly placeholders: readonly ["name"];
|
|
827
|
+
};
|
|
828
|
+
readonly OS4007: {
|
|
829
|
+
readonly code: "OS4007";
|
|
830
|
+
readonly title: "Slice range is invalid";
|
|
831
|
+
readonly severity: "error";
|
|
832
|
+
readonly stage: "runtime";
|
|
833
|
+
readonly since: 1;
|
|
834
|
+
readonly autofix: false;
|
|
835
|
+
readonly message: "slice({from}, {to}) is not a range inside an array of {size} elements.";
|
|
836
|
+
readonly fix: "Clamp the bounds: from = max(0, from) and to = min(size(arr), to), with from at or below to.";
|
|
837
|
+
readonly placeholders: readonly ["from", "to", "size"];
|
|
838
|
+
};
|
|
839
|
+
readonly OS4008: {
|
|
840
|
+
readonly code: "OS4008";
|
|
841
|
+
readonly title: "Table cell is outside the table";
|
|
842
|
+
readonly severity: "error";
|
|
843
|
+
readonly stage: "runtime";
|
|
844
|
+
readonly since: 1;
|
|
845
|
+
readonly autofix: false;
|
|
846
|
+
readonly message: "Cell ({row}, {column}) is outside a table of {rows} rows and {columns} columns.";
|
|
847
|
+
readonly fix: "Declare the table with the shape the script writes: table(\"Summary\", {rows}, {columns}).";
|
|
848
|
+
readonly placeholders: readonly ["row", "column", "rows", "columns"];
|
|
849
|
+
};
|
|
850
|
+
readonly OS4009: {
|
|
851
|
+
readonly code: "OS4009";
|
|
852
|
+
readonly title: "Colour channel is out of range";
|
|
853
|
+
readonly severity: "error";
|
|
854
|
+
readonly stage: "runtime";
|
|
855
|
+
readonly since: 1;
|
|
856
|
+
readonly autofix: false;
|
|
857
|
+
readonly message: "{name}'s {argument} is {found}; channels run 0 to 255 and alpha runs 0 to 1.";
|
|
858
|
+
readonly fix: "Clamp the value where it is computed: rgb(min(255, max(0, r)), g, b).";
|
|
859
|
+
readonly placeholders: readonly ["name", "argument", "found"];
|
|
860
|
+
};
|
|
861
|
+
readonly OS4010: {
|
|
862
|
+
readonly code: "OS4010";
|
|
863
|
+
readonly title: "Calendar field is out of range";
|
|
864
|
+
readonly severity: "error";
|
|
865
|
+
readonly stage: "runtime";
|
|
866
|
+
readonly since: 1;
|
|
867
|
+
readonly autofix: false;
|
|
868
|
+
readonly message: "{field} is {found}; it runs {range}.";
|
|
869
|
+
readonly fix: "Pass a value inside {range}, carrying the overflow into the field above it as the example does.";
|
|
870
|
+
readonly placeholders: readonly ["field", "found", "range"];
|
|
871
|
+
};
|
|
872
|
+
readonly OS4011: {
|
|
873
|
+
readonly code: "OS4011";
|
|
874
|
+
readonly title: "String position is outside the string";
|
|
875
|
+
readonly severity: "error";
|
|
876
|
+
readonly stage: "runtime";
|
|
877
|
+
readonly since: 1;
|
|
878
|
+
readonly autofix: false;
|
|
879
|
+
readonly message: "Position {index} is outside a string of {length} characters.";
|
|
880
|
+
readonly fix: "Guard with str.length(s), or clamp the position with min() before the call.";
|
|
881
|
+
readonly placeholders: readonly ["index", "length"];
|
|
882
|
+
};
|
|
883
|
+
readonly OS4012: {
|
|
884
|
+
readonly code: "OS4012";
|
|
885
|
+
readonly title: "That value is not one of the accepted names";
|
|
886
|
+
readonly severity: "error";
|
|
887
|
+
readonly stage: "runtime";
|
|
888
|
+
readonly since: 1;
|
|
889
|
+
readonly autofix: false;
|
|
890
|
+
readonly message: "{argument} accepts {values}; {found} was computed on this bar.";
|
|
891
|
+
readonly fix: "Produce the value from an input() with an options list, so only accepted names can reach the call.";
|
|
892
|
+
readonly placeholders: readonly ["argument", "values", "found"];
|
|
893
|
+
};
|
|
894
|
+
readonly OS4013: {
|
|
895
|
+
readonly code: "OS4013";
|
|
896
|
+
readonly title: "A loop bound is absent";
|
|
897
|
+
readonly severity: "error";
|
|
898
|
+
readonly stage: "runtime";
|
|
899
|
+
readonly since: 1;
|
|
900
|
+
readonly autofix: false;
|
|
901
|
+
readonly message: "This loop's {bound} is absent on this bar.";
|
|
902
|
+
readonly fix: "Give the bound a value with orElse(), or guard the loop with isNone() so a warmup bar skips it deliberately.";
|
|
903
|
+
readonly placeholders: readonly ["bound"];
|
|
904
|
+
};
|
|
905
|
+
readonly OS5001: {
|
|
906
|
+
readonly code: "OS5001";
|
|
907
|
+
readonly title: "Loop budget exhausted";
|
|
908
|
+
readonly severity: "error";
|
|
909
|
+
readonly stage: "runtime";
|
|
910
|
+
readonly since: 1;
|
|
911
|
+
readonly autofix: false;
|
|
912
|
+
readonly message: "This bar used its {budget} loop iterations, and the loop at line {line} was still running.";
|
|
913
|
+
readonly fix: "Fix the exit condition, or raise the budget in one line: limits(loops = {suggested}).";
|
|
914
|
+
readonly placeholders: readonly ["budget", "line", "suggested"];
|
|
915
|
+
};
|
|
916
|
+
readonly OS5002: {
|
|
917
|
+
readonly code: "OS5002";
|
|
918
|
+
readonly title: "The array is too large";
|
|
919
|
+
readonly severity: "error";
|
|
920
|
+
readonly stage: "runtime";
|
|
921
|
+
readonly since: 1;
|
|
922
|
+
readonly autofix: false;
|
|
923
|
+
readonly message: "An array holds at most {max} elements; {name} reached {size}.";
|
|
924
|
+
readonly fix: "Drop the oldest element as you append: if size(arr) > 500, shift(arr).";
|
|
925
|
+
readonly placeholders: readonly ["max", "name", "size"];
|
|
926
|
+
};
|
|
927
|
+
readonly OS5003: {
|
|
928
|
+
readonly code: "OS5003";
|
|
929
|
+
readonly title: "The host refused this limits() value";
|
|
930
|
+
readonly severity: "error";
|
|
931
|
+
readonly stage: "host";
|
|
932
|
+
readonly since: 1;
|
|
933
|
+
readonly autofix: false;
|
|
934
|
+
readonly message: "This host allows {option} up to {max}; the file asks for {found}.";
|
|
935
|
+
readonly fix: "Lower {option} to {max} or below, or run the file on a host that allows more.";
|
|
936
|
+
readonly placeholders: readonly ["option", "max", "found"];
|
|
937
|
+
};
|
|
938
|
+
readonly OS5004: {
|
|
939
|
+
readonly code: "OS5004";
|
|
940
|
+
readonly title: "The program needs more state regions than the engine allows";
|
|
941
|
+
readonly severity: "error";
|
|
942
|
+
readonly stage: "check";
|
|
943
|
+
readonly since: 1;
|
|
944
|
+
readonly autofix: false;
|
|
945
|
+
readonly message: "This program needs {found} state regions and the engine allows {max}; {first} calls {second} on several paths.";
|
|
946
|
+
readonly fix: "Call the inner function once at the top level, give its result a name, and pass that name down.";
|
|
947
|
+
readonly placeholders: readonly ["found", "max", "first", "second"];
|
|
948
|
+
};
|
|
949
|
+
readonly OS5005: {
|
|
950
|
+
readonly code: "OS5005";
|
|
951
|
+
readonly title: "Nesting is too deep";
|
|
952
|
+
readonly severity: "error";
|
|
953
|
+
readonly stage: "parse";
|
|
954
|
+
readonly since: 1;
|
|
955
|
+
readonly autofix: false;
|
|
956
|
+
readonly message: "{construct} is nested {found} deep and the ceiling is {max}.";
|
|
957
|
+
readonly fix: "Flatten it: give the inner expression a name at the top level and use the name.";
|
|
958
|
+
readonly placeholders: readonly ["construct", "found", "max"];
|
|
959
|
+
};
|
|
960
|
+
readonly OS5006: {
|
|
961
|
+
readonly code: "OS5006";
|
|
962
|
+
readonly title: "Too many outstanding data requests";
|
|
963
|
+
readonly severity: "error";
|
|
964
|
+
readonly stage: "host";
|
|
965
|
+
readonly since: 1;
|
|
966
|
+
readonly autofix: false;
|
|
967
|
+
readonly message: "This file makes {found} data requests and the host allows {max}.";
|
|
968
|
+
readonly fix: "Keep one request per symbol and timeframe, reuse the name it assigns, and delete the requests whose results are unused.";
|
|
969
|
+
readonly placeholders: readonly ["found", "max"];
|
|
970
|
+
};
|
|
971
|
+
readonly OS5007: {
|
|
972
|
+
readonly code: "OS5007";
|
|
973
|
+
readonly title: "The bar took too long";
|
|
974
|
+
readonly severity: "error";
|
|
975
|
+
readonly stage: "host";
|
|
976
|
+
readonly since: 1;
|
|
977
|
+
readonly autofix: false;
|
|
978
|
+
readonly message: "Bar {bar} ran for {ms} ms and the host allows {max} ms.";
|
|
979
|
+
readonly fix: "Keep a running value in a var and update it per bar instead of recomputing over the whole history.";
|
|
980
|
+
readonly placeholders: readonly ["bar", "ms", "max"];
|
|
981
|
+
};
|
|
982
|
+
readonly OS5008: {
|
|
983
|
+
readonly code: "OS5008";
|
|
984
|
+
readonly title: "The string is too long";
|
|
985
|
+
readonly severity: "error";
|
|
986
|
+
readonly stage: "runtime";
|
|
987
|
+
readonly since: 1;
|
|
988
|
+
readonly autofix: false;
|
|
989
|
+
readonly message: "A string holds at most {max} characters; this one reached {found}.";
|
|
990
|
+
readonly fix: "Keep the pieces in an array, trim it to the rows you display, and join only those.";
|
|
991
|
+
readonly placeholders: readonly ["max", "found"];
|
|
992
|
+
};
|
|
993
|
+
readonly OS5009: {
|
|
994
|
+
readonly code: "OS5009";
|
|
995
|
+
readonly title: "The program is too large";
|
|
996
|
+
readonly severity: "error";
|
|
997
|
+
readonly stage: "check";
|
|
998
|
+
readonly since: 1;
|
|
999
|
+
readonly autofix: false;
|
|
1000
|
+
readonly message: "This file compiles to {found} instructions and the ceiling is {max}.";
|
|
1001
|
+
readonly fix: "Move the repeated block into a fn and call it, and delete branches the script no longer uses.";
|
|
1002
|
+
readonly placeholders: readonly ["found", "max"];
|
|
1003
|
+
};
|
|
1004
|
+
readonly OS6001: {
|
|
1005
|
+
readonly code: "OS6001";
|
|
1006
|
+
readonly title: "Unknown timeframe";
|
|
1007
|
+
readonly severity: "error";
|
|
1008
|
+
readonly stage: "check";
|
|
1009
|
+
readonly since: 1;
|
|
1010
|
+
readonly autofix: false;
|
|
1011
|
+
readonly message: "{value} is not a timeframe.";
|
|
1012
|
+
readonly fix: "Write a count and a unit, or a bare number of minutes: \"5m\", \"1h\", \"1D\", \"1W\", \"60\".";
|
|
1013
|
+
readonly placeholders: readonly ["value"];
|
|
1014
|
+
};
|
|
1015
|
+
readonly OS6002: {
|
|
1016
|
+
readonly code: "OS6002";
|
|
1017
|
+
readonly title: "The requested timeframe is lower than the chart's";
|
|
1018
|
+
readonly severity: "error";
|
|
1019
|
+
readonly stage: "host";
|
|
1020
|
+
readonly since: 1;
|
|
1021
|
+
readonly autofix: false;
|
|
1022
|
+
readonly message: "The chart is {chart} and the request asks for {requested}.";
|
|
1023
|
+
readonly fix: "Request {chart} or higher, or change the chart's interval to the lower one and fold upwards instead.";
|
|
1024
|
+
readonly placeholders: readonly ["chart", "requested"];
|
|
1025
|
+
};
|
|
1026
|
+
readonly OS6003: {
|
|
1027
|
+
readonly code: "OS6003";
|
|
1028
|
+
readonly title: "A per-bar name inside a request expression";
|
|
1029
|
+
readonly severity: "error";
|
|
1030
|
+
readonly stage: "check";
|
|
1031
|
+
readonly since: 1;
|
|
1032
|
+
readonly autofix: false;
|
|
1033
|
+
readonly message: "{name} is computed on this chart's bars, so it has no meaning on the requested ones.";
|
|
1034
|
+
readonly fix: "Move the calculation inside the request expression, or pass a constant: a literal or an input().";
|
|
1035
|
+
readonly placeholders: readonly ["name"];
|
|
1036
|
+
};
|
|
1037
|
+
readonly OS6004: {
|
|
1038
|
+
readonly code: "OS6004";
|
|
1039
|
+
readonly title: "The library manifest disagrees with the program";
|
|
1040
|
+
readonly severity: "error";
|
|
1041
|
+
readonly stage: "host";
|
|
1042
|
+
readonly since: 1;
|
|
1043
|
+
readonly autofix: false;
|
|
1044
|
+
readonly message: "Entry {index} of the program names {name} with {arity} arguments; this engine's manifest has {manifest}.";
|
|
1045
|
+
readonly fix: "Recompile the script against this engine's library, or run the program on an engine with the library version it was compiled against.";
|
|
1046
|
+
readonly placeholders: readonly ["index", "name", "arity", "manifest"];
|
|
1047
|
+
};
|
|
1048
|
+
readonly OS6005: {
|
|
1049
|
+
readonly code: "OS6005";
|
|
1050
|
+
readonly title: "Unknown timezone";
|
|
1051
|
+
readonly severity: "error";
|
|
1052
|
+
readonly stage: "host";
|
|
1053
|
+
readonly since: 1;
|
|
1054
|
+
readonly autofix: false;
|
|
1055
|
+
readonly message: "{value} is not a timezone this host knows.";
|
|
1056
|
+
readonly fix: "Use a full area and location name from the host's list, or leave the argument out to use the chart's own timezone.";
|
|
1057
|
+
readonly placeholders: readonly ["value"];
|
|
1058
|
+
};
|
|
1059
|
+
readonly OS6006: {
|
|
1060
|
+
readonly code: "OS6006";
|
|
1061
|
+
readonly title: "The engine lacks a capability the program requires";
|
|
1062
|
+
readonly severity: "error";
|
|
1063
|
+
readonly stage: "host";
|
|
1064
|
+
readonly since: 1;
|
|
1065
|
+
readonly autofix: false;
|
|
1066
|
+
readonly message: "This program requires {tag} and this engine does not have it.";
|
|
1067
|
+
readonly fix: "Run the program on an engine that has {tag}, or remove the feature that needs it: the tag names it.";
|
|
1068
|
+
readonly placeholders: readonly ["tag"];
|
|
1069
|
+
};
|
|
1070
|
+
readonly OS6007: {
|
|
1071
|
+
readonly code: "OS6007";
|
|
1072
|
+
readonly title: "Unknown symbol or exchange";
|
|
1073
|
+
readonly severity: "error";
|
|
1074
|
+
readonly stage: "host";
|
|
1075
|
+
readonly since: 1;
|
|
1076
|
+
readonly autofix: false;
|
|
1077
|
+
readonly message: "The host does not know {symbol} on {exchange}.";
|
|
1078
|
+
readonly fix: "Correct the symbol, and name the exchange it trades on when it is not the chart's: req.symbol(\"SYMBOL\", \"1D\", close, exchange = \"EXCHANGE\").";
|
|
1079
|
+
readonly placeholders: readonly ["symbol", "exchange"];
|
|
1080
|
+
};
|
|
1081
|
+
readonly OS6008: {
|
|
1082
|
+
readonly code: "OS6008";
|
|
1083
|
+
readonly title: "The request returned no bars";
|
|
1084
|
+
readonly severity: "error";
|
|
1085
|
+
readonly stage: "host";
|
|
1086
|
+
readonly since: 1;
|
|
1087
|
+
readonly autofix: false;
|
|
1088
|
+
readonly message: "{symbol} at {timeframe} returned no bars over the range this chart covers.";
|
|
1089
|
+
readonly fix: "Move the chart's range into the period the instrument traded, or request a symbol that covers it.";
|
|
1090
|
+
readonly placeholders: readonly ["symbol", "timeframe"];
|
|
1091
|
+
};
|
|
1092
|
+
readonly OS6009: {
|
|
1093
|
+
readonly code: "OS6009";
|
|
1094
|
+
readonly title: "The request failed";
|
|
1095
|
+
readonly severity: "error";
|
|
1096
|
+
readonly stage: "host";
|
|
1097
|
+
readonly since: 1;
|
|
1098
|
+
readonly autofix: false;
|
|
1099
|
+
readonly message: "The host could not fetch {symbol} at {timeframe}: {reason}.";
|
|
1100
|
+
readonly fix: "Act on {reason} in the host: it is a connection, permission or quota problem. Where the value can be derived from the chart's own bars, derive it and drop the request.";
|
|
1101
|
+
readonly placeholders: readonly ["symbol", "timeframe", "reason"];
|
|
1102
|
+
};
|
|
1103
|
+
readonly OS6010: {
|
|
1104
|
+
readonly code: "OS6010";
|
|
1105
|
+
readonly title: "The engine was given no bars";
|
|
1106
|
+
readonly severity: "error";
|
|
1107
|
+
readonly stage: "host";
|
|
1108
|
+
readonly since: 1;
|
|
1109
|
+
readonly autofix: false;
|
|
1110
|
+
readonly message: "There are no bars for {symbol} at {timeframe}, so the script cannot run.";
|
|
1111
|
+
readonly fix: "Choose an instrument and interval that have history, or widen the chart's date range until bars exist.";
|
|
1112
|
+
readonly placeholders: readonly ["symbol", "timeframe"];
|
|
1113
|
+
};
|
|
1114
|
+
readonly OS6011: {
|
|
1115
|
+
readonly code: "OS6011";
|
|
1116
|
+
readonly title: "The bars are not in order";
|
|
1117
|
+
readonly severity: "error";
|
|
1118
|
+
readonly stage: "host";
|
|
1119
|
+
readonly since: 1;
|
|
1120
|
+
readonly autofix: false;
|
|
1121
|
+
readonly message: "Bar {index} is dated {time}, which is not after bar {previous}.";
|
|
1122
|
+
readonly fix: "Reload the history; if the same bar repeats, the feed is sending duplicates and the host has to sort and deduplicate the bars before the engine runs.";
|
|
1123
|
+
readonly placeholders: readonly ["index", "time", "previous"];
|
|
1124
|
+
};
|
|
1125
|
+
readonly OS6012: {
|
|
1126
|
+
readonly code: "OS6012";
|
|
1127
|
+
readonly title: "An instrument fact is not known";
|
|
1128
|
+
readonly severity: "error";
|
|
1129
|
+
readonly stage: "host";
|
|
1130
|
+
readonly since: 1;
|
|
1131
|
+
readonly autofix: false;
|
|
1132
|
+
readonly message: "The host did not supply {fact} for {symbol}.";
|
|
1133
|
+
readonly fix: "Supply {fact} in the host's instrument record, or stop depending on it: round with a number the script chooses rather than chart.tickSize.";
|
|
1134
|
+
readonly placeholders: readonly ["fact", "symbol"];
|
|
1135
|
+
};
|
|
1136
|
+
readonly OS6013: {
|
|
1137
|
+
readonly code: "OS6013";
|
|
1138
|
+
readonly title: "The request changed after the first bar";
|
|
1139
|
+
readonly severity: "error";
|
|
1140
|
+
readonly stage: "runtime";
|
|
1141
|
+
readonly since: 1;
|
|
1142
|
+
readonly autofix: false;
|
|
1143
|
+
readonly message: "This request asked for {first} on bar 0 and for {found} on bar {bar}.";
|
|
1144
|
+
readonly fix: "Compute the symbol and the timeframe from literals or inputs, not from bar data.";
|
|
1145
|
+
readonly placeholders: readonly ["first", "found", "bar"];
|
|
1146
|
+
};
|
|
1147
|
+
readonly OS6014: {
|
|
1148
|
+
readonly code: "OS6014";
|
|
1149
|
+
readonly title: "The feed does not offer this timeframe";
|
|
1150
|
+
readonly severity: "error";
|
|
1151
|
+
readonly stage: "host";
|
|
1152
|
+
readonly since: 1;
|
|
1153
|
+
readonly autofix: false;
|
|
1154
|
+
readonly message: "The host has no {timeframe} data for {symbol}; it offers {available}.";
|
|
1155
|
+
readonly fix: "Request one of {available}, or derive the interval you want from a lower one the host does serve.";
|
|
1156
|
+
readonly placeholders: readonly ["timeframe", "symbol", "available"];
|
|
1157
|
+
};
|
|
1158
|
+
readonly OS6015: {
|
|
1159
|
+
readonly code: "OS6015";
|
|
1160
|
+
readonly title: "The requested timeframe does not fold into the chart's";
|
|
1161
|
+
readonly severity: "error";
|
|
1162
|
+
readonly stage: "host";
|
|
1163
|
+
readonly since: 1;
|
|
1164
|
+
readonly autofix: false;
|
|
1165
|
+
readonly message: "{requested} is not a whole multiple of {chart}.";
|
|
1166
|
+
readonly fix: "Request a multiple of {chart}, for example {suggestion}.";
|
|
1167
|
+
readonly placeholders: readonly ["requested", "chart", "suggestion"];
|
|
1168
|
+
};
|
|
1169
|
+
readonly OS6016: {
|
|
1170
|
+
readonly code: "OS6016";
|
|
1171
|
+
readonly title: "The compiled format version is not one this engine implements";
|
|
1172
|
+
readonly severity: "error";
|
|
1173
|
+
readonly stage: "host";
|
|
1174
|
+
readonly since: 1;
|
|
1175
|
+
readonly autofix: false;
|
|
1176
|
+
readonly message: "This program is in compiled format {found} and this engine implements up to {max}.";
|
|
1177
|
+
readonly fix: "Run the program on an engine that implements format {found}, or recompile the source with a compiler that emits format {max}.";
|
|
1178
|
+
readonly placeholders: readonly ["found", "max"];
|
|
1179
|
+
};
|
|
1180
|
+
readonly OS6017: {
|
|
1181
|
+
readonly code: "OS6017";
|
|
1182
|
+
readonly title: "The program's language version is not one this engine implements";
|
|
1183
|
+
readonly severity: "error";
|
|
1184
|
+
readonly stage: "host";
|
|
1185
|
+
readonly since: 1;
|
|
1186
|
+
readonly autofix: false;
|
|
1187
|
+
readonly message: "This program was compiled from language version {found}, and this engine implements {versions}.";
|
|
1188
|
+
readonly fix: "Upgrade the engine to one that implements language version {found}, or recompile the source against a version it has.";
|
|
1189
|
+
readonly placeholders: readonly ["found", "versions"];
|
|
1190
|
+
};
|
|
1191
|
+
readonly OS6018: {
|
|
1192
|
+
readonly code: "OS6018";
|
|
1193
|
+
readonly title: "The compiled program is malformed";
|
|
1194
|
+
readonly severity: "error";
|
|
1195
|
+
readonly stage: "host";
|
|
1196
|
+
readonly since: 1;
|
|
1197
|
+
readonly autofix: false;
|
|
1198
|
+
readonly message: "The program failed verification at {location}: {reason}.";
|
|
1199
|
+
readonly fix: "Recompile the script from its source; a program that fails verification came from a broken compiler or was edited after it was written, and neither is repairable by hand.";
|
|
1200
|
+
readonly placeholders: readonly ["location", "reason"];
|
|
1201
|
+
};
|
|
1202
|
+
readonly OS6019: {
|
|
1203
|
+
readonly code: "OS6019";
|
|
1204
|
+
readonly title: "A host setting fails the input's validation";
|
|
1205
|
+
readonly severity: "error";
|
|
1206
|
+
readonly stage: "host";
|
|
1207
|
+
readonly since: 1;
|
|
1208
|
+
readonly autofix: false;
|
|
1209
|
+
readonly message: "The host supplied {value} for {key}, and {validation}.";
|
|
1210
|
+
readonly fix: "Correct the value in the settings dialog, or widen the input's own min, max or options so the value is allowed.";
|
|
1211
|
+
readonly placeholders: readonly ["value", "key", "validation"];
|
|
1212
|
+
};
|
|
1213
|
+
readonly OS7001: {
|
|
1214
|
+
readonly code: "OS7001";
|
|
1215
|
+
readonly title: "Only a strategy can do that";
|
|
1216
|
+
readonly severity: "error";
|
|
1217
|
+
readonly stage: "check";
|
|
1218
|
+
readonly since: 1;
|
|
1219
|
+
readonly autofix: false;
|
|
1220
|
+
readonly message: "{name} is available only in a file declared with strategy().";
|
|
1221
|
+
readonly fix: "Change study(...) on line {line} to strategy(...), or replace {name} with signal(\"...\") to mark the bar without trading.";
|
|
1222
|
+
readonly placeholders: readonly ["name", "line"];
|
|
1223
|
+
};
|
|
1224
|
+
readonly OS7002: {
|
|
1225
|
+
readonly code: "OS7002";
|
|
1226
|
+
readonly title: "An order argument is absent";
|
|
1227
|
+
readonly severity: "error";
|
|
1228
|
+
readonly stage: "runtime";
|
|
1229
|
+
readonly since: 1;
|
|
1230
|
+
readonly autofix: false;
|
|
1231
|
+
readonly message: "{name}'s {argument} is absent on this bar.";
|
|
1232
|
+
readonly fix: "Guard the call with isNone({argument}), or supply a fallback with orElse() where one is genuinely correct.";
|
|
1233
|
+
readonly placeholders: readonly ["name", "argument"];
|
|
1234
|
+
};
|
|
1235
|
+
readonly OS7003: {
|
|
1236
|
+
readonly code: "OS7003";
|
|
1237
|
+
readonly title: "An order function inside a request expression";
|
|
1238
|
+
readonly severity: "error";
|
|
1239
|
+
readonly stage: "check";
|
|
1240
|
+
readonly since: 1;
|
|
1241
|
+
readonly autofix: false;
|
|
1242
|
+
readonly message: "{name} inside a request expression would place an order from another instrument's bars.";
|
|
1243
|
+
readonly fix: "Read the value with the request, and place the order at the top level from the result.";
|
|
1244
|
+
readonly placeholders: readonly ["name"];
|
|
1245
|
+
};
|
|
1246
|
+
readonly OS7004: {
|
|
1247
|
+
readonly code: "OS7004";
|
|
1248
|
+
readonly title: "Order quantity is zero or negative";
|
|
1249
|
+
readonly severity: "error";
|
|
1250
|
+
readonly stage: "runtime";
|
|
1251
|
+
readonly since: 1;
|
|
1252
|
+
readonly autofix: false;
|
|
1253
|
+
readonly message: "{name} was given a quantity of {qty}.";
|
|
1254
|
+
readonly fix: "Pass a positive quantity, guard the call with a size test, and use sell() to go the other way.";
|
|
1255
|
+
readonly placeholders: readonly ["name", "qty"];
|
|
1256
|
+
};
|
|
1257
|
+
readonly OS7005: {
|
|
1258
|
+
readonly code: "OS7005";
|
|
1259
|
+
readonly title: "Quantity is not a multiple of the lot size";
|
|
1260
|
+
readonly severity: "error";
|
|
1261
|
+
readonly stage: "runtime";
|
|
1262
|
+
readonly since: 1;
|
|
1263
|
+
readonly autofix: false;
|
|
1264
|
+
readonly message: "{symbol} trades in lots of {lot}, and {qty} is not a multiple of it.";
|
|
1265
|
+
readonly fix: "Size in lots: declare qtyType = \"lots\" and pass the lot count, or round a computed size with order.roundToLot().";
|
|
1266
|
+
readonly placeholders: readonly ["symbol", "lot", "qty"];
|
|
1267
|
+
};
|
|
1268
|
+
readonly OS7006: {
|
|
1269
|
+
readonly code: "OS7006";
|
|
1270
|
+
readonly title: "Price is not on a tick";
|
|
1271
|
+
readonly severity: "error";
|
|
1272
|
+
readonly stage: "runtime";
|
|
1273
|
+
readonly since: 1;
|
|
1274
|
+
readonly autofix: false;
|
|
1275
|
+
readonly message: "{symbol} ticks at {tick}, and {price} does not fall on one.";
|
|
1276
|
+
readonly fix: "Round to the tick before passing the price: round(price / chart.tickSize) * chart.tickSize.";
|
|
1277
|
+
readonly placeholders: readonly ["symbol", "tick", "price"];
|
|
1278
|
+
};
|
|
1279
|
+
readonly OS7007: {
|
|
1280
|
+
readonly code: "OS7007";
|
|
1281
|
+
readonly title: "A resting order has no price";
|
|
1282
|
+
readonly severity: "error";
|
|
1283
|
+
readonly stage: "runtime";
|
|
1284
|
+
readonly since: 1;
|
|
1285
|
+
readonly autofix: false;
|
|
1286
|
+
readonly message: "A {type} order needs {argument}, and none was given.";
|
|
1287
|
+
readonly fix: "Pass {argument}, or leave the type as market and let the order fill at the next price.";
|
|
1288
|
+
readonly placeholders: readonly ["type", "argument"];
|
|
1289
|
+
};
|
|
1290
|
+
readonly OS7008: {
|
|
1291
|
+
readonly code: "OS7008";
|
|
1292
|
+
readonly title: "The entry was refused by pyramiding";
|
|
1293
|
+
readonly severity: "error";
|
|
1294
|
+
readonly stage: "runtime";
|
|
1295
|
+
readonly since: 1;
|
|
1296
|
+
readonly autofix: false;
|
|
1297
|
+
readonly message: "This strategy allows {max} entries in one direction and already holds {found}.";
|
|
1298
|
+
readonly fix: "Raise pyramiding in the declaration, or test pos.size before entering again.";
|
|
1299
|
+
readonly placeholders: readonly ["max", "found"];
|
|
1300
|
+
};
|
|
1301
|
+
readonly OS7009: {
|
|
1302
|
+
readonly code: "OS7009";
|
|
1303
|
+
readonly title: "Unknown order tag";
|
|
1304
|
+
readonly severity: "error";
|
|
1305
|
+
readonly stage: "runtime";
|
|
1306
|
+
readonly since: 1;
|
|
1307
|
+
readonly autofix: false;
|
|
1308
|
+
readonly message: "There is no working order tagged {tag}.";
|
|
1309
|
+
readonly fix: "Use the tag the order was placed with, and test order.working({tag}) before acting on it.";
|
|
1310
|
+
readonly placeholders: readonly ["tag"];
|
|
1311
|
+
};
|
|
1312
|
+
readonly OS7010: {
|
|
1313
|
+
readonly code: "OS7010";
|
|
1314
|
+
readonly title: "A bracket price is on the wrong side of the entry";
|
|
1315
|
+
readonly severity: "error";
|
|
1316
|
+
readonly stage: "runtime";
|
|
1317
|
+
readonly since: 1;
|
|
1318
|
+
readonly autofix: false;
|
|
1319
|
+
readonly message: "A {side} entry at {entry} cannot take a {leg} at {price}.";
|
|
1320
|
+
readonly fix: "Put the stop below a long entry and the limit above it, and swap the two for a short.";
|
|
1321
|
+
readonly placeholders: readonly ["side", "entry", "leg", "price"];
|
|
1322
|
+
};
|
|
1323
|
+
readonly OS7011: {
|
|
1324
|
+
readonly code: "OS7011";
|
|
1325
|
+
readonly title: "The order needs more capital than the strategy has";
|
|
1326
|
+
readonly severity: "error";
|
|
1327
|
+
readonly stage: "runtime";
|
|
1328
|
+
readonly since: 1;
|
|
1329
|
+
readonly autofix: false;
|
|
1330
|
+
readonly message: "This order needs {required} and the strategy has {available}.";
|
|
1331
|
+
readonly fix: "Size from equity with qtyType = \"equityPercent\", or test pos.equity before entering.";
|
|
1332
|
+
readonly placeholders: readonly ["required", "available"];
|
|
1333
|
+
};
|
|
1334
|
+
readonly OS7012: {
|
|
1335
|
+
readonly code: "OS7012";
|
|
1336
|
+
readonly title: "The instrument is outside its session";
|
|
1337
|
+
readonly severity: "error";
|
|
1338
|
+
readonly stage: "runtime";
|
|
1339
|
+
readonly since: 1;
|
|
1340
|
+
readonly autofix: false;
|
|
1341
|
+
readonly message: "{symbol} is outside its trading session at {time}.";
|
|
1342
|
+
readonly fix: "Guard entries with session.isOpen, and set closeOnSessionEnd = true to flatten at the close.";
|
|
1343
|
+
readonly placeholders: readonly ["symbol", "time"];
|
|
1344
|
+
};
|
|
1345
|
+
readonly OS7013: {
|
|
1346
|
+
readonly code: "OS7013";
|
|
1347
|
+
readonly title: "Two opposite orders on one bar";
|
|
1348
|
+
readonly severity: "error";
|
|
1349
|
+
readonly stage: "runtime";
|
|
1350
|
+
readonly since: 1;
|
|
1351
|
+
readonly autofix: false;
|
|
1352
|
+
readonly message: "{first} and {second} were both placed on bar {bar}.";
|
|
1353
|
+
readonly fix: "Make the conditions exclusive with else if, or place the exit on this bar and the entry on the next.";
|
|
1354
|
+
readonly placeholders: readonly ["first", "second", "bar"];
|
|
1355
|
+
};
|
|
1356
|
+
readonly OS7014: {
|
|
1357
|
+
readonly code: "OS7014";
|
|
1358
|
+
readonly title: "The destination rejected the order";
|
|
1359
|
+
readonly severity: "error";
|
|
1360
|
+
readonly stage: "host";
|
|
1361
|
+
readonly since: 1;
|
|
1362
|
+
readonly autofix: false;
|
|
1363
|
+
readonly message: "The order destination rejected {name}: {reason}.";
|
|
1364
|
+
readonly fix: "Act on {reason}: it comes from the destination, not from the script, and the same order will be rejected again until the account or the order changes.";
|
|
1365
|
+
readonly placeholders: readonly ["name", "reason"];
|
|
1366
|
+
};
|
|
1367
|
+
readonly OS7015: {
|
|
1368
|
+
readonly code: "OS7015";
|
|
1369
|
+
readonly title: "The strategy has no order destination";
|
|
1370
|
+
readonly severity: "error";
|
|
1371
|
+
readonly stage: "host";
|
|
1372
|
+
readonly since: 1;
|
|
1373
|
+
readonly autofix: false;
|
|
1374
|
+
readonly message: "This strategy placed an order and the host supplied no destination.";
|
|
1375
|
+
readonly fix: "Connect a destination in the host, or run the file as a study(): replace buy() with signal(\"BUY\").";
|
|
1376
|
+
readonly placeholders: readonly [];
|
|
1377
|
+
};
|
|
1378
|
+
readonly OS8001: {
|
|
1379
|
+
readonly code: "OS8001";
|
|
1380
|
+
readonly title: "A stateful call inside a branch";
|
|
1381
|
+
readonly severity: "warning";
|
|
1382
|
+
readonly stage: "check";
|
|
1383
|
+
readonly since: 1;
|
|
1384
|
+
readonly autofix: false;
|
|
1385
|
+
readonly message: "{name} advances only on the bars where this branch runs, and is absent on the rest.";
|
|
1386
|
+
readonly fix: "Compute it unconditionally at the top level and use the result inside the branch.";
|
|
1387
|
+
readonly placeholders: readonly ["name"];
|
|
1388
|
+
};
|
|
1389
|
+
readonly OS8002: {
|
|
1390
|
+
readonly code: "OS8002";
|
|
1391
|
+
readonly title: "A higher timeframe read with onUnconfirmed";
|
|
1392
|
+
readonly severity: "warning";
|
|
1393
|
+
readonly stage: "check";
|
|
1394
|
+
readonly since: 1;
|
|
1395
|
+
readonly autofix: false;
|
|
1396
|
+
readonly message: "This file sets onUnconfirmed = true and reads {timeframe}; together they repaint.";
|
|
1397
|
+
readonly fix: "Drop onUnconfirmed = true, or guard every use of the read with bar.isConfirmed.";
|
|
1398
|
+
readonly placeholders: readonly ["timeframe"];
|
|
1399
|
+
};
|
|
1400
|
+
readonly OS8003: {
|
|
1401
|
+
readonly code: "OS8003";
|
|
1402
|
+
readonly title: "No version declaration";
|
|
1403
|
+
readonly severity: "warning";
|
|
1404
|
+
readonly stage: "check";
|
|
1405
|
+
readonly since: 1;
|
|
1406
|
+
readonly autofix: true;
|
|
1407
|
+
readonly message: "This file declares no language version; it was compiled as version {version}.";
|
|
1408
|
+
readonly fix: "Add version {version} as the first line of the file.";
|
|
1409
|
+
readonly placeholders: readonly ["version"];
|
|
1410
|
+
};
|
|
1411
|
+
readonly OS8004: {
|
|
1412
|
+
readonly code: "OS8004";
|
|
1413
|
+
readonly title: "A branch on an absent condition changes a value used later";
|
|
1414
|
+
readonly severity: "warning";
|
|
1415
|
+
readonly stage: "check";
|
|
1416
|
+
readonly since: 1;
|
|
1417
|
+
readonly autofix: false;
|
|
1418
|
+
readonly message: "{condition} can be absent, and this block assigns {name}, which is read at line {line}.";
|
|
1419
|
+
readonly fix: "Decide what warmup means: test isNone({condition}) explicitly, or give {name} a starting value above the if.";
|
|
1420
|
+
readonly placeholders: readonly ["condition", "name", "line"];
|
|
1421
|
+
};
|
|
1422
|
+
readonly OS8005: {
|
|
1423
|
+
readonly code: "OS8005";
|
|
1424
|
+
readonly title: "A lookahead read";
|
|
1425
|
+
readonly severity: "warning";
|
|
1426
|
+
readonly stage: "check";
|
|
1427
|
+
readonly since: 1;
|
|
1428
|
+
readonly autofix: false;
|
|
1429
|
+
readonly message: "This read uses {mode}, so the study shows values the bar it is drawn on could not have known.";
|
|
1430
|
+
readonly fix: "Drop the mode to take the default, which never repaints, unless the study is deliberately a study of what the higher bar went on to do.";
|
|
1431
|
+
readonly placeholders: readonly ["mode"];
|
|
1432
|
+
};
|
|
1433
|
+
readonly OS8006: {
|
|
1434
|
+
readonly code: "OS8006";
|
|
1435
|
+
readonly title: "A session average on a session-length bar";
|
|
1436
|
+
readonly severity: "warning";
|
|
1437
|
+
readonly stage: "check";
|
|
1438
|
+
readonly since: 1;
|
|
1439
|
+
readonly autofix: false;
|
|
1440
|
+
readonly message: "A session anchored average resets each session, and each bar of {interval} is a whole session, so it equals its source.";
|
|
1441
|
+
readonly fix: "Use an intraday interval for a session anchored average, or plot the source directly and delete the call.";
|
|
1442
|
+
readonly placeholders: readonly ["interval"];
|
|
1443
|
+
};
|
|
1444
|
+
readonly OS8007: {
|
|
1445
|
+
readonly code: "OS8007";
|
|
1446
|
+
readonly title: "A plot sets the price pane's own formatting";
|
|
1447
|
+
readonly severity: "warning";
|
|
1448
|
+
readonly stage: "check";
|
|
1449
|
+
readonly since: 1;
|
|
1450
|
+
readonly autofix: false;
|
|
1451
|
+
readonly message: "{title} sets {option} while drawing over the price pane, which reformats the instrument's own axis.";
|
|
1452
|
+
readonly fix: "Set precision and format in the declaration, for the whole study, or drop them from a plot drawn over the price pane.";
|
|
1453
|
+
readonly placeholders: readonly ["title", "option"];
|
|
1454
|
+
};
|
|
1455
|
+
readonly OS8008: {
|
|
1456
|
+
readonly code: "OS8008";
|
|
1457
|
+
readonly title: "An alert with no id";
|
|
1458
|
+
readonly severity: "warning";
|
|
1459
|
+
readonly stage: "check";
|
|
1460
|
+
readonly since: 1;
|
|
1461
|
+
readonly autofix: false;
|
|
1462
|
+
readonly message: "This alert has no id, so its identity is derived from its position at line {line}.";
|
|
1463
|
+
readonly fix: "Give the alert a stable id of your own: alert(\"text\", id = \"emaCross\").";
|
|
1464
|
+
readonly placeholders: readonly ["line"];
|
|
1465
|
+
};
|
|
1466
|
+
readonly OS8009: {
|
|
1467
|
+
readonly code: "OS8009";
|
|
1468
|
+
readonly title: "This plot can never draw";
|
|
1469
|
+
readonly severity: "warning";
|
|
1470
|
+
readonly stage: "check";
|
|
1471
|
+
readonly since: 1;
|
|
1472
|
+
readonly autofix: false;
|
|
1473
|
+
readonly message: "{title} plots a value that is absent on every bar.";
|
|
1474
|
+
readonly fix: "Plot the value that was meant, or delete the plot and its settings row.";
|
|
1475
|
+
readonly placeholders: readonly ["title"];
|
|
1476
|
+
};
|
|
1477
|
+
readonly OS8010: {
|
|
1478
|
+
readonly code: "OS8010";
|
|
1479
|
+
readonly title: "A name is never read";
|
|
1480
|
+
readonly severity: "warning";
|
|
1481
|
+
readonly stage: "check";
|
|
1482
|
+
readonly since: 1;
|
|
1483
|
+
readonly autofix: false;
|
|
1484
|
+
readonly message: "{name} is assigned at line {line} and never read.";
|
|
1485
|
+
readonly fix: "Use the value, or delete the line.";
|
|
1486
|
+
readonly placeholders: readonly ["name", "line"];
|
|
1487
|
+
};
|
|
1488
|
+
readonly OS8011: {
|
|
1489
|
+
readonly code: "OS8011";
|
|
1490
|
+
readonly title: "live var makes live and backtest differ";
|
|
1491
|
+
readonly severity: "warning";
|
|
1492
|
+
readonly stage: "check";
|
|
1493
|
+
readonly since: 1;
|
|
1494
|
+
readonly autofix: false;
|
|
1495
|
+
readonly message: "{name} is a live var, so it keeps its value across the updates of the moving bar.";
|
|
1496
|
+
readonly fix: "Use var unless counting intrabar updates is the actual intent; keep live var only for that.";
|
|
1497
|
+
readonly placeholders: readonly ["name"];
|
|
1498
|
+
};
|
|
1499
|
+
readonly OS8012: {
|
|
1500
|
+
readonly code: "OS8012";
|
|
1501
|
+
readonly title: "An ordered comparison against none is always absent";
|
|
1502
|
+
readonly severity: "warning";
|
|
1503
|
+
readonly stage: "check";
|
|
1504
|
+
readonly since: 1;
|
|
1505
|
+
readonly autofix: false;
|
|
1506
|
+
readonly message: "This {op} has none on one side, so it is absent on every bar.";
|
|
1507
|
+
readonly fix: "Test absence with isNone(x), or with x == none, both of which are always true or false.";
|
|
1508
|
+
readonly placeholders: readonly ["op"];
|
|
1509
|
+
};
|
|
1510
|
+
readonly OS8013: {
|
|
1511
|
+
readonly code: "OS8013";
|
|
1512
|
+
readonly title: "Deprecated";
|
|
1513
|
+
readonly severity: "warning";
|
|
1514
|
+
readonly stage: "check";
|
|
1515
|
+
readonly since: 1;
|
|
1516
|
+
readonly autofix: true;
|
|
1517
|
+
readonly message: "{name} is deprecated since language version {version}; {replacement} does the same thing.";
|
|
1518
|
+
readonly fix: "Replace {name} with {replacement}; the two compute the same values.";
|
|
1519
|
+
readonly placeholders: readonly ["name", "version", "replacement"];
|
|
1520
|
+
};
|
|
1521
|
+
readonly OS8014: {
|
|
1522
|
+
readonly code: "OS8014";
|
|
1523
|
+
readonly title: "A persistent value holds a bar index";
|
|
1524
|
+
readonly severity: "warning";
|
|
1525
|
+
readonly stage: "check";
|
|
1526
|
+
readonly since: 1;
|
|
1527
|
+
readonly autofix: false;
|
|
1528
|
+
readonly message: "{name} keeps a bar index across bars, and every index shifts when more history loads.";
|
|
1529
|
+
readonly fix: "Store time instead and compare timestamps; the bar's time does not move.";
|
|
1530
|
+
readonly placeholders: readonly ["name"];
|
|
1531
|
+
};
|
|
1532
|
+
readonly OS8015: {
|
|
1533
|
+
readonly code: "OS8015";
|
|
1534
|
+
readonly title: "This loop never runs";
|
|
1535
|
+
readonly severity: "warning";
|
|
1536
|
+
readonly stage: "check";
|
|
1537
|
+
readonly since: 1;
|
|
1538
|
+
readonly autofix: false;
|
|
1539
|
+
readonly message: "The loop starts at {start}, ends at {end} and steps {step}, so the body never runs.";
|
|
1540
|
+
readonly fix: "Add step -1 to count down, or swap the bounds to count up.";
|
|
1541
|
+
readonly placeholders: readonly ["start", "end", "step"];
|
|
1542
|
+
};
|
|
1543
|
+
readonly OS8016: {
|
|
1544
|
+
readonly code: "OS8016";
|
|
1545
|
+
readonly title: "Unreachable code";
|
|
1546
|
+
readonly severity: "warning";
|
|
1547
|
+
readonly stage: "check";
|
|
1548
|
+
readonly since: 1;
|
|
1549
|
+
readonly autofix: false;
|
|
1550
|
+
readonly message: "Line {line} follows a return that always runs, so it never executes.";
|
|
1551
|
+
readonly fix: "Delete the unreachable lines, or move them above the return.";
|
|
1552
|
+
readonly placeholders: readonly ["line"];
|
|
1553
|
+
};
|
|
1554
|
+
readonly OS8017: {
|
|
1555
|
+
readonly code: "OS8017";
|
|
1556
|
+
readonly title: "The condition is constant";
|
|
1557
|
+
readonly severity: "warning";
|
|
1558
|
+
readonly stage: "check";
|
|
1559
|
+
readonly since: 1;
|
|
1560
|
+
readonly autofix: false;
|
|
1561
|
+
readonly message: "This condition is {value} on every bar.";
|
|
1562
|
+
readonly fix: "Restore the test that was meant, or delete the branch that never runs.";
|
|
1563
|
+
readonly placeholders: readonly ["value"];
|
|
1564
|
+
};
|
|
1565
|
+
readonly OS8018: {
|
|
1566
|
+
readonly code: "OS8018";
|
|
1567
|
+
readonly title: "An input is never used";
|
|
1568
|
+
readonly severity: "warning";
|
|
1569
|
+
readonly stage: "check";
|
|
1570
|
+
readonly since: 1;
|
|
1571
|
+
readonly autofix: false;
|
|
1572
|
+
readonly message: "The input {title} is declared at line {line} and never read.";
|
|
1573
|
+
readonly fix: "Use the name the input assigns, or delete the input() and its dialog row.";
|
|
1574
|
+
readonly placeholders: readonly ["title", "line"];
|
|
1575
|
+
};
|
|
1576
|
+
readonly OS8019: {
|
|
1577
|
+
readonly code: "OS8019";
|
|
1578
|
+
readonly title: "A deleted object is still held";
|
|
1579
|
+
readonly severity: "warning";
|
|
1580
|
+
readonly stage: "check";
|
|
1581
|
+
readonly since: 1;
|
|
1582
|
+
readonly autofix: false;
|
|
1583
|
+
readonly message: "{name} still holds the {kind} deleted at line {line}.";
|
|
1584
|
+
readonly fix: "Assign none to the name on the same path as the delete, and where the object came out of an array, remove the element as well as deleting the object.";
|
|
1585
|
+
readonly placeholders: readonly ["name", "kind", "line"];
|
|
1586
|
+
};
|
|
1587
|
+
};
|
|
1588
|
+
/** Every code the compiler and the engines may emit. Nothing else is one. */
|
|
1589
|
+
export type DiagnosticCode = keyof typeof ENTRIES;
|
|
1590
|
+
//# sourceMappingURL=catalogue.generated.d.ts.map
|