Skip to main content

euv_cli/fmt/
const.rs

1/// The euv macro name for `html!`.
2pub const MACRO_NAME_HTML: &str = "html";
3
4/// The euv macro name for `class!`.
5pub const MACRO_NAME_CLASS: &str = "class";
6
7/// The euv macro name for `vars!`.
8pub const MACRO_NAME_VARS: &str = "vars";
9
10/// The euv macro name for `watch!`.
11pub const MACRO_NAME_WATCH: &str = "watch";
12
13/// The euv macro names that should be formatted.
14pub const EUV_MACRO_NAMES: &[&str] = &[
15    MACRO_NAME_HTML,
16    MACRO_NAME_CLASS,
17    MACRO_NAME_VARS,
18    MACRO_NAME_WATCH,
19];
20
21/// The Rust `if` keyword string.
22pub const KEYWORD_IF: &str = "if";
23
24/// The Rust `else` keyword string.
25pub const KEYWORD_ELSE: &str = "else";
26
27/// The Rust `match` keyword string.
28pub const KEYWORD_MATCH: &str = "match";
29
30/// The Rust `for` keyword string.
31pub const KEYWORD_FOR: &str = "for";
32
33/// The Rust `in` keyword string.
34pub const KEYWORD_IN: &str = "in";
35
36/// The Rust keywords that can follow a colon in euv macro attribute syntax
37/// (e.g., `class: if { ... }`), indicating an attribute value expression
38/// rather than a CSS selector.
39pub const ATTRIBUTE_VALUE_KEYWORDS: &[&str] = &[KEYWORD_IF, KEYWORD_MATCH, KEYWORD_FOR];
40
41/// The Rust fat arrow operator string.
42pub const ARROW_FAT: &str = "=>";
43
44/// The directory name to skip when scanning for Rust source files (Rust build output).
45pub const TARGET_DIR_NAME: &str = "target";
46
47/// The directory name to skip when scanning for Rust source files (Node.js dependencies).
48pub const NODE_MODULES_DIR_NAME: &str = "node_modules";
49
50/// The Rust source file extension.
51pub const RS_EXTENSION: &str = "rs";
52
53/// The exclamation mark character used to identify macro invocations.
54pub const CHAR_MACRO_BANG: char = '!';
55
56/// The left brace character used to delimit code blocks and macro bodies.
57pub const CHAR_BRACE_LEFT: char = '{';
58
59/// The right brace character used to delimit code blocks and macro bodies.
60pub const CHAR_BRACE_RIGHT: char = '}';
61
62/// The left parenthesis character, used in CSS functional pseudo-class detection.
63pub const CHAR_LEFT_PAREN: char = '(';
64
65/// The right parenthesis character, used in CSS functional pseudo-class detection.
66pub const CHAR_RIGHT_PAREN: char = ')';
67
68/// The double quote character used to delimit string literals.
69pub const CHAR_DOUBLE_QUOTE: char = '"';
70
71/// The single quote character used to delimit character and string literals.
72pub const CHAR_SINGLE_QUOTE: char = '\'';
73
74/// The forward slash character used in comment and path detection.
75pub const CHAR_SLASH_FORWARD: char = '/';
76
77/// The forward slash string used in path normalization.
78pub const STR_SLASH_FORWARD: &str = "/";
79
80/// The backslash character used as escape prefix in string literals.
81pub const CHAR_SLASH_BACK: char = '\\';
82
83/// The underscore character, part of Rust identifiers.
84pub const CHAR_UNDERSCORE: char = '_';
85
86/// The hash character, used in raw identifier prefix detection.
87pub const CHAR_HASH: char = '#';
88
89/// The hyphen character, used in CSS selector identifier detection.
90pub const CHAR_HYPHEN: char = '-';
91
92/// The newline character.
93pub const CHAR_NEWLINE: char = '\n';
94
95/// The carriage return character.
96pub const CHAR_CARRIAGE_RETURN: char = '\r';
97
98/// The tab character.
99pub const CHAR_TAB: char = '\t';
100
101/// The space character.
102pub const CHAR_SPACE: char = ' ';
103
104/// The asterisk character, used in block comment end detection.
105pub const CHAR_ASTERISK: char = '*';
106
107/// The colon character, used in attribute separator formatting.
108pub const CHAR_COLON: char = ':';
109
110/// The equals sign character, used in fat arrow detection.
111pub const CHAR_EQUALS: char = '=';
112
113/// The greater-than character, used in fat arrow detection.
114pub const CHAR_GREATER_THAN: char = '>';
115
116/// The block comment start delimiter.
117pub const BLOCK_COMMENT_START: &str = "/*";
118
119/// The raw identifier prefix string.
120pub const RAW_IDENT_PREFIX: &str = "r#";
121
122/// The letter `a`, used in keyword detection.
123pub const CHAR_LETTER_A: char = 'a';
124
125/// The letter `c`, used in keyword detection.
126pub const CHAR_LETTER_C: char = 'c';
127
128/// The letter `e`, used in keyword detection.
129pub const CHAR_LETTER_E: char = 'e';
130
131/// The letter `f`, used in keyword detection.
132pub const CHAR_LETTER_F: char = 'f';
133
134/// The letter `h`, used in keyword detection.
135pub const CHAR_LETTER_H: char = 'h';
136
137/// The letter `i`, used in keyword detection.
138pub const CHAR_LETTER_I: char = 'i';
139
140/// The letter `l`, used in keyword detection.
141pub const CHAR_LETTER_L: char = 'l';
142
143/// The letter `m`, used in keyword detection.
144pub const CHAR_LETTER_M: char = 'm';
145
146/// The letter `n`, used in keyword detection.
147pub const CHAR_LETTER_N: char = 'n';
148
149/// The letter `o`, used in keyword detection.
150pub const CHAR_LETTER_O: char = 'o';
151
152/// The letter `r`, used in keyword detection.
153pub const CHAR_LETTER_R: char = 'r';
154
155/// The letter `s`, used in keyword detection.
156pub const CHAR_LETTER_S: char = 's';
157
158/// The comma character.
159pub const CHAR_COMMA: char = ',';
160
161/// The semicolon character.
162pub const CHAR_SEMICOLON: char = ';';
163
164/// The letter `t`, used in keyword detection.
165pub const CHAR_LETTER_T: char = 't';