1
0
Fork 0

rmtrail now handles single-line comments following trailing comma

perfodd
Mike Gerwitz 2014-03-07 00:47:28 -05:00
parent 29576cfee4
commit 44a45d1f44
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
2 changed files with 11 additions and 3 deletions

View File

@ -27,7 +27,11 @@ TEST_DATA=$( echo '[a,b,]{a,b,}[
]{
a,
b,
}' \
}
[c, // comment]
[d, //comment
]
[e,// comment]' \
| $PATH_TOOLS/rmtrail
)
@ -38,7 +42,11 @@ TEST_CMP='[a,b]{a,b}[
]{
a,
b
}'
}
[c // comment]
[d //comment
]
[e// comment]' \
# perform the assertion
if [ ! "$TEST_DATA" == "$TEST_CMP" ]; then

View File

@ -41,7 +41,7 @@ cat - \
$ {
# pull from hold and perform replacement
g
s/,\(\s*[]}]\)/\1/g
s/,\(\s*\(\/\/[^]}\n]\+\s*\)\?[]}]\)/\1/g
# print result
p