aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/yellow
diff options
context:
space:
mode:
authorAdolfo OchagavĂ­a <[email protected]>2018-11-11 19:27:00 +0000
committerAdolfo OchagavĂ­a <[email protected]>2018-11-11 19:27:00 +0000
commitc258b4fdb0e421813330c2428985c4537c787582 (patch)
treee53263f28c0cd07911a1e9c9ef6538c8ff0227fd /crates/ra_syntax/src/yellow
parenta4f7d7a7cd85a5b9b64a935dd84ad493b6860236 (diff)
Add validator for byte
Diffstat (limited to 'crates/ra_syntax/src/yellow')
-rw-r--r--crates/ra_syntax/src/yellow/syntax_error.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs
index cf7b1d495..df230293b 100644
--- a/crates/ra_syntax/src/yellow/syntax_error.rs
+++ b/crates/ra_syntax/src/yellow/syntax_error.rs
@@ -72,6 +72,16 @@ pub enum SyntaxErrorKind {
72 EmptyChar, 72 EmptyChar,
73 UnclosedChar, 73 UnclosedChar,
74 OverlongChar, 74 OverlongChar,
75 EmptyByte,
76 UnclosedByte,
77 OverlongByte,
78 ByteOutOfRange,
79 UnescapedByte,
80 EmptyByteEscape,
81 InvalidByteEscape,
82 TooShortByteCodeEscape,
83 MalformedByteCodeEscape,
84 UnicodeEscapeForbidden,
75 EmptyAsciiEscape, 85 EmptyAsciiEscape,
76 InvalidAsciiEscape, 86 InvalidAsciiEscape,
77 TooShortAsciiCodeEscape, 87 TooShortAsciiCodeEscape,
@@ -98,6 +108,16 @@ impl fmt::Display for SyntaxErrorKind {
98 EmptyChar => write!(f, "Empty char literal"), 108 EmptyChar => write!(f, "Empty char literal"),
99 UnclosedChar => write!(f, "Unclosed char literal"), 109 UnclosedChar => write!(f, "Unclosed char literal"),
100 OverlongChar => write!(f, "Char literal should be one character long"), 110 OverlongChar => write!(f, "Char literal should be one character long"),
111 EmptyByte => write!(f, "Empty byte literal"),
112 UnclosedByte => write!(f, "Unclosed byte literal"),
113 OverlongByte => write!(f, "Byte literal should be one character long"),
114 ByteOutOfRange => write!(f, "Byte should be a valid ASCII character"),
115 UnescapedByte => write!(f, "This byte should always be escaped"),
116 EmptyByteEscape => write!(f, "Empty escape sequence"),
117 InvalidByteEscape => write!(f, "Invalid escape sequence"),
118 TooShortByteCodeEscape => write!(f, "Escape sequence should have two digits"),
119 MalformedByteCodeEscape => write!(f, "Escape sequence should be a hexadecimal number"),
120 UnicodeEscapeForbidden => write!(f, "Unicode escapes are not allowed in byte literals or byte strings"),
101 TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"), 121 TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"),
102 AsciiCodeEscapeOutOfRange => { 122 AsciiCodeEscapeOutOfRange => {
103 write!(f, "Escape sequence should be between \\x00 and \\x7F") 123 write!(f, "Escape sequence should be between \\x00 and \\x7F")