-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraw.sh
More file actions
executable file
·114 lines (71 loc) · 1.08 KB
/
raw.sh
File metadata and controls
executable file
·114 lines (71 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/sh
sed -e '
:a #Used after each prosseced token
s/^[ \t\r\n]\+//#Cleen
#All one charactes expept .
/^\([,:{}]\|\]\|\[\)/{
#Pre Flusher
/^\]\|^}\|^{/{
x
/[^ ]/{
p
s/\( *\)\(.*\)/\1/
}
x
}
#Append Last char. May contain prev data
#May contain trailing
H
x
/^\n/ {s/\(.\)\(.\)\(.*\)/\2/}
/^\n/!{s/\([^\n]*\)\(\n*\)\(.\)\(.*\)/\1\3/}
s/\n//g
x
#Subing
/^\]\|^}/{
x
s/^ //
x
}
#Post flushers
/^,\|^\[\|^\]\|^}\|^{/{
x
p
s/\( *\)\(.*\)/\1/
x
}
#s/\n//
#Adding or removing line
#Adding
/^\[\|^{/{
x
s/^/ /
x
}
s/.//
ba
}
#New String extractor
/^"/{H
x
s/\([^\n]*\)\(\n\)\("\(\([^"]\)\|\(\\.\)\)*"\)\(.*\)/\1\o033[95m\3\o033[0m/
x
s/"\(\([^"]\)\|\(\\.\)\)*"//
ba
}
/^[0-9-]/{H
x
s/\([^\n]*\)\(\n\)\(-\?[0-9]\+\(.[0-9]\+\)\?\([eE]\([+-]\?\)\?[0-9]\+\)\?\)\(.*\)/\1\o033[95m\3\o033[0m/
x
s/^\(-\?[0-9]\+\(.[0-9]\+\)\?\([eE]\([+-]\?\)\?[0-9]\+\)\?\)\+//
ba
}
/^true\|^false\|^null/{H
x
s/\([^\n]*\)\(\n\)\(true\|false\|null\+\)\(.*\)/\1\o033[96m\3\o033[0m/
x
s/^true\|^false\|^null//
ba
}
${p}
d'