Diagnostics
Every problem is a diagnostic with a stable code, a message and the span of source it is about. None stops the rest of a file compiling: a value that is wrong is left off, a statement that cannot be written is left out, and the graph draws everything else.
Much of what is reported here is something Desmos would accept without a word - an unknown function name is a product of variables to it, and a colour it cannot read is ignored - which is why Axis says so instead.
Reading the file
Section titled “Reading the file”What the lexer and the parser report. After one of these, the parser picks up again at the next line.
unexpected-character
Section titled “unexpected-character”A character no token starts with.
a = 5 $ 2unterminated-string
Section titled “unterminated-string”A string still open at the end of its line.
"A note that never endsinvalid-escape
Section titled “invalid-escape”A string escape other than \", \\, \n.
"A \q in a note"invalid-color
Section titled “invalid-color”# without exactly 3 or 6 hex digits.
y = x @ color: #12The checker reports the same code for a colour that is not one (§4.3).
y = x @ color: redunexpected-token
Section titled “unexpected-token”A token no rule could use where it stands.
y = x )expected-expression
Section titled “expected-expression”An operand, element or value missing.
y = 2 +unclosed-bracket
Section titled “unclosed-bracket”A (, [, expression { or \| never closed.
y = (x + 1unclosed-block
Section titled “unclosed-block”A block { or @{ never closed.
folder "Waves" { y = sin(x)expected-block
Section titled “expected-block”A block keyword without its {.
folder "Waves"expected-identifier
Section titled “expected-identifier”A style or macro name, a macro parameter, or a member name missing.
style { color: RED }expected-string
Section titled “expected-string”An import path, as title or image source missing.
imageexpected-equals
Section titled “expected-equals”A macro without its =.
macro double(a) 2aexpected-binding
Section titled “expected-binding”with or for not followed by name = value.
y = a x with 3expected-bounds
Section titled “expected-bounds”sum, prod or int not opened with name = from..to.
y = sum(n, n)expected-property
Section titled “expected-property”Metadata or a block entry that does not start with a property name.
y = x @ 3expected-colon
Section titled “expected-colon”A property name followed by something other than : or the next entry.
y = x @ color REDexpected-value
Section titled “expected-value”key: with nothing after it.
y = x @ color:comma-between-properties
Section titled “comma-between-properties”Block entries separated by a comma (§4.1).
config { showGrid: false, xmin: -5 }misplaced-metadata
Section titled “misplaced-metadata”Metadata trailing nothing.
folder "Waves" { y = sin(x) @ collapsed}Checking it
Section titled “Checking it”What the checker and the compiler report about a file that reads, but does not mean anything Desmos can draw.
unknown-function
Section titled “unknown-function”A call on a name that is not a function (§5.3).
y = sine(x)assign-to-builtin
Section titled “assign-to-builtin”Defining or binding a function’s name, an operator, pi, tau, e, infinity, true/false.
pi = 3theta-equation
Section titled “theta-equation”theta = …, which Desmos will not graph - write r = … (§5.5).
theta = 1requires-complex-mode
Section titled “requires-complex-mode”real, imag, conj or arg in a graph without allowComplex: true (§5.3).
a = real(3)requires-calculator
Section titled “requires-calculator”A function or a $ token the calculator the graph is for does not have.
A = (0, 0)B = (4, 1)s = segment(A, B)statement-only
Section titled “statement-only”A chart or a regression ~ anywhere but as a statement of its own.
L = [1, 2, 3]H = histogram(L)misplaced-blank
Section titled “misplaced-blank”An empty slot, [4, , 6], anywhere but a table column’s values.
L = [1, , 3]open-range
Section titled “open-range”A range with an end left off anywhere but an index (L[2...]).
L = [1...]multiple-subscripts
Section titled “multiple-subscripts”A name in an expression with more than one _ part (x_1_2).
a = x_1_2boolean-in-expression
Section titled “boolean-in-expression”true or false in an expression - Desmos has no booleans.
a = true + 1dt-outside-ticker
Section titled “dt-outside-ticker”dt anywhere but the ticker’s handler (or a macro’s body).
a = dtrebound-variable
Section titled “rebound-variable”A sum, prod or int variable already bound where it stands.
f(k) = sum(k = 1..3, k)unexpected-string
Section titled “unexpected-string”A string where a value belongs.
a = "one" + 1unknown-property
Section titled “unknown-property”A property no placement has.
y = x @ colour: REDmisplaced-property
Section titled “misplaced-property”A property this placement does not take, directly or through a style.
folder "Waves" { @ color: RED y = sin(x)}duplicate-property
Section titled “duplicate-property”A property given twice in one clause.
y = x @ color: RED, color: BLUEinvalid-value
Section titled “invalid-value”A value of the wrong type for its property (§4.2).
y = x @ lines: 3invalid-enum
Section titled “invalid-enum”An enum value the property does not list.
y = x @ lineStyle: WAVYunexpected-range
Section titled “unexpected-range”A range for a property that takes none.
y = x @ lineWidth: 1..3invalid-column
Section titled “invalid-column”A table column that is an equation (x = 5).
table { x = 5 }misplaced-config
Section titled “misplaced-config”config inside a folder.
folder "Settings" { config { showGrid: false }}misplaced-ticker
Section titled “misplaced-ticker”ticker inside a folder.
n = 0folder "Clock" { ticker n -> n + 1}misplaced-style
Section titled “misplaced-style”style inside a folder.
folder "Styles" { style thick { lineWidth: 5 }}misplaced-macro
Section titled “misplaced-macro”macro inside a folder.
folder "Macros" { macro double(a) = 2a}nested-folder
Section titled “nested-folder”A folder inside a folder.
folder "Outer" { folder "Inner" { y = x }}duplicate-config
Section titled “duplicate-config”A second config in one file.
config { showGrid: false }config { showGrid: true }duplicate-ticker
Section titled “duplicate-ticker”A second ticker in one file.
n = 0ticker n -> n + 1ticker n -> n - 1duplicate-macro
Section titled “duplicate-macro”A second macro of one name anywhere in the compilation.
macro double(a) = 2amacro double(a) = a + amacro-collision
Section titled “macro-collision”A macro named after a builtin, a function or a variable.
macro sin(a) = amacro-arity
Section titled “macro-arity”A macro used with the wrong number of arguments, or with or without () wrongly.
macro double(a) = 2ay = double(x, 1)macro-recursion
Section titled “macro-recursion”A macro that expands into itself.
macro loop(a) = loop(a) + 1y = loop(x)duplicate-style
Section titled “duplicate-style”A second style of one name anywhere in the compilation.
style thick { lineWidth: 5 }style thick { lineWidth: 8 }unknown-style
Section titled “unknown-style”use: naming no style.
y = x @ use: boldstyle-cycle
Section titled “style-cycle”A style that uses itself, reported at the use: that closes the loop.
style a { use: b }style b { use: a }unresolved-import
Section titled “unresolved-import”An import that cannot be read.
import "./lib/missing"import-cycle
Section titled “import-cycle”An import that closes a cycle.
import "./graph"unresolved-image
Section titled “unresolved-image”An image file that cannot be read.
image "./images/missing.png"invalid-image
Section titled “invalid-image”An image path that is not a picture by its extension.
image "./notes.txt"Decompiling a graph
Section titled “Decompiling a graph”What the decompiler reports, as warnings, about a graph it cannot write all of in Axis. The statement is still written, with a comment where the part it could not was.
| Code | What |
|---|---|
unsupported-latex | Latex the expression tree has no node for. |
unsupported-item | A list item Axis has no statement for, or an image with no URL. |
unsupported-value | A colour or enum value Axis cannot write. |