September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1 @@
sub("[#;].*";"") | sub("^\\s+";"") | sub("\\s+$";"")

View file

@ -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;

View file

@ -0,0 +1 @@
" abc ; def # ghi" | strip_comment