<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for spec/tokenizer.js</title>
    <meta charset="utf-8">

    <link rel="stylesheet" href="../prettify.css">

    <style>
        body, html {
            margin:0; padding: 0;
        }
        body {
            font-family: Helvetica Neue, Helvetica,Arial;
            font-size: 10pt;
        }
        div.header, div.footer {
            background: #eee;
            padding: 1em;
        }
        div.header {
            z-index: 100;
            position: fixed;
            top: 0;
            border-bottom: 1px solid #666;
            width: 100%;
        }
        div.footer {
            border-top: 1px solid #666;
        }
        div.body {
            margin-top: 10em;
        }
        div.meta {
            font-size: 90%;
            text-align: center;
        }
        h1, h2, h3 {
            font-weight: normal;
        }
        h1 {
            font-size: 12pt;
        }
        h2 {
            font-size: 10pt;
        }
        pre {
            font-family: Consolas, Menlo, Monaco, monospace;
            margin: 0;
            padding: 0;
            line-height: 14px;
            font-size: 14px;
            -moz-tab-size: 2;
            -o-tab-size:  2;
            tab-size: 2;
        }

        div.path { font-size: 110%; }
        div.path a:link, div.path a:visited { color: #000; }
        table.coverage { border-collapse: collapse; margin:0; padding: 0 }

        table.coverage td {
            margin: 0;
            padding: 0;
            color: #111;
            vertical-align: top;
        }
        table.coverage td.line-count {
            width: 50px;
            text-align: right;
            padding-right: 5px;
        }
        table.coverage td.line-coverage {
            color: #777 !important;
            text-align: right;
            border-left: 1px solid #666;
            border-right: 1px solid #666;
        }

        table.coverage td.text {
        }

        table.coverage td span.cline-any {
            display: inline-block;
            padding: 0 5px;
            width: 40px;
        }
        table.coverage td span.cline-neutral {
            background: #eee;
        }
        table.coverage td span.cline-yes {
            background: #b5d592;
            color: #999;
        }
        table.coverage td span.cline-no {
            background: #fc8c84;
        }

        .cstat-yes { color: #111; }
        .cstat-no { background: #fc8c84; color: #111; }
        .fstat-no { background: #ffc520; color: #111 !important; }
        .cbranch-no { background:  yellow !important; color: #111; }

        .cstat-skip { background: #ddd; color: #111; }
        .fstat-skip { background: #ddd; color: #111 !important; }
        .cbranch-skip { background: #ddd !important; color: #111; }

        .missing-if-branch {
            display: inline-block;
            margin-right: 10px;
            position: relative;
            padding: 0 4px;
            background: black;
            color: yellow;
        }

        .skip-if-branch {
            display: none;
            margin-right: 10px;
            position: relative;
            padding: 0 4px;
            background: #ccc;
            color: white;
        }

        .missing-if-branch .typ, .skip-if-branch .typ {
            color: inherit !important;
        }

        .entity, .metric { font-weight: bold; }
        .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
        .metric small { font-size: 80%; font-weight: normal; color: #666; }

        div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
        div.coverage-summary td, div.coverage-summary table  th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
        div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
        div.coverage-summary th.file { border-right: none !important; }
        div.coverage-summary th.pic { border-left: none !important; text-align: right; }
        div.coverage-summary th.pct { border-right: none !important; }
        div.coverage-summary th.abs { border-left: none !important; text-align: right; }
        div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
        div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
        div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap;  }
        div.coverage-summary td.pic { min-width: 120px !important;  }
        div.coverage-summary a:link { text-decoration: none; color: #000; }
        div.coverage-summary a:visited { text-decoration: none; color: #333; }
        div.coverage-summary a:hover { text-decoration: underline; }
        div.coverage-summary tfoot td { border-top: 1px solid #666; }

        div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator {
            height: 10px;
            width: 7px;
            display: inline-block;
            margin-left: 0.5em;
        }
        div.coverage-summary .yui3-datatable-sort-indicator {
            background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent;
        }
        div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator {
            background-position: 0 -20px;
        }
        div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator {
            background-position: 0 -10px;
        }

        .high { background: #b5d592 !important; }
        .medium { background: #ffe87c !important; }
        .low { background: #fc8c84 !important; }

        span.cover-fill, span.cover-empty {
            display:inline-block;
            border:1px solid #444;
            background: white;
            height: 12px;
        }
        span.cover-fill {
            background: #ccc;
            border-right: 1px solid #444;
        }
        span.cover-empty {
            background: white;
            border-left: none;
        }
        span.cover-full {
            border-right: none !important;
        }
        pre.prettyprint {
            border: none !important;
            padding: 0 !important;
            margin: 0 !important;
        }
        .com { color: #999 !important; }
        .ignore-none { color: #999; font-weight: normal; }

    </style>
</head>
<body>
<div class="header low">
    <h1>Code coverage report for <span class="entity">spec/tokenizer.js</span></h1>
    <h2>
        
        Statements: <span class="metric">20.91% <small>(55 / 263)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Branches: <span class="metric">22.22% <small>(2 / 9)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Functions: <span class="metric">1.89% <small>(1 / 53)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Lines: <span class="metric">20.91% <small>(55 / 263)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
    </h2>
    <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">spec/</a> &#187; tokenizer.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403</td><td class="line-coverage"><span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js"><span class="fstat-no" title="function not covered" >function shouldMatchTokens(result, tokens) {</span>
<span class="cstat-no" title="statement not covered" >  for (var index = 0; index &lt; result.length; index++) {</span>
<span class="cstat-no" title="statement not covered" >    equals(result[index].name, tokens[index]);</span>
  }
}
<span class="fstat-no" title="function not covered" >function shouldBeToken(result, name, text) {</span>
<span class="cstat-no" title="statement not covered" >  equals(result.name, name);</span>
<span class="cstat-no" title="statement not covered" >  equals(result.text, text);</span>
}
&nbsp;
describe('Tokenizer', function() {
  if (!Handlebars.Parser) {
    return;
  }
&nbsp;
<span class="fstat-no" title="function not covered" >  function tokenize(template) {</span>
<span class="cstat-no" title="statement not covered" >    var parser = Handlebars.Parser,</span>
        lexer = parser.lexer;
&nbsp;
<span class="cstat-no" title="statement not covered" >    lexer.setInput(template);</span>
<span class="cstat-no" title="statement not covered" >    var out = [],</span>
        token;
&nbsp;
<span class="cstat-no" title="statement not covered" >    while (token = lexer.lex()) {</span>
<span class="cstat-no" title="statement not covered" >      var result = parser.terminals_[token] || token;</span>
<span class="cstat-no" title="statement not covered" >      if (!result || result === 'EOF' || result === 'INVALID') {</span>
<span class="cstat-no" title="statement not covered" >        break;</span>
      }
<span class="cstat-no" title="statement not covered" >      out.push({name: result, text: lexer.yytext});</span>
    }
&nbsp;
<span class="cstat-no" title="statement not covered" >    return out;</span>
  }
&nbsp;
  it('tokenizes a simple mustache as "OPEN ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
  });
&nbsp;
  it('supports unescaping with &amp;', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&amp;bar}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[0], "OPEN", "{{&amp;");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "bar");</span>
  });
&nbsp;
  it('supports unescaping with {{{', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{{bar}}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_UNESCAPED', 'ID', 'CLOSE_UNESCAPED']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "bar");</span>
  });
&nbsp;
  it('supports escaping delimiters', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\{{bar}} {{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "CONTENT", "{{bar}} ");</span>
  });
&nbsp;
  it('supports escaping multiple delimiters', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\{{bar}} \\{{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "CONTENT", "{{bar}} ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "CONTENT", "{{baz}}");</span>
  });
&nbsp;
  it('supports escaping a triple stash', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\{{{bar}}} {{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "CONTENT", "{{{bar}}} ");</span>
  });
&nbsp;
  it('supports escaping escape character', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\\\{{bar}} {{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " \\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "ID", "bar");</span>
  });
&nbsp;
  it('supports escaping multiple escape characters', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\\\{{bar}} \\\\{{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " \\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "ID", "bar");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[7], "CONTENT", " \\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[9], "ID", "baz");</span>
  });
&nbsp;
  it('supports escaped mustaches after escaped escape characters', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\\\{{bar}} \\{{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " \\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "OPEN", "{{");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "ID", "bar");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[7], "CONTENT", " ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[8], "CONTENT", "{{baz}}");</span>
  });
&nbsp;
  it('supports escaped escape characters after escaped mustaches', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\{{bar}} \\\\{{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "CONTENT", "{{bar}} ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "CONTENT", "\\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[6], "OPEN", "{{");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[7], "ID", "baz");</span>
  });
&nbsp;
  it('supports escaped escape character on a triple stash', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo}} \\\\{{{bar}}} {{baz}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN_UNESCAPED', 'ID', 'CLOSE_UNESCAPED', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "CONTENT", " \\");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "ID", "bar");</span>
  });
&nbsp;
  it('tokenizes a simple path', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo/bar}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('allows dot notation', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo.bar}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{foo.bar.baz}}"), ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('allows path literals with []', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo.[bar]}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('allows multiple path literals on a line with []', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo.[bar]}}{{foo.[baz]}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE', 'OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes {{.}} as OPEN ID CLOSE', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{.}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a path as "OPEN (ID SEP)* ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{../foo/bar}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "..");</span>
  });
&nbsp;
  it('tokenizes a path with .. as a parent path', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{../foo.bar}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "..");</span>
  });
&nbsp;
  it('tokenizes a path with this/foo as OPEN ID SEP ID CLOSE', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{this/foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "this");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "ID", "foo");</span>
  });
&nbsp;
  it('tokenizes a simple mustache with spaces as "OPEN ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{  foo  }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
  });
&nbsp;
  it('tokenizes a simple mustache with line breaks as "OPEN ID ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{  foo  \n   bar }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
  });
&nbsp;
  it('tokenizes raw content as "CONTENT"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("foo {{ bar }} baz");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[0], "CONTENT", "foo ");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "CONTENT", " baz");</span>
  });
&nbsp;
  it('tokenizes a partial as "OPEN_PARTIAL ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&gt; foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a partial with context as "OPEN_PARTIAL ID ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&gt; foo bar }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a partial without spaces as "OPEN_PARTIAL ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&gt;foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a partial space at the }); as "OPEN_PARTIAL ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&gt;foo  }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a partial space at the }); as "OPEN_PARTIAL ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{&gt;foo/bar.baz  }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes a comment as "COMMENT"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("foo {{! this is a comment }} bar {{ baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "COMMENT", " this is a comment ");</span>
  });
&nbsp;
  it('tokenizes a block comment as "COMMENT"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("foo {{!-- this is a {{comment}} --}} bar {{ baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "COMMENT", " this is a {{comment}} ");</span>
  });
&nbsp;
  it('tokenizes a block comment with whitespace as "COMMENT"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("foo {{!-- this is a\n{{comment}}\n--}} bar {{ baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "COMMENT", " this is a\n{{comment}}\n");</span>
  });
&nbsp;
  it('tokenizes open and closing blocks as OPEN_BLOCK, ID, CLOSE ..., OPEN_ENDBLOCK ID CLOSE', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{#foo}}content{{/foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'CLOSE', 'CONTENT', 'OPEN_ENDBLOCK', 'ID', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes inverse sections as "OPEN_INVERSE CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{^}}"), ['OPEN_INVERSE', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{else}}"), ['OPEN_INVERSE', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{ else }}"), ['OPEN_INVERSE', 'CLOSE']);</span>
  });
&nbsp;
  it('tokenizes inverse sections with ID as "OPEN_INVERSE ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{^foo}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_INVERSE', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
  });
&nbsp;
  it('tokenizes inverse sections with ID and spaces as "OPEN_INVERSE ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{^ foo  }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN_INVERSE', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
  });
&nbsp;
  it('tokenizes mustaches with params as "OPEN ID ID ID CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo bar baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "ID", "bar");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "ID", "baz");</span>
  });
&nbsp;
  it('tokenizes mustaches with String params as "OPEN ID ID STRING CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo bar \"baz\" }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "STRING", "baz");</span>
  });
&nbsp;
  it('tokenizes mustaches with String params using single quotes as "OPEN ID ID STRING CLOSE"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo bar \'baz\' }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "STRING", "baz");</span>
  });
&nbsp;
  it('tokenizes String params with spaces inside as "STRING"', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo bar \"baz bat\" }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "STRING", "baz bat");</span>
  });
&nbsp;
  it('tokenizes String params with escapes quotes as STRING', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize('{{ foo "bar\\"baz" }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "STRING", 'bar"baz');</span>
  });
&nbsp;
  it('tokenizes String params using single quotes with escapes quotes as STRING', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo 'bar\\'baz' }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "STRING", "bar'baz");</span>
  });
&nbsp;
  it('tokenizes numbers', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize('{{ foo 1 }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "NUMBER", "1");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize('{{ foo 1.1 }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "NUMBER", "1.1");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize('{{ foo -1 }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "NUMBER", "-1");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize('{{ foo -1.1 }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "NUMBER", "-1.1");</span>
  });
&nbsp;
  it('tokenizes booleans', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize('{{ foo true }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'BOOLEAN', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "BOOLEAN", "true");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize('{{ foo false }}');</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'BOOLEAN', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "BOOLEAN", "false");</span>
  });
&nbsp;
  it('tokenizes hash arguments', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ foo bar=baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=bat }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=1 }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'NUMBER', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=true }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'BOOLEAN', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=false }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'BOOLEAN', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar\n  baz=bat }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=\"bat\" }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'STRING', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar baz=\"bat\" bam=wot }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'STRING', 'ID', 'EQUALS', 'ID', 'CLOSE']);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{foo omg bar=baz bat=\"bam\"}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'ID', 'EQUALS', 'STRING', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "ID", "omg");</span>
  });
&nbsp;
  it('tokenizes special @ identifiers', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{ @foo }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'DATA', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[2], "ID", "foo");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo @bar }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'DATA', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "ID", "bar");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{ foo bar=@baz }}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'EQUALS', 'DATA', 'ID', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5], "ID", "baz");</span>
  });
&nbsp;
  it('does not time out in a mustache with a single } followed by EOF', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{foo}"), ['OPEN', 'ID']);</span>
  });
&nbsp;
  it('does not time out in a mustache when invalid ID characters are used', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(tokenize("{{foo &amp; }}"), ['OPEN', 'ID']);</span>
  });
&nbsp;
  it('tokenizes subexpressions', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo (bar)}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'CLOSE_SEXPR', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "ID", "bar");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    result = tokenize("{{foo (a-x b-y)}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'ID', 'CLOSE_SEXPR', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[1], "ID", "foo");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3], "ID", "a-x");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[4], "ID", "b-y");</span>
  });
&nbsp;
  it('tokenizes nested subexpressions', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo (bar (lol rofl)) (baz)}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'OPEN_SEXPR', 'ID', 'ID', 'CLOSE_SEXPR', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'CLOSE_SEXPR', 'CLOSE']);</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[3],  "ID", "bar");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[5],  "ID", "lol");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[6],  "ID", "rofl");</span>
<span class="cstat-no" title="statement not covered" >    shouldBeToken(result[10], "ID", "baz");</span>
  });
&nbsp;
  it('tokenizes nested subexpressions: literals', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var result = tokenize("{{foo (bar (lol true) false) (baz 1) (blah 'b') (blorg \"c\")}}");</span>
<span class="cstat-no" title="statement not covered" >    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'OPEN_SEXPR', 'ID', 'BOOLEAN', 'CLOSE_SEXPR', 'BOOLEAN', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'NUMBER', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'CLOSE']);</span>
  });
});
&nbsp;</pre></td></tr>
</table></pre>

</div>
<div class="footer">
    <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Aug 13 2014 23:50:21 GMT-0500 (CDT)</div>
</div>

<script src="../prettify.js"></script>

<script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script>

    YUI().use('datatable', function (Y) {

        var formatters = {
          pct: function (o) {
              o.className += o.record.get('classes')[o.column.key];
              try {
                  return o.value.toFixed(2) + '%';
              } catch (ex) { return o.value + '%'; }
          },
          html: function (o) {
              o.className += o.record.get('classes')[o.column.key];
              return o.record.get(o.column.key + '_html');
          }
        },
          defaultFormatter = function (o) {
              o.className += o.record.get('classes')[o.column.key];
              return o.value;
          };

        function getColumns(theadNode) {
            var colNodes = theadNode.all('tr th'),
                cols = [],
                col;
            colNodes.each(function (colNode) {
                col = {
                    key: colNode.getAttribute('data-col'),
                    label: colNode.get('innerHTML') || ' ',
                    sortable: !colNode.getAttribute('data-nosort'),
                    className: colNode.getAttribute('class'),
                    type: colNode.getAttribute('data-type'),
                    allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html'
                };
                col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter;
                cols.push(col);
            });
            return cols;
        }

        function getRowData(trNode, cols) {
            var tdNodes = trNode.all('td'),
                    i,
                    row = { classes: {} },
                    node,
                    name;
            for (i = 0; i < cols.length; i += 1) {
                name = cols[i].key;
                node = tdNodes.item(i);
                row[name] = node.getAttribute('data-value') || node.get('innerHTML');
                row[name + '_html'] = node.get('innerHTML');
                row.classes[name] = node.getAttribute('class');
                //Y.log('Name: ' + name + '; Value: ' + row[name]);
                if (cols[i].type === 'number') { row[name] = row[name] * 1; }
            }
            //Y.log(row);
            return row;
        }

        function getData(tbodyNode, cols) {
            var data = [];
            tbodyNode.all('tr').each(function (trNode) {
                data.push(getRowData(trNode, cols));
            });
            return data;
        }

        function replaceTable(node) {
            if (!node) { return; }
            var cols = getColumns(node.one('thead')),
                data = getData(node.one('tbody'), cols),
                table,
                parent = node.get('parentNode');

            table = new Y.DataTable({
                columns: cols,
                data: data,
                sortBy: 'file'
            });
            parent.set('innerHTML', '');
            table.render(parent);
        }

        Y.on('domready', function () {
            replaceTable(Y.one('div.coverage-summary table'));
            if (typeof prettyPrint === 'function') {
                prettyPrint();
            }
        });
    });
</script>
</body>
</html>
