September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1 @@
|
|||
sub("[#;].*";"") | sub("^\\s+";"") | sub("\\s+$";"")
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# define whitespace here as a tab, space, newline, return or form-feed character:
|
||||
def is_whitespace: . as $in | " \n\r\f\t" | index($in);
|
||||
|
||||
def ltrim:
|
||||
if .[0:1] | is_whitespace then (.[1:]|ltrim) else . end;
|
||||
|
||||
def rtrim:
|
||||
if .[length-1:] | is_whitespace then .[0:length-1]|rtrim else . end;
|
||||
|
||||
def trim: ltrim | rtrim;
|
||||
|
||||
def strip_comment:
|
||||
index("#") as $i1 | index(";") as $i2
|
||||
| (if $i1 then if $i2 then [$i1, $i2] | min
|
||||
else $i1
|
||||
end
|
||||
else $i2
|
||||
end ) as $ix
|
||||
| if $ix then .[0:$ix] else . end
|
||||
| trim;
|
||||
|
|
@ -0,0 +1 @@
|
|||
" abc ; def # ghi" | strip_comment
|
||||
|
|
@ -0,0 +1 @@
|
|||
"abc"
|
||||
Loading…
Add table
Add a link
Reference in a new issue