[][src]Trait libslide::diagnostics::DiagnosticRecord

pub trait DiagnosticRecord {
    const CODE: &'static str;
    const EXPLANATION: &'static str;
}

Describes a code and detailed explanation for a diagnostic.

Associated Constants

const CODE: &'static str

Diagnostic code.

const EXPLANATION: &'static str

Detailed diagnostic explanation.

Loading content...

Implementors

impl DiagnosticRecord for ExpectedExpr[src]

impl DiagnosticRecord for ExtraTokens[src]

impl DiagnosticRecord for IllegalPattern[src]

impl DiagnosticRecord for IllegalVariable[src]

impl DiagnosticRecord for MismatchedClosingDelimiter[src]

impl DiagnosticRecord for UnmatchedClosingDelimiter[src]

impl DiagnosticRecord for IncompatibleDefinitions[src]

impl DiagnosticRecord for MaybeIncompatibleDefinitions[src]

impl DiagnosticRecord for InvalidToken[src]

impl<'a> DiagnosticRecord for SimilarNamesLinter<'a>[src]

The similar names lint detects expression patterns with very similar names.

For example, the following pattern expression has different patterns with the same suffix "a":

$a + #a + _a + $a

While this is expression is semantically valid, it can be difficuly to read and misleading, since "a" is used in three separate and independent patterns. A clearer expression would be

$a + #b + _c + $a

impl<'a> DiagnosticRecord for HomogenousAssignmentLinter<'a>[src]

The homogenous assignment lint detects and warns on mixed use of assignment operators.

For example, the following program uses both the equality and assign-define operators to assign variables:

a = 1
b := 1

This can be misleading or confusing, as these two operators are syntactically different (and semantically different in canonical mathematics notation), but are treated the same in slide.

For this reason, it is suggested that exclusively = or := are used for assignments in slide programs.

impl<'a> DiagnosticRecord for RedundantNestingLinter<'a>[src]

The redundant nesting lint detects redundant nesting of expressions in parantheses or brackets.

For example, the following nestings are redundant and can be reduced to a single nesting:

((1))     -> (1)
[[1]]     -> [1]
([[(1)]]) -> (1)

Redundant nestings are difficult to read and may be misleading, as generally a single nesting is expected to host an expression for precedence or clarity reasons.

impl<'a> DiagnosticRecord for UnarySeriesLinter<'a>[src]

The unary series lint detects trivially-reducible chains of unary operators.

For example, the following chains of unary expressions can be reduced to a more trivial form:

---1   -> -1
+++1   ->  1
+-+-+- -> -1

Chaining unary operators is not standard style in mathematical expressions and can be misleading. For example, --x may be interpreted to be the prefix decrement operator available in some computer programming languages, which is absent in canonical mathematical notation.

Loading content...