rmtrail now handles single-line comments following trailing comma
parent
29576cfee4
commit
44a45d1f44
|
@ -27,7 +27,11 @@ TEST_DATA=$( echo '[a,b,]{a,b,}[
|
||||||
]{
|
]{
|
||||||
a,
|
a,
|
||||||
b,
|
b,
|
||||||
}' \
|
}
|
||||||
|
[c, // comment]
|
||||||
|
[d, //comment
|
||||||
|
]
|
||||||
|
[e,// comment]' \
|
||||||
| $PATH_TOOLS/rmtrail
|
| $PATH_TOOLS/rmtrail
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,7 +42,11 @@ TEST_CMP='[a,b]{a,b}[
|
||||||
]{
|
]{
|
||||||
a,
|
a,
|
||||||
b
|
b
|
||||||
}'
|
}
|
||||||
|
[c // comment]
|
||||||
|
[d //comment
|
||||||
|
]
|
||||||
|
[e// comment]' \
|
||||||
|
|
||||||
# perform the assertion
|
# perform the assertion
|
||||||
if [ ! "$TEST_DATA" == "$TEST_CMP" ]; then
|
if [ ! "$TEST_DATA" == "$TEST_CMP" ]; then
|
||||||
|
|
|
@ -41,7 +41,7 @@ cat - \
|
||||||
$ {
|
$ {
|
||||||
# pull from hold and perform replacement
|
# pull from hold and perform replacement
|
||||||
g
|
g
|
||||||
s/,\(\s*[]}]\)/\1/g
|
s/,\(\s*\(\/\/[^]}\n]\+\s*\)\?[]}]\)/\1/g
|
||||||
|
|
||||||
# print result
|
# print result
|
||||||
p
|
p
|
||||||
|
|
Loading…
Reference in New Issue