1use regex::Regex;
4
5#[cfg(feature = "color")]
9pub type ColorDisplayFunc = fn(string: &str, to_file: bool) -> Box<dyn std::fmt::Display>;
10
11pub const LOREM_SOURCE: &str = "Lorem ipsum dolor sit amet consectetur adipiscing elit. In rhoncus sapien iaculis sapien congue a dictum urna malesuada. In hac habitasse platea dictumst. Quisque dapibus justo a mollis condimentum sapien ligula aliquam massa in vehicula tellus magna vitae enim. Aliquam mattis ligula in enim congue auctor. Pellentesque at sollicitudin velit. Quisque blandit lobortis turpis at malesuada. Donec vitae luctus mauris. Aenean efficitur risus id tortor blandit laoreet. Vestibulum commodo aliquam sapien. Cras aliquam eget leo iaculis cursus. Morbi iaculis justo sed tellus ultrices aliquet. Nam bibendum ut erat quis. ";
13
14lazy_static::lazy_static! {
15 pub static ref LOREM: Vec<&'static str> = LOREM_SOURCE.split(' ').collect();
17 pub static ref LOREM_WIDTH: usize = LOREM.len();
19}
20
21pub(crate) fn macro_start(custom: Option<char>) -> char {
25 if let Some(start) = custom {
26 start
27 } else {
28 MACRO_START_CHAR
29 }
30}
31
32pub(crate) fn comment_start(custom: Option<char>) -> char {
36 if let Some(start) = custom {
37 start
38 } else {
39 COMMENT_CHAR
40 }
41}
42
43const MACRO_START_CHAR: char = '$';
46const COMMENT_CHAR: char = '%';
48
49pub const ESCAPE_CHAR: char = '\\';
51pub const LIT_CHAR: char = '*';
53pub const MAIN_CALLER: &str = "@MAIN@";
57
58pub const MACRO_SPECIAL_ANON: &str = "_ANON_";
59
60lazy_static::lazy_static! {
61 pub static ref UNALLOWED_CHARS: Regex = Regex::new(r#"[a-zA-Z1-9\\_\*\^\|\(\)-=,:!]"#).expect("Failed to create regex expression");
66}
67
68#[cfg(feature = "debug")]
70pub const DIFF_SOURCE_FILE: &str = "diff.src";
72#[cfg(feature = "debug")]
73pub const DIFF_OUT_FILE: &str = "diff.out";
75
76#[cfg(windows)]
78pub const LINE_ENDING: &str = "\r\n";
80#[cfg(not(windows))]
81pub const LINE_ENDING: &str = "\n";
83
84#[cfg(windows)]
89pub const PATH_SEPARATOR: &str = "\\\\";
91#[cfg(not(windows))]
92pub const PATH_SEPARATOR: &str = "/";
94
95#[cfg(feature = "debug")]
96pub const RDB_HELP: &str = include_str!("debug_help_message.txt");
98
99pub const ESR: [&str; 0] = [];
101
102pub const DEFINE_KEYWORD: &str = "define";