diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-11-07 10:35:33 +0000 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-11-07 10:35:33 +0000 |
commit | 94796e6447c8af9d7444164c2175ca5dae4a563e (patch) | |
tree | 7bc99ebcc33cc272ce23823bae3a4d19ec216d34 /crates/ra_syntax/src/yellow | |
parent | fdb9f06880ddcf29513a8c2855c3c576cc461014 (diff) |
Add lots of tests
Diffstat (limited to 'crates/ra_syntax/src/yellow')
-rw-r--r-- | crates/ra_syntax/src/yellow/syntax_error.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs index 9aed9e81e..e2e660975 100644 --- a/crates/ra_syntax/src/yellow/syntax_error.rs +++ b/crates/ra_syntax/src/yellow/syntax_error.rs | |||
@@ -34,6 +34,10 @@ impl SyntaxError { | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn kind(&self) -> SyntaxErrorKind { | ||
38 | self.kind.clone() | ||
39 | } | ||
40 | |||
37 | pub fn location(&self) -> Location { | 41 | pub fn location(&self) -> Location { |
38 | self.location.clone() | 42 | self.location.clone() |
39 | } | 43 | } |
@@ -64,6 +68,7 @@ impl fmt::Display for SyntaxError { | |||
64 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 68 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
65 | pub enum SyntaxErrorKind { | 69 | pub enum SyntaxErrorKind { |
66 | ParseError(ParseError), | 70 | ParseError(ParseError), |
71 | UnescapedCodepoint, | ||
67 | EmptyChar, | 72 | EmptyChar, |
68 | UnclosedChar, | 73 | UnclosedChar, |
69 | LongChar, | 74 | LongChar, |
@@ -86,6 +91,7 @@ impl fmt::Display for SyntaxErrorKind { | |||
86 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 91 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
87 | use self::SyntaxErrorKind::*; | 92 | use self::SyntaxErrorKind::*; |
88 | match self { | 93 | match self { |
94 | UnescapedCodepoint => write!(f, "This codepoint should always be escaped"), | ||
89 | EmptyAsciiEscape => write!(f, "Empty escape sequence"), | 95 | EmptyAsciiEscape => write!(f, "Empty escape sequence"), |
90 | InvalidAsciiEscape => write!(f, "Invalid escape sequence"), | 96 | InvalidAsciiEscape => write!(f, "Invalid escape sequence"), |
91 | EmptyChar => write!(f, "Empty char literal"), | 97 | EmptyChar => write!(f, "Empty char literal"), |