Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 10, 2024
1 parent 207465d commit e2f0b5b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ nvm_json_throw() {

nvm_json_awk_egrep() {
local pattern_string
pattern_string=$1
pattern_string="${1}"

awk '{
while ($0) {
Expand All @@ -130,14 +130,14 @@ nvm_json_tokenize() {
local ESCAPE
local CHAR

if echo "test string" | grep -Eo "test" > /dev/null 2>&1; then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
else
# if echo "test string" | grep -Eo "test" > /dev/null 2>&1; then
# ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
# CHAR='[^[:cntrl:]"\\]'
# else
GREP=nvm_json_awk_egrep
ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\\\]'
fi
# fi

local STRING
STRING="\"${CHAR}*(${ESCAPE}${CHAR}*)*\""
Expand Down

0 comments on commit e2f0b5b

Please sign in to comment.