-
Notifications
You must be signed in to change notification settings - Fork 1
/
high.html
227 lines (190 loc) · 20 KB
/
high.html
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<link href="http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600,700" rel="stylesheet" type="text/css">
<style>
.limedocs-highlighter {
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', 'Consolas', monospace;
font-size: 0.78em;
line-height: 1.6;
display: block;
position: relative;
background-color: #1D1F21;
color: #C5C8C6;
zoom: 1;
}
.limedocs-highlighter-table {
border: 0;
border-collapse: collapse;
border-spacing: 0;
width: 100%;
font-size: inherit;
color: inherit;
line-height: inherit;
}
.limedocs-highlighter-table-gutter,
.limedocs-highlighter-table-content {
position: relative;
color: inherit;
line-height: inherit;
}
.limedocs-highlighter-table-content {
overflow-x: auto;
overflow-y: visible;
max-height: none;
}
.limedocs-highlighter-table-gutter {
width: 30px;
background: #E0E0E0;
padding-bottom: 13px;
}
.limedocs-line-num {
display: block;
text-align: right;
padding-right: 2px;
font-size: 100%;
width: 100%;
}
.limedocs-line-num a, .limedocs-line-num a:visited {
text-decoration: none;
display: inline-block;
text-align: right;
color: inherit;
line-height: inherit;
}
.limedocs-line-num a:hover {
text-decoration: underline;
}
.limedocs-highlighter > div {
box-sizing: border-box;
}
.limedocs-highlighter-editor,
.limedocs-highlighter-lines-layer {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1001;
padding: 4px 8px;
color:inherit;
}
/*
.limedocs-highlighter-editor
{
overflow-x: auto;
overflow-y: hidden;
}*/
.limedocs-highlighter-lines-layer {
background-color: transparent;
padding: 4px 0;
z-index: 1000;
}
.limedocs-line-layer {
display: block;
}
.limedocs-line-layer:after {
content: "\00a0";
}
.limedocs-line-layer-highlighted {
background: #111;
}
.limedocs-highlighter-gutter {
background: #E0E0E0;
color:#888;
z-index: 1001;
padding: 4px 8px;
width: 30px;
}
.limedocs-generic-new-line {
content: "\A";
white-space: pre;
}
.limedocs-highlighter .limedocs-generic-new-line:last-child:after {
content: " ";
}
.limedocs-highlighter-editor a, .limedocs-highlighter-editor a:visited {
color: inherit;
text-decoration: none;
border-bottom: 1px solid transparent;
}
.limedocs-highlighter-editor a:hover {
border-bottom: 1px solid;
}
.limedocs-line-layer:nth-child(even) {
}
.limedocs-generic-whitespace {
white-space: pre;
}
.limedocs-generic-predefined-constant {
color:rgb(205, 143, 0);
}
.limedocs-generic-keyword {
font-weight: 600;
color: #B294BB;
}
.limedocs-generic-variable {
color: #CC6666
}
.limedocs-generic-language-string {
color: #F0C674
}
.limedocs-generic-function {
color: #F0C674
}
.limedocs-generic-heredoc {
white-space: pre;
color:#81A2BE
}
.limedocs-generic-quoted-string {
color:#81A2BE;
}
.limedocs-generic-comment {
color: #777;
white-space: pre;
}
.limedocs-generic-class {
color: #C5C8C6;
}
.limedocs-generic-namespace {
color: #C5C8C6;
}
</style><div class="limedocs-highlighter"><table class="limedocs-highlighter-table"><tr><td class="limedocs-highlighter-table-gutter"><div class="limedocs-highlighter-gutter"><span class="limedocs-line-num" id="ldn-1"><a href="#ldn-1">1</a></span><span class="limedocs-line-num" id="ldn-2"><a href="#ldn-2">2</a></span><span class="limedocs-line-num" id="ldn-3"><a href="#ldn-3">3</a></span><span class="limedocs-line-num" id="ldn-4"><a href="#ldn-4">4</a></span><span class="limedocs-line-num" id="ldn-5"><a href="#ldn-5">5</a></span><span class="limedocs-line-num" id="ldn-6"><a href="#ldn-6">6</a></span><span class="limedocs-line-num" id="ldn-7"><a href="#ldn-7">7</a></span><span class="limedocs-line-num" id="ldn-8"><a href="#ldn-8">8</a></span><span class="limedocs-line-num" id="ldn-9"><a href="#ldn-9">9</a></span><span class="limedocs-line-num" id="ldn-10"><a href="#ldn-10">10</a></span><span class="limedocs-line-num" id="ldn-11"><a href="#ldn-11">11</a></span><span class="limedocs-line-num" id="ldn-12"><a href="#ldn-12">12</a></span><span class="limedocs-line-num" id="ldn-13"><a href="#ldn-13">13</a></span><span class="limedocs-line-num" id="ldn-14"><a href="#ldn-14">14</a></span><span class="limedocs-line-num" id="ldn-15"><a href="#ldn-15">15</a></span><span class="limedocs-line-num" id="ldn-16"><a href="#ldn-16">16</a></span><span class="limedocs-line-num" id="ldn-17"><a href="#ldn-17">17</a></span><span class="limedocs-line-num" id="ldn-18"><a href="#ldn-18">18</a></span><span class="limedocs-line-num" id="ldn-19"><a href="#ldn-19">19</a></span><span class="limedocs-line-num" id="ldn-20"><a href="#ldn-20">20</a></span><span class="limedocs-line-num" id="ldn-21"><a href="#ldn-21">21</a></span><span class="limedocs-line-num" id="ldn-22"><a href="#ldn-22">22</a></span><span class="limedocs-line-num" id="ldn-23"><a href="#ldn-23">23</a></span><span class="limedocs-line-num" id="ldn-24"><a href="#ldn-24">24</a></span><span class="limedocs-line-num" id="ldn-25"><a href="#ldn-25">25</a></span><span class="limedocs-line-num" id="ldn-26"><a href="#ldn-26">26</a></span><span class="limedocs-line-num" id="ldn-27"><a href="#ldn-27">27</a></span><span class="limedocs-line-num" id="ldn-28"><a href="#ldn-28">28</a></span><span class="limedocs-line-num" id="ldn-29"><a href="#ldn-29">29</a></span><span class="limedocs-line-num" id="ldn-30"><a href="#ldn-30">30</a></span><span class="limedocs-line-num" id="ldn-31"><a href="#ldn-31">31</a></span><span class="limedocs-line-num" id="ldn-32"><a href="#ldn-32">32</a></span><span class="limedocs-line-num" id="ldn-33"><a href="#ldn-33">33</a></span><span class="limedocs-line-num" id="ldn-34"><a href="#ldn-34">34</a></span><span class="limedocs-line-num" id="ldn-35"><a href="#ldn-35">35</a></span><span class="limedocs-line-num" id="ldn-36"><a href="#ldn-36">36</a></span><span class="limedocs-line-num" id="ldn-37"><a href="#ldn-37">37</a></span><span class="limedocs-line-num" id="ldn-38"><a href="#ldn-38">38</a></span><span class="limedocs-line-num" id="ldn-39"><a href="#ldn-39">39</a></span><span class="limedocs-line-num" id="ldn-40"><a href="#ldn-40">40</a></span><span class="limedocs-line-num" id="ldn-41"><a href="#ldn-41">41</a></span><span class="limedocs-line-num" id="ldn-42"><a href="#ldn-42">42</a></span></div></td><td class="limedocs-highlighter-table-content"><div class="limedocs-highlighter-lines-layer"><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span><span class="limedocs-line-layer "></span></div><div class="limedocs-highlighter-editor"><span class="limedocs-generic-tag"><?php</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-comment">/**
* Multi comment
* Bla
*/</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-keyword">require</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-magic-constant"><a href="http://php.net/manual/en/language.constants.predefined.php" title="Magic constant">__DIR__</a></span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">.</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-quoted-string">'/../vendor/autoload.php'</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-keyword">use</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">L</span><span class="limedocs-generic-namespace">ime\Highlighter\Highlighter</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-keyword">use</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">L</span><span class="limedocs-generic-namespace">ime\Highlighter\Language\PhpLanguage</span><span class="limedocs-generic-operator">,</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">L</span><span class="limedocs-generic-namespace">ime\Highlighter\Extension\PhpManualLinksExtension</span><span class="limedocs-generic-operator">,</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">L</span><span class="limedocs-generic-namespace">ime\Highlighter\Theme\Theme</span><span class="limedocs-generic-operator">,</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">L</span><span class="limedocs-generic-namespace">ime\Highlighter\Output\OutputHtmlFormat</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-variable">$phpstr</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-function"><a href="http://php.net/manual/en/function.file-get-contents.php" title="file_get_contents: Reads entire file into a string">file_get_contents</a></span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-magic-constant"><a href="http://php.net/manual/en/language.constants.predefined.php" title="Magic constant">__FILE__</a></span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-comment">//$phpstr = 'echo \'foo "bar" \\\'hey \'';</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-variable">$tokens</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-function"><a href="http://php.net/manual/en/function.token-get-all.php" title="token_get_all: Split given source into PHP tokens">token_get_all</a></span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-variable">$phpstr</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-keyword">foreach</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-variable">$tokens</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-keyword">as</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">{</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-keyword">if</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-operator">!</span><span class="limedocs-generic-function"><a href="http://php.net/manual/en/function.is-array.php" title="is_array: Finds whether a variable is an array">is_array</a></span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">{</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">[</span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-bracket">]</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">}</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-keyword">else</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">{</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-bracket">[</span><span class="limedocs-generic-quoted-string">'token_name'</span><span class="limedocs-generic-bracket">]</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-function"><a href="http://php.net/manual/en/function.token-name.php" title="token_name: Get the symbolic name of a given PHP token">token_name</a></span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-variable">$tok</span><span class="limedocs-generic-bracket">[</span><span class="limedocs-unknown-element">0</span><span class="limedocs-generic-bracket">]</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-bracket">}</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-comment">//echo json_encode($tok)."\n";</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-bracket">}</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-comment">// really long line really long line really long line really long line really long line really long line really long line really long line really long line really long line really long line really long line really long line</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-variable">$h</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-keyword">new</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">H</span><span class="limedocs-generic-function">ighlighter</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-variable">$html</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">=</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-variable">$h</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">-></span><span class="limedocs-generic-function">setTheme</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-keyword">new</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">T</span><span class="limedocs-generic-function">heme</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-quoted-string">'limedocs/basic'</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">-></span><span class="limedocs-generic-function">setOutputFormat</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-keyword">new</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">O</span><span class="limedocs-generic-function">utputHtmlFormat</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">-></span><span class="limedocs-generic-function">registerExtension</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-keyword">new</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-user-constant">P</span><span class="limedocs-generic-function">hpManualLinksExtension</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-operator">-></span><span class="limedocs-generic-function">highlightString</span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-variable">$phpstr</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-function"><a href="http://php.net/manual/en/function.file-put-contents.php" title="file_put_contents: Write a string to a file">file_put_contents</a></span><span class="limedocs-generic-bracket">(</span><span class="limedocs-generic-quoted-string">'high.html'</span><span class="limedocs-generic-operator">,</span><span class="limedocs-generic-whitespace"> </span><span class="limedocs-generic-variable">$html</span><span class="limedocs-generic-bracket">)</span><span class="limedocs-generic-operator">;</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-comment">/**
* Multi comment
* Bla
*/</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-new-line">
</span><span class="limedocs-generic-comment">//foo</span></div></td></table></div>