git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
browser: convert-stats-gs download option
[sheet.git]
/
tools
/
convert-caniuse.pl
diff --git
a/tools/convert-caniuse.pl
b/tools/convert-caniuse.pl
index 7006b18f99b371dbaef57005a524e6c6da214b11..467b9ba7b5405cdfc37304638332ea1960c89260 100755
(executable)
--- a/
tools/convert-caniuse.pl
+++ b/
tools/convert-caniuse.pl
@@
-12,14
+12,14
@@
my $source = readline;
for ($source) { # cleanup
# convert seperate variables to hash keys
for ($source) { # cleanup
# convert seperate variables to hash keys
- s/\A/{/;
- s/^caniuse\.(\w+)
=
/"$1":/gm;
+ s/\A/{
\n
/;
+ s/^caniuse\.(\w+)
*= *
/"$1":/gm;
s/;$/,/gm;
s/,\s*\Z/\n}/;
# fractions not supported by barekey
s/;$/,/gm;
s/,\s*\Z/\n}/;
# fractions not supported by barekey
- s/(?<=[,{
]) (\d*\.\d) (?=:'
)/"$1"/gx;
+ s/(?<=[,{
\n]) (\d*\.\d) (?=:['"]
)/"$1"/gx;
# escapes not supported in singlequote
# escapes not supported in singlequote
- s{'((?:[^\\']+|\\.)*)'}{
+ s{
: *\K
'((?:[^\\']+|\\.)*)'}{
my $_ = $1;
s/"/\\"/g;
s/\\'/'/g;
my $_ = $1;
s/"/\\"/g;
s/\\'/'/g;