Skip to content

Commit

Permalink
passing all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 15, 2013
1 parent d997384 commit 44177e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.parse = function (s, env) {

function parse (s, env) {
var chunker = new RegExp([
'([\'"])((\\\\\\1|[^\\1])*?)\\1', // quotes
'[^\\s\'"]*([\'"])((\\\\\\1|[^\\1])*?)\\1[^\\s\'"]*', // quotes
'(\\\\[' + META + ']|[^\\s' + META + '])+', // barewords
'(' + CONTROL + ')' // control chars
].join('|'), 'g');
Expand All @@ -57,7 +57,7 @@ function parse (s, env) {
.replace(/\\(["'\\$`(){}!#&*|])/g, '$1')
;
}
else if (/^"/.test(s) && typeof env === 'function') {
else if (/^([^"']*)"/.test(s) && typeof env === 'function') {
return s.replace(/^"|"$/g, '')
.replace(/(^|[^\\])\$(\w+|[*@#?$!0_-])/g, getVar)
.replace(/(^|[^\\])\${(\w+|[*@#?$!0_-])}/g, getVar)
Expand Down

0 comments on commit 44177e3

Please sign in to comment.