Skip to content

Commit

Permalink
[word_parse fix] Fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Jan 3, 2024
1 parent 1bd58fc commit a4b246b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions osh/word_parse.py
Expand Up @@ -662,14 +662,12 @@ def ReadSingleQuoted(self, lex_mode, left_token, tokens, is_ysh_expr):

elif self.token_kind == Kind.Unknown:
tok = self.cur_token
assert tok.id == Id.Unknown_Backslash, tok

# x = $'\z' is disallowed; ditto for echo $'\z' if shopt -u parse_backslash
if is_ysh_expr or not self.parse_opts.parse_backslash():
assert tok.id == Id.Unknown_Tok, tok
p_die("Invalid char escape in C-style string literal", tok)

# newlines for multi-line J8 strings
#log('tok %r', tok)

tokens.append(tok)

elif self.token_kind == Kind.Eof:
Expand Down

0 comments on commit a4b246b

Please sign in to comment.