Skip to content

Commit

Permalink
[osh-language] Allow \} in VSub_ArgDQ.
Browse files Browse the repository at this point in the history
Fixes issue #702.

This was a side effect of fixing #695 with commit 84c2r4.
  • Loading branch information
Andy Chu committed Apr 15, 2020
1 parent 1cd0ad0 commit 49cd564
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/lexer_def.py
Expand Up @@ -434,6 +434,8 @@ def IsKeyword(name):
LEXER_DEF[lex_mode_e.VSub_ArgDQ] = \
_DQ_BACKSLASH + _VS_ARG_COMMON + _LEFT_SUBS + _VARS + [

C(r'\}', Id.Lit_EscapedChar), # For "${var-\}}"

R(r'[^$`/}"\0\\#%]+', Id.Lit_Chars), # matches a line at most

# Weird wart: even in double quoted state, double quotes are allowed
Expand Down
27 changes: 27 additions & 0 deletions spec/var-sub-quote.test.sh
Expand Up @@ -261,3 +261,30 @@ echo "${unset:-'a'}"
a
'a'
## END
#### Right Brace as argument (similar to #702)
echo "${var-}}"
echo "${var-\}}"
echo "${var-'}'}"
echo "${var-"}"}"
## STDOUT:
}
}
''}
}
## END
## BUG bash STDOUT:
}
}
'}'
}
## END
## BUG yash STDOUT:
}
}
}
}
## END

0 comments on commit 49cd564

Please sign in to comment.