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,
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue