diff options
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/mod.rs | 10 | ||||
| -rw-r--r-- | src/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/parse/resolve.rs | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 90fdbf5d..d2408c7b 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -268,8 +268,8 @@ fn dict_contents(p: &mut Parser) -> (LitDict, bool) { comma_and_keyless = false; } - let coercable = comma_and_keyless && !dict.0.is_empty(); - (dict, coercable) + let coercible = comma_and_keyless && !dict.0.is_empty(); + (dict, coercible) } /// Parse a single entry in a dictionary. @@ -458,9 +458,9 @@ fn content(p: &mut Parser) -> SynTree { /// Parse a parenthesized expression: `(a + b)`, `(1, key="value"). fn parenthesized(p: &mut Parser) -> Expr { p.start_group(Group::Paren); - let (dict, coercable) = dict_contents(p); - let expr = if coercable { - dict.0.into_iter().next().expect("dict is coercable").expr.v + let (dict, coercible) = dict_contents(p); + let expr = if coercible { + dict.0.into_iter().next().expect("dict is coercible").expr.v } else { Expr::Lit(Lit::Dict(dict)) }; diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 18c82008..047f6e4c 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -110,7 +110,7 @@ impl<'s> Parser<'s> { // Check that we are indeed at the end of the group. debug_assert_eq!(self.peek(), None, "unfinished group"); - let group = self.groups.pop().expect("unstarted group"); + let group = self.groups.pop().expect("no started group"); let end = match group { Group::Paren => Some(Token::RightParen), Group::Bracket => Some(Token::RightBracket), diff --git a/src/parse/resolve.rs b/src/parse/resolve.rs index df5a5d41..719e13e2 100644 --- a/src/parse/resolve.rs +++ b/src/parse/resolve.rs @@ -42,7 +42,7 @@ pub fn resolve_string(string: &str) -> String { out } -/// Resolve a hexademical escape sequence into a character +/// Resolve a hexadecimal escape sequence into a character /// (only the inner hex letters without braces or `\u`). pub fn resolve_hex(sequence: &str) -> Option<char> { u32::from_str_radix(sequence, 16).ok().and_then(std::char::from_u32) |
