Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
def parse:
|
||||
|
||||
def uc: .name | ascii_upcase;
|
||||
|
||||
def parse_boolean:
|
||||
capture( "(?<name>^[^ ] *$)" )
|
||||
| { (uc) : true };
|
||||
|
||||
def parse_var_value:
|
||||
capture( "(?<name>^[^ ]+)[ =] *(?<value>[^,]+ *$)" )
|
||||
| { (uc) : .value };
|
||||
|
||||
def parse_var_array:
|
||||
capture( "(?<name>^[^ ]+)[ =] *(?<value>.*)" )
|
||||
| { (uc) : (.value | sub(" +$";"") | [splits(", *")]) };
|
||||
|
||||
reduce inputs as $i ({};
|
||||
if $i|length == 0 or test("^[#;]") then .
|
||||
else . + ($i | ( parse_boolean // parse_var_value // parse_var_array // {} ))
|
||||
end);
|
||||
|
||||
parse
|
||||
Loading…
Add table
Add a link
Reference in a new issue