import "../colours.syncat"; // Keywords "let", "const", "static", "mut", "ref", "move", "dyn", "fn", "struct", "enum", "trait", "impl", "type", "pub", "mod", "extern", "crate", "use", "super", "where", "if", "else", "match", "loop", "for", "while", "return", "in", "async" { color: $keyword; } "unsafe" { color: $error; } closure_parameters > "|" { color: $operator; } remaining_field_pattern > "..", match_arm > "=>", match_pattern > "|" { color: $keyword; } // Imports use_wildcard "*" { color: $keyword; } use_wildcard > identifier, scoped_use_list > identifier, scoped_identifier > identifier & /^[a-z]/ { color: $module; } // Operators "&", "|", "^", unary_expression > "!", "~", "+", "-", "*", "/", "%", ">", "<", "<=", ">=", "==", "!=", "<<", ">>", "&&", "||", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", "^=", "<<=", ">>=", "..", "..=", "?", index_expression > "[", index_expression > "]", { color: $operator; } // Types scoped_type_identifier > identifier & /^[A-Z]/, scoped_identifier > identifier & /^[A-Z]/, use_list > identifier & /^[A-Z]/, type_identifier, primitive_type { color: $type; } // Values lifetime { color: $meta; } boolean_literal, integer_literal, float_literal { color: $value; } string_literal, char_literal, string_literal { color: $string; dim: false; } enum_variant > identifier, identifier & /^[A-Z_][A-Z0-9_]*$/, { color: $constant; } // Patterns match_pattern > identifier { color: $constant; } // Function declaration function_item > identifier, function_signature_item > identifier { color: $function; } function_item > "->", function_type > "->", type_arguments > "<", type_arguments > ">", type_parameters > "<", type_parameters > ">" { color: $operator; } // Function call call_expression > identifier, call_expression > field_expression > field_identifier, call_expression > generic_function > field_expression > field_identifier { color: $function; } // Macro invocation "macro_rules!", macro_definition > identifier, macro_invocation > identifier, macro_invocation > "!" { color: $meta; } inner_attribute_item, attribute_item { color: $meta; dim: true; } // Macro rules token_repetition > "$", token_repetition > "(", token_repetition > ")", token_repetition > "*", token_repetition > "+", token_repetition > "?", token_repetition_pattern > "$", token_repetition_pattern > "(", token_repetition_pattern > ")", token_repetition_pattern > "*", token_repetition_pattern > "+", token_repetition_pattern > "?", { color: $keyword; } macro_rule > "=>" { color: $keyword; } metavariable { color: $variable; } fragment_specifier { color: $type; } // Comments line_comment, block_comment { color: $comment; } // Specific word overrides "Ok", "Err", "Some", "None" { color: $builtin; } "Self", "Self", "Fn", "FnOnce", "FnMut", "_" { color: $keyword; } "self" { color: $variable; }