How to use end method in wpt

Best JavaScript code snippet using wpt

prettify_test.js

Source:prettify_test.js Github

copy

Full Screen

1/**2 * maps ids of rewritten code to the expected output.3 * For brevity, <span class="foo"> has been changed to `FOO4 * and < /span> has been changed to `END.5 */6var goldens = {7 bash: (8 '`COM#!/bin/bash`END`PLN\n' +9 '\n' +10 '`END`COM# Fibonacci numbers`END`PLN\n' +11 '`END`COM# Writes an infinite series to stdout, one entry per line`END' +12 '`PLN\n' +13 '`END`KWDfunction`END`PLN fib`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +14 ' `END`KWDlocal`END`PLN a`END`PUN=`END`LIT1`END`PLN\n' +15 ' `END`KWDlocal`END`PLN b`END`PUN=`END`LIT1`END`PLN\n' +16 ' `END`KWDwhile`END`PLN `END`KWDtrue`END`PLN `END`PUN;`END' +17 '`PLN `END`KWDdo`END`PLN\n' +18 ' echo $a\n' +19 ' `END`KWDlocal`END`PLN tmp`END`PUN=`END`PLN$a\n' +20 ' a`END`PUN=`END`PLN$`END`PUN((`END`PLN $a `END`PUN+`END' +21 '`PLN $b `END`PUN))`END`PLN\n' +22 ' b`END`PUN=`END`PLN$tmp\n' +23 ' `END`KWDdone`END`PLN\n' +24 '`END`PUN}`END`PLN\n' +25 '\n' +26 '`END`COM# output the 10th element of the series and halt`END`PLN\n' +27 'fib `END`PUN|`END`PLN head `END`PUN-`END`LIT10`END`PLN `END`PUN|`END' +28 '`PLN tail `END`PUN-`END`LIT1`END'29 ),30 bash_lang: (31 '<ol class="linenums">`#`COM#!/bin/bash`END' +32 '`#1`PLN&nbsp;`END' +33 '`#2`COM# Fibonacci numbers`END' +34 '`#3`COM# Writes an infinite series to stdout, one entry per line`END' +35 '`#4`KWDfunction`END`PLN fib`END`PUN()`END`PLN `END`PUN{`END' +36 '`#5`PLN `END`KWDlocal`END`PLN a`END`PUN=`END`LIT1`END' +37 '`#6`PLN `END`KWDlocal`END`PLN b`END`PUN=`END`LIT1`END' +38 '`#7`PLN `END`KWDwhile`END`PLN true `END`PUN;`END' +39 '`PLN `END`KWDdo`END' +40 '`#8`PLN echo $a`END' +41 '`#9`PLN `END`KWDlocal`END`PLN tmp`END`PUN=`END`PLN$a`END' +42 '`#0`PLN a`END`PUN=`END`PLN$`END`PUN((`END`PLN $a `END`PUN+`END' +43 '`PLN $b `END`PUN))`END' +44 '`#1`PLN b`END`PUN=`END`PLN$tmp`END' +45 '`#2`PLN `END`KWDdone`END' +46 '`#3`PUN}`END' +47 '`#4`PLN&nbsp;`END' +48 '`#5`COM# output the 10th element of the series and halt`END' +49 '`#6`PLNfib `END`PUN|`END`PLN `END`PUN/`END`PLNusr`END`PUN/`END`PLNbin`END' +50 '`PUN/*`END`PLNhead `END`PUN-`END`LIT10`END`PLN `END`PUN|`END' +51 '`PLN tail `END`PUN-`END`LIT1`END</li></ol>'52 ),53 issue_165: (54 '`COM# Comment`END`PLN\n' +55 '`END`KWDlocal`END`PLN $x `END`PUN=`END`PLN $`END`PUN{#`END`PLNx`END`PUN[@]}`END`PLN `END' +56 '`COM# Previous is not a comment`END`PLN\n' +57 '`END`COM# A comment`END'58 ),59 c: (60 '`COM#include`END`PLN `END`STR&lt;stdio.h&gt;`END`PLN\n' +61 '\n' +62 '`END`COM/* the n-th fibonacci number.\n' +63 ' *\/`END`PLN\n' +64 '`END`KWDunsigned`END`PLN `END`KWDint`END`PLN fib`END`PUN(`END' +65 '`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END`PUN)`END`PLN `END' +66 '`PUN{`END`PLN\n' +67 ' `END`KWDunsigned`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +68 '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +69 '`PUN;`END`PLN\n' +70 ' `END`KWDunsigned`END`PLN `END`KWDint`END`PLN tmp`END`PUN;`END' +71 '`PLN\n' +72 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +73 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +74 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +75 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +76 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +77 ' `END`PUN}`END`PLN\n' +78 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +79 '`END`PUN}`END`PLN\n' +80 '\n' +81 'main`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +82 ' printf`END`PUN(`END`STR"%u"`END`PUN,`END`PLN fib`END`PUN(`END' +83 '`LIT10`END`PUN));`END`PLN\n' +84 '`END`PUN}`END'85 ),86 c_lang: (87 '`COM#include`END`PLN `END`STR&lt;stdio.h&gt;`END`PLN\n' +88 '\n' +89 '`END`COM/* the n`END<sup>`COMth`END<\/sup>`COM fibonacci number. *\/`END`PLN\n' +90 '`END`TYPuint32`END`PLN fib`END`PUN(`END' +91 '`KWDunsigned`END`PLN `END`TYPint`END`PLN n`END`PUN)`END`PLN `END' +92 '`PUN{`END`PLN\n' +93 ' `END`TYPuint32`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +94 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +95 ' `END`TYPuint32`END`PLN tmp`END`PUN;`END`PLN\n' +96 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +97 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +98 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +99 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +100 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +101 ' `END`PUN}`END`PLN\n' +102 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +103 '`END`PUN}`END`PLN\n' +104 '\n' +105 '`END`KWDvoid`END`PLN main`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +106 ' `END`TYPsize_t`END`PLN size `END`PUN=`END`PLN `END`KWDsizeof`END' +107 '`PUN(`END`TYPwchar_t`END`PUN);`END`PLN\n' +108 ' ASSERT_EQ`END`PUN(`END`PLNsize`END`PUN,`END`PLN `END`LIT1`END' +109 '`PUN);`END`PLN\n' +110 ' printf`END`PUN(`END`STR"%u"`END`PUN,`END`PLN fib`END`PUN(`END' +111 '`LIT10`END`PUN));`END`PLN\n' +112 '`END`PUN}`END`PLN\n' +113 '\n' +114 '`END`COM#define`END`PLN ZERO `END`LIT0`END`PLN `END`COM/* a\n' +115 ' multiline comment *\/`END'116 ),117 cpp: (118 '`COM#include`END`PLN `END`STR&lt;iostream&gt;`END`PLN\n' +119 '\n' +120 '`END`KWDusing`END`PLN `END`KWDnamespace`END`PLN std`END`PUN;`END' +121 '`PLN\n' +122 '\n' +123 '`END`COM//! fibonacci numbers with gratuitous use of templates.`END' +124 '`PLN\n' +125 '`END`COM//! \\param n an index into the fibonacci series`END`PLN\n' +126 '`END`COM//! \\param fib0 element 0 of the series`END`PLN\n' +127 '`END`COM//! \\return the nth element of the fibonacci series`END' +128 '`PLN\n' +129 '`END`KWDtemplate`END`PLN `END`PUN&lt;`END`KWDclass`END`PLN T`END' +130 '`PUN&gt;`END`PLN\n' +131 'T fib`END`PUN(`END`KWDunsigned`END`PLN `END`KWDint`END`PLN n`END' +132 '`PUN,`END`PLN `END`KWDconst`END`PLN T`END`PUN&amp;`END`PLN fib0' +133 '`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +134 ' T a`END`PUN(`END`PLNfib0`END`PUN),`END`PLN b`END`PUN(`END' +135 '`PLNfib0`END`PUN);`END`PLN\n' +136 ' `END`KWDfor`END`PLN `END`PUN(;`END`PLN n`END`PUN;`END' +137 '`PLN `END`PUN--`END`PLNn`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +138 ' T tmp`END`PUN(`END`PLNa`END`PUN);`END`PLN\n' +139 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +140 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +141 ' `END`PUN}`END`PLN\n' +142 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +143 '`END`PUN}`END`PLN\n' +144 '\n' +145 '`END`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END' +146 '`PUN,`END`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END' +147 '`PUN)`END`PLN `END`PUN{`END`PLN\n' +148 ' cout `END`PUN&lt;&lt;`END`PLN fib`END`PUN(`END`LIT10`END' +149 '`PUN,`END`PLN `END`LIT1U`END`PUN);`END`PLN\n' +150 '`END`PUN}`END'151 ),152 cpp_lang: (153 '`COM#include`END`PLN `END`STR&lt;iostream&gt;`END`PLN\n' +154 '\n' +155 '`END`KWDusing`END`PLN `END`KWDnamespace`END`PLN std`END`PUN;`END' +156 '`PLN\n' +157 '\n' +158 '`END`COM//! fibonacci numbers with gratuitous use of templates.`END' +159 '`PLN\n' +160 '`END`COM//! \\param n an index into the fibonacci series`END`PLN\n' +161 '`END`COM//! \\param fib0 element 0 of the series`END`PLN\n' +162 '`END`COM//! \\return the nth element of the fibonacci series`END' +163 '`PLN\n' +164 '`END`KWDtemplate`END`PLN `END`PUN&lt;`END`KWDclass`END`PLN T`END' +165 '`PUN&gt;`END`PLN\n' +166 'T fib`END`PUN(`END`TYPint`END`PLN n`END' +167 '`PUN,`END`PLN `END`KWDconst`END`PLN T`END`PUN&amp;`END`PLN fib0' +168 '`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +169 ' T a`END`PUN(`END`PLNfib0`END`PUN),`END`PLN b`END`PUN(`END' +170 '`PLNfib0`END`PUN);`END`PLN\n' +171 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +172 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +173 ' T tmp`END`PUN(`END`PLNa`END`PUN);`END`PLN\n' +174 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +175 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +176 ' `END`PUN}`END`PLN\n' +177 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +178 '`END`PUN}`END`PLN\n' +179 '\n' +180 '`END`TYPint`END`PLN main`END`PUN(`END`TYPint`END`PLN argc`END' +181 '`PUN,`END`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END' +182 '`PUN)`END`PLN `END`PUN{`END`PLN\n' +183 ' cout `END`PUN&lt;&lt;`END`PLN fib`END`PUN(`END`LIT10`END' +184 '`PUN,`END`PLN `END`LIT1U`END`PUN);`END`PLN\n' +185 '`END`PUN}`END'186 ),187 java: (188 '`KWDpackage`END`PLN foo`END`PUN;`END`PLN\n' +189 '\n' +190 '`END`KWDimport`END`PLN java`END`PUN.`END`PLNutil`END`PUN.`END' +191 '`TYPIterator`END`PUN;`END`PLN\n' +192 '\n' +193 '`END`COM/**\n' +194 ' * the fibonacci series implemented as an Iterable.\n' +195 ' *\/`END`PLN\n' +196 '`END`KWDpublic`END`PLN `END`KWDfinal`END`PLN `END`KWDclass`END' +197 '`PLN `END`TYPFibonacci`END`PLN `END`KWDimplements`END`PLN `END' +198 '`TYPIterable`END`PUN&lt;`END`TYPInteger`END`PUN&gt;`END`PLN `END`' +199 'PUN{`END`PLN\n' +200 ' `END' +201 '`COM/** the next and previous members of the series. *\/`END' +202 '`PLN\n' +203 ' `END`KWDprivate`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +204 '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +205 '`PUN;`END`PLN\n' +206 '\n' +207 ' `END`LIT@Override`END`PLN\n' +208 ' `END`KWDpublic`END`PLN `END`TYPIterator`END`PUN&lt;`END' +209 '`TYPInteger`END`PUN&gt;`END`PLN iterator`END`PUN()`END`PLN `END' +210 '`PUN{`END`PLN\n' +211 ' `END`KWDreturn`END`PLN `END`KWDnew`END`PLN `END' +212 '`TYPIterator`END`PUN&lt;`END`TYPInteger`END`PUN&gt;()`END`PLN `END' +213 '`PUN{`END`PLN\n' +214 ' `END`COM/** the series is infinite. *\/`END' +215 '`PLN\n' +216 ' `END`KWDpublic`END`PLN `END`KWDboolean`END' +217 '`PLN hasNext`END`PUN()`END`PLN `END`PUN{`END`PLN `END' +218 '`KWDreturn`END`PLN `END`KWDtrue`END`PUN;`END`PLN `END`PUN}`END' +219 '`PLN\n' +220 ' `END`KWDpublic`END`PLN `END`TYPInteger`END' +221 '`PLN `END`KWDnext`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +222 ' `END`KWDint`END`PLN tmp `END`PUN=`END' +223 '`PLN a`END`PUN;`END`PLN\n' +224 ' a `END`PUN+=`END`PLN b`END`PUN;`END' +225 '`PLN\n' +226 ' b `END`PUN=`END`PLN tmp`END`PUN;`END' +227 '`PLN\n' +228 ' `END`KWDreturn`END`PLN a`END`PUN;`END' +229 '`PLN\n' +230 ' `END`PUN}`END`PLN\n' +231 ' `END`KWDpublic`END`PLN `END`KWDvoid`END' +232 '`PLN `END`KWDremove`END`PUN()`END`PLN `END`PUN{`END`PLN `END`KWDthrow`END' +233 '`PLN `END`KWDnew`END`PLN `END' +234 '`TYPUnsupportedOperationException`END`PUN();`END`PLN `END' +235 '`PUN}`END`PLN\n' +236 ' `END`PUN};`END`PLN\n' +237 ' `END`PUN}`END`PLN\n' +238 '\n' +239 ' `END`COM/**\n' +240 ' * the n&lt;sup&gt;th&lt;/sup&gt; element of the given ' +241 'series.\n' +242 ' * @throws NoSuchElementException if there are less than ' +243 'n elements in the\n' +244 ' * given Iterable\'s {@link Iterable#iterator ' +245 'iterator}.\n' +246 ' *\/`END`PLN\n' +247 ' `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END' +248 '`PUN&lt;`END`PLNT`END`PUN&gt;`END`PLN\n' +249 ' T nth`END`PUN(`END`KWDint`END`PLN n`END`PUN,`END`PLN `END' +250 '`TYPIterable`END`PUN&lt;`END`PLNT`END`PUN&gt;`END' +251 '`PLN iterable`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +252 ' `END`TYPIterator`END`PUN&lt;?`END`PLN ' +253 '`END`KWDextends`END`PLN T`END`PUN&gt;`END`PLN it `END`PUN=`END' +254 '`PLN iterable`END`PUN.`END`PLNiterator`END`PUN();`END`PLN\n' +255 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END' +256 '`PUN&gt;`END`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +257 ' it`END`PUN.`END`KWDnext`END`PUN();`END`PLN\n' +258 ' `END`PUN}`END`PLN\n' +259 ' `END`KWDreturn`END`PLN it`END`PUN.`END`KWDnext`END' +260 '`PUN();`END`PLN\n' +261 ' `END`PUN}`END`PLN\n' +262 '\n' +263 ' `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END`KWDvoid`END' +264 '`PLN main`END`PUN(`END`TYPString`END`PUN[]`END`PLN args`END' +265 '`PUN)`END`PLN `END`PUN{`END`PLN\n' +266 ' `END`TYPSystem`END`PUN.`END`KWDout`END`PUN.`END' +267 '`KWDprint`END`PUN(`END`PLNnth`END`PUN(`END`LIT10`END`PUN,`END' +268 '`PLN `END`KWDnew`END`PLN `END`TYPFibonacci`END`PUN()));`END' +269 '`PLN\n' +270 ' `END`PUN}`END`PLN\n' +271 '`END`PUN}`END'272 ),273 java_lang: (274 '<ol class="linenums"><li class="L1" value="12">' +275 '`KWDpackage`END`PLN foo`END`PUN;`END' +276 '`#2`PLN&nbsp;`END' +277 '`#3`KWDimport`END`PLN java`END`PUN.`END`PLNutil`END`PUN.`END' +278 '`TYPIterator`END`PUN;`END' +279 '`#4`PLN&nbsp;`END' +280 '`#5`COM/**`END' +281 '`#6`COM * the fibonacci series implemented as an Iterable.`END' +282 '`#7`COM *\/`END' +283 '`#8`KWDpublic`END`PLN `END`KWDfinal`END`PLN `END`KWDclass`END' +284 '`PLN `END`TYPFibonacci`END`PLN `END`KWDimplements`END`PLN `END' +285 '`TYPIterable`END`PUN&lt;`END`TYPInteger`END`PUN&gt;`END`PLN `END`' +286 'PUN{`END' +287 '`#9`PLN `END' +288 '`COM/** the next and previous members of the series. *\/`END' +289 '' +290 '`#0`PLN `END`KWDprivate`END`PLN `END`KWDint`END`PLN a `END`PUN=`END' +291 '`PLN `END`LIT1`END`PUN,`END`PLN b `END`PUN=`END`PLN `END`LIT1`END' +292 '`PUN;`END' +293 '`#1`PLN&nbsp;`END' +294 '`#2`PLN `END`LIT@Override`END' +295 '`#3`PLN `END`KWDpublic`END`PLN `END`TYPIterator`END`PUN&lt;`END' +296 '`TYPInteger`END`PUN&gt;`END`PLN iterator`END`PUN()`END`PLN `END' +297 '`PUN{`END' +298 '`#4`PLN `END`KWDreturn`END`PLN `END`KWDnew`END`PLN `END' +299 '`TYPIterator`END`PUN&lt;`END`TYPInteger`END`PUN&gt;()`END`PLN `END' +300 '`PUN{`END' +301 '`#5`PLN `END`COM/** the series is infinite. *\/`END' +302 '' +303 '`#6`PLN `END`KWDpublic`END`PLN `END`KWDboolean`END' +304 '`PLN hasNext`END`PUN()`END`PLN `END`PUN{`END`PLN `END' +305 '`KWDreturn`END`PLN `END`KWDtrue`END`PUN;`END`PLN `END`PUN}`END' +306 '' +307 '`#7`PLN `END`KWDpublic`END`PLN `END`TYPInteger`END' +308 '`PLN next`END`PUN()`END`PLN `END`PUN{`END' +309 '`#8`PLN `END`KWDint`END`PLN tmp `END`PUN=`END' +310 '`PLN a`END`PUN;`END' +311 '`#9`PLN a `END`PUN+=`END`PLN b`END`PUN;`END' +312 '' +313 '`#0`PLN b `END`PUN=`END`PLN tmp`END`PUN;`END' +314 '' +315 '`#1`PLN `END`KWDreturn`END`PLN a`END`PUN;`END' +316 '' +317 '`#2`PLN `END`PUN}`END' +318 '`#3`PLN `END`KWDpublic`END`PLN `END`KWDvoid`END' +319 '`PLN remove`END`PUN()`END`PLN `END`PUN{`END`PLN `END`KWDthrow`END' +320 '`PLN `END`KWDnew`END`PLN `END' +321 '`TYPUnsupportedOperationException`END`PUN();`END`PLN `END' +322 '`PUN}`END' +323 '`#4`PLN `END`PUN};`END' +324 '`#5`PLN `END`PUN}`END' +325 '`#6`PLN&nbsp;`END' +326 '`#7`PLN `END`COM/**`END' +327 '`#8`COM * the n&lt;sup&gt;th&lt;/sup&gt; element of the given ' +328 'series.`END' +329 '`#9`COM * @throws NoSuchElementException if there are less than ' +330 'n elements in the`END' +331 '`#0`COM * given Iterable\'s {@link Iterable#iterator ' +332 'iterator}.`END' +333 '`#1`COM *\/`END' +334 '`#2`PLN `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END' +335 '`PUN&lt;`END`PLNT`END`PUN&gt;`END' +336 '`#3`PLN T nth`END`PUN(`END`KWDint`END`PLN n`END`PUN,`END`PLN `END' +337 '`TYPIterable`END`PUN&lt;`END`PLNT`END`PUN&gt;`END' +338 '`PLN iterable`END`PUN)`END`PLN `END`PUN{`END' +339 '`#4`PLN `END`TYPIterator`END`PUN&lt;?`END`PLN `END' +340 '`KWDextends`END`PLN T`END`PUN&gt;`END`PLN in `END`PUN=`END' +341 '`PLN iterable`END`PUN.`END`PLNiterator`END`PUN();`END' +342 '`#5`PLN `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END' +343 '`PUN&gt;`END`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END' +344 '`#6`PLN in`END`PUN.`END`PLNnext`END`PUN();`END' +345 '`#7`PLN `END`PUN}`END' +346 '`#8`PLN `END`KWDreturn`END`PLN in`END`PUN.`END`PLNnext`END' +347 '`PUN();`END' +348 '`#9`PLN `END`PUN}`END' +349 '`#0`PLN&nbsp;`END' +350 '`#1`PLN `END`KWDpublic`END`PLN `END`KWDstatic`END`PLN `END`KWDvoid`END' +351 '`PLN main`END`PUN(`END`TYPString`END`PUN[]`END`PLN args`END' +352 '`PUN)`END`PLN `END`PUN{`END' +353 '`#2`PLN `END`TYPSystem`END`PUN.`END`PLNout`END`PUN.`END' +354 '`PLNprint`END`PUN(`END`PLNnth`END`PUN(`END`LIT10`END`PUN,`END' +355 '`PLN `END`KWDnew`END`PLN `END`TYPFibonacci`END`PUN()));`END' +356 '' +357 '`#3`PLN `END`PUN}`END' +358 '`#4`PUN}`END' +359 '`#5`PLN&nbsp;`END' +360 '`#6`PUN#`END`PLN not a java comment`END' +361 '`#7`PUN#`END`PLN not keywords`END`PUN:`END' +362 '`PLN static_cast and namespace`END</li></ol>'363 ),364 javascript: (365 '`COM/**\n' +366 ' * nth element in the fibonacci series.\n' +367 ' * @param n &gt;= 0\n' +368 ' * @return the nth element, &gt;= 0.\n' +369 ' *\/`END`PLN\n' +370 '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +371 '`PUN{`END`PLN\n' +372 ' `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +373 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +374 ' `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN\n' +375 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +376 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +377 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +378 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +379 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +380 ' `END`PUN}`END`PLN\n' +381 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +382 '`END`PUN}`END`PLN\n' +383 '\n' +384 'document`END`PUN.`END`PLNwrite`END`PUN(`END`PLNfib`END`PUN(`END' +385 '`LIT10`END`PUN));`END'386 ),387 perl: (388 '`COM#!/usr/bin/perl`END`PLN\n' +389 '\n' +390 '`END`KWDuse`END`PLN strict`END`PUN;`END`PLN\n' +391 '`END`KWDuse`END`PLN integer`END`PUN;`END`PLN\n' +392 '\n' +393 '`END`COM# the nth element of the fibonacci series`END`PLN\n' +394 '`END`COM# param n - an int &gt;= 0`END`PLN\n' +395 '`END`COM# return an int &gt;= 0`END`PLN\n' +396 '`END`KWDsub`END`PLN fib`END`PUN(`END`PLN$`END`PUN)`END`PLN `END' +397 '`PUN{`END`PLN\n' +398 ' `END`KWDmy`END`PLN $n `END`PUN=`END`PLN shift`END`PUN,`END`PLN ' +399 '$a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END`PLN $b `END' +400 '`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +401 ' `END`PUN(`END`PLN$a`END`PUN,`END`PLN $b`END`PUN)`END' +402 '`PLN `END`PUN=`END`PLN `END`PUN(`END`PLN$a `END`PUN+`END' +403 '`PLN $b`END`PUN,`END`PLN $a`END`PUN)`END`PLN `END`KWDuntil`END' +404 '`PLN `END`PUN(--`END`PLN$n `END`PUN&lt;`END`PLN `END`LIT0`END' +405 '`PUN);`END`PLN\n' +406 ' `END`KWDreturn`END`PLN $a`END`PUN;`END`PLN\n' +407 '`END`PUN}`END`PLN\n' +408 '\n' +409 '`END`KWDprint`END`PLN fib`END`PUN(`END`LIT10`END`PUN);`END'410 ),411 python: (412 '`COM#!/usr/bin/python2.4`END`PLN\n' +413 '\n' +414 '`END`KWDdef`END`PLN fib`END`PUN():`END`PLN\n' +415 ' `END`STR\'\'\'\n' +416 ' a generator that produces the elements of the fibonacci series' +417 '\n' +418 ' \'\'\'`END`PLN\n' +419 '\n' +420 ' a `END`PUN=`END`PLN `END`LIT1`END`PLN\n' +421 ' b `END`PUN=`END`PLN `END`LIT1`END`PLN\n' +422 ' `END`KWDwhile`END`PLN `END`KWDTrue`END`PUN:`END`PLN\n' +423 ' a`END`PUN,`END`PLN b `END`PUN=`END`PLN a `END`PUN+`END' +424 '`PLN b`END`PUN,`END`PLN a\n' +425 ' `END`KWDyield`END`PLN a\n' +426 '\n' +427 '`END`KWDdef`END`PLN nth`END`PUN(`END`PLNseries`END`PUN,`END`PLN n`END' +428 '`PUN):`END`PLN\n' +429 ' `END`STR\'\'\'\n' +430 ' returns the nth element of a series,\n' +431 ' consuming the earlier elements of the series\n' +432 ' \'\'\'`END`PLN\n' +433 '\n' +434 ' `END`KWDfor`END`PLN x `END`KWDin`END`PLN series`END`PUN:`END' +435 '`PLN\n' +436 ' n `END`PUN=`END`PLN n `END`PUN-`END`PLN `END`LIT1`END' +437 '`PLN\n' +438 ' `END`KWDif`END`PLN n `END`PUN&lt;=`END`PLN `END' +439 '`LIT0`END`PUN:`END`PLN `END`KWDreturn`END`PLN x\n' +440 '\n' +441 '`END`KWDprint`END`PLN nth`END`PUN(`END`PLNfib`END`PUN(),`END`PLN `END' +442 '`LIT10`END`PUN)`END'443 ),444 python_lang: (445 '`COM#!/usr/bin/python2.4`END`PLN\n' +446 '\n' +447 '`END`KWDdef`END`PLN fib`END`PUN():`END`PLN\n' +448 ' `END`STR\'\'\'\n' +449 ' a generator that produces the fibonacci series\'s elements' +450 '\n' +451 ' \'\'\'`END`PLN\n' +452 '\n' +453 ' a `END`PUN=`END`PLN `END`LIT1`END`PLN\n' +454 ' b `END`PUN=`END`PLN `END`LIT1`END`PLN\n' +455 ' `END`KWDwhile`END`PLN `END`KWDTrue`END`PUN:`END`PLN\n' +456 ' a`END`PUN,`END`PLN b `END`PUN=`END`PLN a `END`PUN+`END' +457 '`PLN b`END`PUN,`END`PLN a\n' +458 ' `END`KWDyield`END`PLN a\n' +459 '\n' +460 '`END`KWDdef`END`PLN nth`END`PUN(`END`PLNseries`END`PUN,`END`PLN n`END' +461 '`PUN):`END`PLN\n' +462 ' `END`STR\'\'\'\n' +463 ' returns the nth element of a series,\n' +464 ' consuming the series\' earlier elements.\n' +465 ' \'\'\'`END`PLN\n' +466 '\n' +467 ' `END`KWDfor`END`PLN x `END`KWDin`END`PLN series`END`PUN:`END' +468 '`PLN\n' +469 ' n `END`PUN-=`END`PLN `END`LIT1`END' +470 '`PLN\n' +471 ' `END`KWDif`END`PLN n `END`PUN&lt;=`END`PLN `END' +472 '`LIT0`END`PUN:`END`PLN `END`KWDreturn`END`PLN x\n' +473 '\n' +474 '`END`KWDprint`END`PLN nth`END`PUN(`END`PLNfib`END`PUN(),`END`PLN `END' +475 '`LIT10`END`PUN)`END`PLN\n' +476 '\n' +477 '`END`PUN/*`END`PLN `END`KWDnot`END`PLN a comment `END`KWDand`END' +478 '`PLN `END`KWDnot`END`PLN keywords`END`PUN:`END' +479 '`PLN null char true `END`PUN*\/`END'480 ),481 sql_lang: (482 '`COM/* A multi-line\n' +483 ' * comment *\/`END`PLN\n' +484 '`END`STR\'Another string /* Isn\\\'t a comment\'`END`PUN,`END`PLN\n' +485 '`END`STR"A string *\/"`END`PLN\n' +486 '`END`COM-- A line comment`END`PLN\n' +487 '`END`KWDSELECT`END`PLN `END`PUN*`END`PLN `END`KWDFROM`END' +488 '`PLN users `END`KWDWHERE`END`PLN id `END`KWDIN`END`PLN `END' +489 '`PUN(`END`LIT1`END`PUN,`END`PLN `END`LIT2.0`END`PUN,`END`PLN `END' +490 '`LIT+30e-1`END`PUN);`END`PLN\n' +491 '`END`COM-- keywords are case-insensitive.`END`PLN\n' +492 '`END`COM-- Note: user-table is a single identifier, not a pair of' +493 ' keywords`END`PLN\n' +494 '`END`KWDselect`END`PLN `END`PUN*`END`PLN `END`KWDfrom`END' +495 '`PLN user-table `END`KWDwhere`END`PLN id `END`KWDin`END`PLN `END' +496 '`PUN(`END`PLNx`END`PUN,`END`PLN y`END`PUN,`END`PLN z`END`PUN);`END'497 ),498 xml: (499 '`DEC&lt;!DOCTYPE series PUBLIC "fibonacci numbers"&gt;`END`PLN\n' +500 '\n' +501 '`END`TAG&lt;series.root`END`PLN `END`ATNbase`END`PUN=`END' +502 '`ATV"1"`END`PLN `END' +503 '`ATNstep`END`PUN=`END`ATV"s(n-2) + s(n-1)"`END`TAG&gt;`END' +504 '`PLN\n' +505 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +506 '`ATV"0"`END' +507 '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END' +508 '`PLN\n' +509 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +510 '`ATV"1"`END' +511 '`TAG&gt;`END`PLN1`END`TAG&lt;/element&gt;`END' +512 '`PLN\n' +513 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +514 '`ATV"2"`END' +515 '`TAG&gt;`END`PLN2`END`TAG&lt;/element&gt;`END' +516 '`PLN\n' +517 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +518 '`ATV"3"`END' +519 '`TAG&gt;`END`PLN3`END`TAG&lt;/element&gt;`END' +520 '`PLN\n' +521 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +522 '`ATV"4"`END' +523 '`TAG&gt;`END`PLN5`END`TAG&lt;/element&gt;`END' +524 '`PLN\n' +525 ' `END`TAG&lt;element`END`PLN `END`ATNi`END`PUN=`END' +526 '`ATV"5"`END' +527 '`TAG&gt;`END`PLN8`END`TAG&lt;/element&gt;`END' +528 '`PLN\n' +529 ' ...\n' +530 '`END`TAG&lt;/series.root&gt;`END'531 ),532 html: (533 '`TAG&lt;html&gt;`END`PLN\n' +534 ' `END`TAG&lt;head&gt;`END`PLN\n' +535 ' `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +536 '`TAG&lt;/title&gt;`END`PLN\n' +537 ' `END`TAG&lt;style&gt;`END`COM&lt;!--`END' +538 '`PLN BODY `END`PUN{`END`PLN `END`KWDtext-decoration`END`PUN:`END' +539 '`PLN blink `END`PUN}`END`PLN `END`COM--&gt;`END`TAG&lt;/' +540 'style&gt;`END`PLN\n' +541 ' `END`TAG&lt;script`END`PLN `END`ATNsrc`END`PUN=`END' +542 '`ATV"foo.js"`END`TAG&gt;&lt;/script&gt;`END`PLN\n' +543 ' `END`TAG&lt;script`END`PLN `END`ATNsrc`END`PUN=`END' +544 '`ATV"bar.js"`END`TAG&gt;&lt;/script&gt;`END`PLN\n' +545 ' `END`TAG&lt;/head&gt;`END`PLN\n' +546 ' `END`TAG&lt;body&gt;`END`PLN\n' +547 ' `END`TAG&lt;noscript&gt;`END`PLN\n' +548 ' `END`TAG&lt;dl&gt;`END`PLN\n' +549 ' `END`TAG&lt;dt&gt;`END' +550 '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END' +551 '`PLN\n' +552 ' `END`TAG&lt;dd&gt;`END`PLN1`END' +553 '`TAG&lt;/dd&gt;`END`PLN\n' +554 ' `END`TAG&lt;dd&gt;`END`PLN1`END' +555 '`TAG&lt;/dd&gt;`END`PLN\n' +556 ' `END`TAG&lt;dd&gt;`END`PLN2`END' +557 '`TAG&lt;/dd&gt;`END`PLN\n' +558 ' `END`TAG&lt;dd&gt;`END`PLN3`END' +559 '`TAG&lt;/dd&gt;`END`PLN\n' +560 ' `END`TAG&lt;dd&gt;`END`PLN5`END' +561 '`TAG&lt;/dd&gt;`END`PLN\n' +562 ' `END`TAG&lt;dd&gt;`END`PLN8`END' +563 '`TAG&lt;/dd&gt;`END`PLN\n' +564 ' &amp;hellip;\n' +565 ' `END`TAG&lt;/dl&gt;`END`PLN\n' +566 ' `END`TAG&lt;/noscript&gt;`END`PLN\n' +567 '\n' +568 ' `END`TAG&lt;script`END`PLN `END`ATNtype`END`PUN=`END' +569 '`ATV"text/javascript"`END`TAG&gt;`END`PUN&lt;!--`END`PLN\n' +570 '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +571 '`PUN{`END`PLN\n' +572 ' `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +573 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +574 ' `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN\n' +575 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +576 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +577 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +578 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +579 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +580 ' `END`PUN}`END`PLN\n' +581 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +582 '`END`PUN}`END`PLN\n' +583 '\n' +584 'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +585 '`LIT10`END`PUN));`END`PLN\n' +586 '`END`COM// --&gt;`END`PLN\n' +587 ' `END`TAG&lt;/script&gt;`END`PLN\n' +588 ' `END`TAG&lt;/body&gt;`END`PLN\n' +589 '`END`TAG&lt;/html&gt;`END'590 ),591 html_lang: (592 '`PLNFibonacci Numbers\n' +593 '\n' +594 '`END`TAG&lt;noscript&gt;`END`PLN\n' +595 ' `END`TAG&lt;dl`END`PLN `END`ATNstyle`END`PUN=`END' +596 '`ATV"`END`KWDlist-style`END`PUN:`END`PLN disc`END`ATV"`END' +597 '`TAG&gt;`END`PLN\n' +598 ' `END`TAG&lt;dt&gt;`END' +599 '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN\n' +600 ' `END`TAG&lt;dd&gt;`END`PLN1`END`TAG&lt;/dd&gt;`END' +601 '`PLN\n' +602 ' `END`TAG&lt;dd&gt;`END`PLN1`END`TAG&lt;/dd&gt;`END' +603 '`PLN\n' +604 ' `END`TAG&lt;dd&gt;`END`PLN2`END`TAG&lt;/dd&gt;`END' +605 '`PLN\n' +606 ' `END`TAG&lt;dd&gt;`END`PLN3`END`TAG&lt;/dd&gt;`END' +607 '`PLN\n' +608 ' `END`TAG&lt;dd&gt;`END`PLN5`END`TAG&lt;/dd&gt;`END' +609 '`PLN\n' +610 ' `END`TAG&lt;dd&gt;`END`PLN8`END`TAG&lt;/dd&gt;`END' +611 '`PLN\n' +612 ' &amp;hellip;\n' +613 ' `END`TAG&lt;/dl&gt;`END`PLN\n' +614 '`END`TAG&lt;/noscript&gt;`END`PLN\n' +615 '\n' +616 '`END`TAG&lt;script`END`PLN `END`ATNtype`END`PUN=`END' +617 '`ATV"text/javascript"`END`TAG&gt;`END`PUN&lt;!--`END`PLN\n' +618 '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +619 '`PUN{`END`PLN\n' +620 ' `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +621 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +622 ' `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN\n' +623 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +624 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +625 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +626 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +627 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +628 ' `END`PUN}`END`PLN\n' +629 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +630 '`END`PUN}`END`PLN\n' +631 '\n' +632 'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +633 '`LIT10`END`PUN));`END`PLN\n' +634 '`END`COM// --&gt;`END`PLN\n' +635 '`END`TAG&lt;/script&gt;`END'636 ),637 html_xmp: (638 '`TAG&lt;html&gt;`END`PLN\n' +639 ' `END`TAG&lt;head&gt;`END`PLN\n' +640 ' `END`TAG&lt;title&gt;`END`PLNFibonacci number`END' +641 '`TAG&lt;/title&gt;`END`PLN\n' +642 ' `END`TAG&lt;/head&gt;`END`PLN\n' +643 ' `END`TAG&lt;body&gt;`END`PLN\n' +644 ' `END`TAG&lt;noscript&gt;`END`PLN\n' +645 ' `END`TAG&lt;dl&gt;`END`PLN\n' +646 ' `END`TAG&lt;dt&gt;`END' +647 '`PLNFibonacci numbers`END`TAG&lt;/dt&gt;`END`PLN\n' +648 ' `END`TAG&lt;dd&gt;`END`PLN1`END' +649 '`TAG&lt;/dd&gt;`END`PLN\n' +650 ' `END`TAG&lt;dd&gt;`END`PLN1`END' +651 '`TAG&lt;/dd&gt;`END`PLN\n' +652 ' `END`TAG&lt;dd&gt;`END`PLN2`END' +653 '`TAG&lt;/dd&gt;`END`PLN\n' +654 ' `END`TAG&lt;dd&gt;`END`PLN3`END' +655 '`TAG&lt;/dd&gt;`END`PLN\n' +656 ' `END`TAG&lt;dd&gt;`END`PLN5`END' +657 '`TAG&lt;/dd&gt;`END`PLN\n' +658 ' `END`TAG&lt;dd&gt;`END`PLN8`END' +659 '`TAG&lt;/dd&gt;`END`PLN\n' +660 ' &amp;hellip;\n' +661 ' `END`TAG&lt;/dl&gt;`END`PLN\n' +662 ' `END`TAG&lt;/noscript&gt;`END`PLN\n' +663 '\n' +664 ' `END`TAG&lt;script`END`PLN `END`ATNtype`END`PUN=`END' +665 '`ATV"text/javascript"`END`TAG&gt;`END`PUN&lt;!--`END`PLN\n' +666 '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +667 '`PUN{`END`PLN\n' +668 ' `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +669 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +670 ' `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN\n' +671 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +672 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +673 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +674 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +675 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +676 ' `END`PUN}`END`PLN\n' +677 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +678 '`END`PUN}`END`PLN\n' +679 '\n' +680 'document`END`PUN.`END`PLNwriteln`END`PUN(`END`PLNfib`END`PUN(`END' +681 '`LIT10`END`PUN));`END`PLN\n' +682 '`END`COM// --&gt;`END`PLN\n' +683 ' `END`TAG&lt;/script&gt;`END`PLN\n' +684 ' `END`TAG&lt;/body&gt;`END`PLN\n' +685 '`END`TAG&lt;/html&gt;`END'686 ),687 xhtml: (688 '`TAG&lt;xhtml&gt;`END`PLN\n' +689 ' `END`TAG&lt;head&gt;`END`PLN\n' +690 ' `END`TAG&lt;title&gt;`END' +691 '`PLNFibonacci number`END`TAG&lt;/title&gt;`END' +692 '`PLN\n' +693 ' `END`TAG&lt;/head&gt;`END`PLN\n' +694 ' `END`TAG&lt;body`END`PLN `END`ATNonload`END`PUN=`END' +695 '`ATV"`END`PLNalert`END`PUN(`END`PLNfib`END`PUN(`END`LIT10`END' +696 '`PUN))`END`ATV"`END`TAG&gt;`END`PLN\n' +697 ' `END`TAG&lt;script`END`PLN `END`ATNtype`END' +698 '`PUN=`END`ATV"text/javascript"`END`TAG&gt;`END' +699 '`PUN&lt;![`END`PLNCDATA`END`PUN[`END`PLN\n' +700 '`END`KWDfunction`END`PLN fib`END`PUN(`END`PLNn`END`PUN)`END`PLN `END' +701 '`PUN{`END`PLN\n' +702 ' `END`KWDvar`END`PLN a `END`PUN=`END`PLN `END`LIT1`END`PUN,`END' +703 '`PLN b `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +704 ' `END`KWDvar`END`PLN tmp`END`PUN;`END`PLN\n' +705 ' `END`KWDwhile`END`PLN `END`PUN(--`END`PLNn `END`PUN&gt;=`END' +706 '`PLN `END`LIT0`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +707 ' tmp `END`PUN=`END`PLN a`END`PUN;`END`PLN\n' +708 ' a `END`PUN+=`END`PLN b`END`PUN;`END`PLN\n' +709 ' b `END`PUN=`END`PLN tmp`END`PUN;`END`PLN\n' +710 ' `END`PUN}`END`PLN\n' +711 ' `END`KWDreturn`END`PLN a`END`PUN;`END`PLN\n' +712 '`END`PUN}`END`PLN\n' +713 '`END`PUN]]&gt;`END`PLN\n' +714 ' `END`TAG&lt;/script&gt;`END`PLN\n' +715 ' `END`TAG&lt;/body&gt;`END`PLN\n' +716 '`END`TAG&lt;/xhtml&gt;`END'717 ),718 php: (719 '`TAG&lt;html&gt;`END`PLN\n' +720 ' `END`TAG&lt;head&gt;`END`PLN\n' +721 ' `END`TAG&lt;title&gt;`END`PUN&lt;?=`END' +722 '`PLN `END' +723 '`STR\'Fibonacci numbers\'`END`PLN `END' +724 '`PUN?&gt;`END`TAG&lt;/title&gt;`END`PLN\n' +725 '\n' +726 ' `END`PUN&lt;?`END`PLNphp\n' +727 ' `END`COM// PHP has a plethora of comment types' +728 '`END`PLN\n' +729 ' `END`COM\/* What is a\n' +730 ' "plethora"? *\/`END`PLN\n' +731 ' `END`KWDfunction`END`PLN fib`END`PUN(`END' +732 '`PLN$n`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +733 ' `END`COM# I don\'t know.`END`PLN\n' +734 ' $a `END`PUN=`END`PLN `END`LIT1`END' +735 '`PUN;`END`PLN\n' +736 ' $b `END`PUN=`END`PLN `END`LIT1`END' +737 '`PUN;`END`PLN\n' +738 ' `END`KWDwhile`END`PLN `END`PUN(--`END' +739 '`PLN$n `END`PUN&gt;=`END`PLN `END`LIT0`END`PUN)`END`PLN `END' +740 '`PUN{`END`PLN\n' +741 ' echo `END`STR"$a\\n"`END`PUN;`END' +742 '`PLN\n' +743 ' $tmp `END`PUN=`END`PLN $a`END' +744 '`PUN;`END`PLN\n' +745 ' $a `END`PUN+=`END`PLN $b`END' +746 '`PUN;`END`PLN\n' +747 ' $b `END`PUN=`END`PLN $tmp`END' +748 '`PUN;`END`PLN\n' +749 ' `END`PUN}`END`PLN\n' +750 ' `END`PUN}`END`PLN\n' +751 ' `END`PUN?&gt;`END`PLN\n' +752 ' `END`TAG&lt;/head&gt;`END`PLN\n' +753 ' `END`TAG&lt;body&gt;`END`PLN\n' +754 ' `END`PUN&lt;?=`END`PLN fib`END' +755 '`PUN(`END`LIT10`END`PUN)`END`PLN `END`PUN?&gt;`END`PLN\n' +756 ' `END`TAG&lt;/body&gt;`END`PLN\n' +757 '`END`TAG&lt;/html&gt;`END'758 ),759 xsl: (760 '`COM&lt;!-- Test elements and attributes with namespaces --&gt;' +761 '`END`PLN\n' +762 '\n' +763 '`END`TAG&lt;xsl:stylesheet`END`PLN `END`ATNxml:lang`END' +764 '`PUN=`END`ATV"en"`END`TAG&gt;`END`PLN\n' +765 ' `END`TAG&lt;xsl:template`END' +766 '`PLN `END`ATNmatch`END`PUN=`END`ATV"."`END' +767 '`TAG&gt;`END`PLN\n' +768 ' `END`TAG&lt;xsl:text&gt;`END' +769 '`PLNHello World`END' +770 '`TAG&lt;/xsl:text&gt;`END`PLN\n' +771 ' `END`TAG&lt;/xsl:template&gt;`END`PLN\n' +772 '`END`TAG&lt;/xsl:stylesheet&gt;`END'773 ),774 whitespace: '',775 misc1: (776 '`COM// ends with line comment token`END`PLN\n' +777 '`END`COM//`END'778 ),779 js_script: (780 '`TAG&lt;script`END`PLN `END' +781 '`ATNtype`END`PUN=`END`ATV"text/javascript"`END' +782 '`TAG&gt;`END`PLN\n' +783 ' var savedTarget=null' +784 '; ' +785 ' // The target ' +786 'layer (effectively vidPane)\n' +787 ' var orgCursor=null' +788 '; ' +789 ' // The ' +790 'original mouse style so we can restore it\n' +791 ' var dragOK=false' +792 '; ' +793 ' ' +794 '// True if we\'re allowed to move the element under mouse' +795 '\n' +796 ' var dragXoffset=0' +797 '; ' +798 ' ' +799 '// How much we\'ve moved the element on the horozontal' +800 '\n' +801 ' var dragYoffset=0' +802 '; ' +803 ' ' +804 '// How much we\'ve moved the element on the verticle' +805 '\n' +806 ' vidPaneID = document.' +807 'getElementById(\'vidPane\');' +808 ' // Our movable layer\n' +809 ' vidPaneID.style.top' +810 '=\'75px\'; ' +811 ' // ' +812 'Starting location horozontal\n' +813 ' vidPaneID.style.left' +814 '=\'75px\'; ' +815 ' // ' +816 'Starting location verticle\n' +817 '`END`TAG&lt;script&gt;`END'818 ),819 issue8: (820 '<b>`PLNone`END</b>`PLN\t`END<b>`TYPTwo`END</b>`PLN' +821 '\t`END<b>`PLNthree`END</b>`PLN\t`END`TYPFour' +822 '`END`PLN\t`END<b>`PLNfive`END</b>`PLN\t' +823 '`END`PUN|`END`PLN\n' +824 '`END`TYPSix`END`PLN\t`END<b>`PLNseven`END</b>`PLN\t' +825 '`END`TYPEight`END`PLN\tnine\t`END`TYPTen`END' +826 '`PLN\t`END`PUN|`END`PLN\n' +827 '`END<b>`PLNeleven`END</b>`PLN\t`END`TYPTwelve`END`PLN\t`END' +828 '<b>`PLNthirteen`END</b>`PLN\t`END' +829 '`TYPFourteen`END`PLN\tfifteen\t`END`' +830 'PUN|`END'831 ),832 js_regexp: (833 '`STR/foo/`END`PUN;`END`PLN `END`COM// a slash starting a line ' +834 'treated as a regexp beginning`END`PLN\n' +835 '`END`STR"foo"`END`PUN.`END`PLNmatch`END`PUN(`END`STR/fo+$/`END' +836 '`PUN);`END`PLN\n' +837 '`END`COM// this line comment not treated as a regular expressions`END' +838 '`PLN\n' +839 '`END`STR"foo /bar/"`END`PUN.`END`PLNtest`END`PUN(`END`STR/"baz"/`END' +840 '`PUN);`END`PLN `END`COM// test string and regexp boundaries' +841 '`END`PLN\n' +842 '`END`KWDvar`END`PLN division `END`PUN=`END`PLN `END' +843 '`STR/\\b\\d+\\/\\d+/`END`PLNg`END`PUN;`END`PLN `END' +844 '`COM// test char sets and escaping of specials`END`PLN\n' +845 '`END`KWDvar`END`PLN allSpecials `END`PUN=`END`PLN `END' +846 '`STR/([^\\(\\)\\[\\]\\{\\}\\-\\?\\+\\*\\.\\^\\$\\/]+)\\\\/`END' +847 '`PUN;`END`PLN\n' +848 '`END`KWDvar`END`PLN slashInCharset `END`PUN=`END`PLN `END' +849 '`STR/[^/]/`END`PLNg`END`PUN,`END`PLN notCloseSq `END`PUN=`END' +850 '`PLN `END`STR/[^\\]]/`END`PUN;`END`PLN\n' +851 '\n' +852 '`END`COM// test that slash used in numeric context treated as an ' +853 'operator`END`PLN\n' +854 '`END`LIT1`END`PLN `END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN\n' +855 '`END`LIT1.`END`PLN `END`PUN/`END`PLN x`END`PUN;`END`PLN\n' +856 'x `END`PUN/`END`PLN y`END`PUN;`END`PLN\n' +857 '`END`PUN(`END`PLNx`END`PUN)`END`PLN `END`PUN/`END`PLN y`END`PUN;`END' +858 '`PLN\n' +859 '`END`LIT1`END`PLN `END`COM/* foo *\/`END`PLN `END`PUN/`END`PLN `END' +860 '`LIT2`END`PUN;`END`PLN\n' +861 '`END`LIT1`END`PLN `END`COM/* foo *\/`END`PUN/`END`PLN `END`LIT2`END' +862 '`PUN;`END`PLN\n' +863 '`END`LIT1`END`PUN/`END`LIT2`END`PUN;`END`PLN\n' +864 '`END`LIT1.`END`PUN/`END`PLNx`END`PUN;`END`PLN\n' +865 'x`END`PUN/`END`PLNy`END`PUN;`END`PLN\n' +866 '`END`PUN(`END`PLNx`END`PUN)/`END`PLNy`END`PUN;`END`PLN\n' +867 '\n' +868 '`END`COM// test split over two lines. line comment should not ' +869 'fool it`END`PLN\n' +870 '`END`LIT1`END`COM//`END`PLN\n' +871 '`END`PUN/`END`LIT2`END`PUN;`END`PLN\n' +872 '\n' +873 'x`END`PUN++/`END`PLNy`END`PUN;`END`PLN\n' +874 'x`END`PUN--/`END`PLNy`END`PUN;`END`PLN\n' +875 'x`END`PUN[`END`PLNy`END`PUN]`END`PLN `END`PUN/`END`PLN z`END`PUN;`END' +876 '`PLN\n' +877 'f`END`PUN()`END`PLN `END`PUN/`END`PLN n`END`PUN;`END`PLN\n' +878 '\n' +879 '`END`COM// test that slash after non postfix operator is start of ' +880 'regexp`END`PLN\n' +881 'log`END`PUN(`END`STR\'matches = \'`END`PLN `END`PUN+`END`PLN `END' +882 '`STR/foo/`END`PUN.`END`PLNtest`END`PUN(`END`PLNfoo`END`PUN));`END' +883 '`PLN\n' +884 '\n' +885 '`END`COM// test keyword preceders`END`PLN\n' +886 '`END`KWDreturn`END`PLN `END`STR/a regexp/`END`PUN;`END`PLN\n' +887 'division `END`PUN=`END`PLN notreturn `END`PUN/`END`PLN not_a_regexp ' +888 '`END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN `END`COM// ' +889 'keyword suffix does not match`END`PLN\n' +890 '\n' +891 '`END`COM// &amp; not used as prefix operator in javascript but this ' +892 'should still work`END`PLN\n' +893 '`END`PUN&amp;`END`STR/foo/`END`PUN;`END`PLN\n' +894 '\n' +895 '`END`KWDextends`END`PLN `END`PUN=`END`PLN `END`STR/extends/`END' +896 '`PUN;`END'897 ),898 js_regexp_lang: (899 '`STR/foo/`END`PUN;`END`PLN `END`COM// a slash starting a line ' +900 'treated as a regexp beginning`END`PLN\n' +901 '`END`STR"foo"`END`PUN.`END`PLNmatch`END`PUN(`END`STR/fo+$/`END' +902 '`PUN);`END`PLN\n' +903 '`END`COM// this line comment not treated as a regular expressions`END' +904 '`PLN\n' +905 '`END`STR"foo /bar/"`END`PUN.`END`PLNtest`END`PUN(`END`STR/"baz"/`END' +906 '`PUN);`END`PLN `END`COM// test string and regexp boundaries' +907 '`END`PLN\n' +908 '`END`KWDvar`END`PLN division `END`PUN=`END`PLN `END' +909 '`STR/\\b\\d+\\/\\d+/`END`PLNg`END`PUN;`END`PLN `END' +910 '`COM// test char sets and escaping of specials`END`PLN\n' +911 '`END`KWDvar`END`PLN allSpecials `END`PUN=`END`PLN `END' +912 '`STR/([^\\(\\)\\[\\]\\{\\}\\-\\?\\+\\*\\.\\^\\$\\/]+)\\\\/`END' +913 '`PUN;`END`PLN\n' +914 '`END`KWDvar`END`PLN slashInCharset `END`PUN=`END`PLN `END' +915 '`STR/[^/]/`END`PLNg`END`PUN,`END`PLN notCloseSq `END`PUN=`END' +916 '`PLN `END`STR/[^\\]]/`END`PUN;`END`PLN\n' +917 '\n' +918 '`END`COM// test that slash used in numeric context treated as an ' +919 'operator`END`PLN\n' +920 '`END`LIT1`END`PLN `END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN\n' +921 '`END`LIT1.`END`PLN `END`PUN/`END`PLN x`END`PUN;`END`PLN\n' +922 'x `END`PUN/`END`PLN y`END`PUN;`END`PLN\n' +923 '`END`PUN(`END`PLNx`END`PUN)`END`PLN `END`PUN/`END`PLN y`END`PUN;`END' +924 '`PLN\n' +925 '`END`LIT1`END`PLN `END`COM/* foo *\/`END`PLN `END`PUN/`END`PLN `END' +926 '`LIT2`END`PUN;`END`PLN\n' +927 '`END`LIT1`END`PLN `END`COM/* foo *\/`END`PUN/`END`PLN `END`LIT2`END' +928 '`PUN;`END`PLN\n' +929 '`END`LIT1`END`PUN/`END`LIT2`END`PUN;`END`PLN\n' +930 '`END`LIT1.`END`PUN/`END`PLNx`END`PUN;`END`PLN\n' +931 'x`END`PUN/`END`PLNy`END`PUN;`END`PLN\n' +932 '`END`PUN(`END`PLNx`END`PUN)/`END`PLNy`END`PUN;`END`PLN\n' +933 '\n' +934 '`END`COM// test split over two lines. line comment should not ' +935 'fool it`END`PLN\n' +936 '`END`LIT1`END`COM//`END`PLN\n' +937 '`END`PUN/`END`LIT2`END`PUN;`END`PLN\n' +938 '\n' +939 'x`END`PUN++/`END`PLNy`END`PUN;`END`PLN\n' +940 'x`END`PUN--/`END`PLNy`END`PUN;`END`PLN\n' +941 'x`END`PUN[`END`PLNy`END`PUN]`END`PLN `END`PUN/`END`PLN z`END`PUN;`END' +942 '`PLN\n' +943 'f`END`PUN()`END`PLN `END`PUN/`END`PLN n`END`PUN;`END`PLN\n' +944 '\n' +945 '`END`COM// test that slash after non postfix operator is start of ' +946 'regexp`END`PLN\n' +947 'log`END`PUN(`END`STR\'matches = \'`END`PLN `END`PUN+`END`PLN `END' +948 '`STR/foo/`END`PUN.`END`PLNtest`END`PUN(`END`PLNfoo`END`PUN));`END' +949 '`PLN\n' +950 '\n' +951 '`END`COM// test keyword preceders`END`PLN\n' +952 '`END`KWDreturn`END`PLN `END`STR/a regexp/`END`PUN;`END`PLN\n' +953 'division `END`PUN=`END`PLN notreturn `END`PUN/`END`PLN not_a_regexp ' +954 '`END`PUN/`END`PLN `END`LIT2`END`PUN;`END`PLN `END`COM// ' +955 'keyword suffix does not match`END`PLN\n' +956 '\n' +957 '`END`COM// &amp; not used as prefix operator in javascript but this ' +958 'should still work`END`PLN\n' +959 '`END`PUN&amp;`END`STR/foo/`END`PUN;`END`PLN\n' +960 '\n' +961 'extends `END`PUN=`END`PLN `END`STR/extends/`END`PUN;`END'962 ),963 coffee: (964 '`KWDclass`END`PLN `END`TYPAnimal`END`PLN\n' +965 ' constructor`END`PUN:`END`PLN `END`PUN(`END`LIT@name`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN\n' +966 ' move`END`PUN:`END`PLN `END`PUN(`END`PLNmeters`END`PUN,`END`PLN loc`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN\n' +967 ' alert `END`LIT@name`END`PLN `END`PUN+`END`PLN `END`STR" moved "`END`PLN `END`PUN+`END`PLN meters `END`PUN+`END`PLN `END`STR"m."`END`PLN\n' +968 ' travel`END`PUN:`END`PLN `END`PUN(`END`PLNpath`END`PUN...)`END`PLN `END`PUN-&gt;`END`PLN\n' +969 ' `END`KWDfor`END`PLN place `END`KWDin`END`PLN path\n' +970 ' `END`LIT@move`END`PLN place`END`PUN.`END`PLNdistance`END`PUN,`END`PLN place`END`PUN.`END`PLNlocation\n' +971 '\n' +972 '`END`KWDclass`END`PLN `END`TYPHorse`END`PLN `END`KWDextends`END`PLN `END`TYPAnimal`END`PLN\n' +973 ' `END`COM###\n' +974 ' @param name Horse name\n' +975 ' @param jumper Jumping ability\n' +976 ' ###`END`PLN\n' +977 ' constructor`END`PUN:`END`PLN `END`PUN(`END`PLNname`END`PUN,`END`PLN jumper`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN\n' +978 ' `END`KWDsuper`END`PLN name\n' +979 ' `END`LIT@capable`END`PLN `END`PUN=`END`PLN jumper\n' +980 ' step`END`PUN:`END`PLN `END`PUN-&gt;`END`PLN\n' +981 ' alert `END`STR\'\'\'\n' +982 ' Step,\n' +983 ' step...\n' +984 ' \'\'\'`END`PLN\n' +985 ' jump`END`PUN:`END`PLN `END`PUN-&gt;`END`PLN\n' +986 ' `END`LIT@capable`END`PLN\n' +987 ' move`END`PUN:`END`PLN `END`PUN(`END`PLNmeters`END`PUN,`END`PLN where`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN\n' +988 ' switch where\n' +989 ' `END`KWDwhen`END`PLN `END`STR"ground"`END`PLN\n' +990 ' `END`LIT@step`END`PUN()`END`PLN\n' +991 ' `END`KWDsuper`END`PLN meters\n' +992 ' `END`KWDwhen`END`PLN `END`STR"hurdle"`END`PLN\n' +993 ' `END`KWDsuper`END`PLN meters `END`KWDif`END`PLN `END`LIT@jump`END`PUN()`END`PLN\n' +994 '\n' +995 '`END`COM# Create horse`END`PLN\n' +996 'tom `END`PUN=`END`PLN `END`KWDnew`END`PLN `END`TYPHorse`END`PLN `END`STR"Tommy"`END`PUN,`END`PLN `END`KWDyes`END`PLN\n' +997 '\n' +998 'street `END`PUN=`END`PLN\n' +999 ' location`END`PUN:`END`PLN `END`STR"ground"`END`PLN\n' +1000 ' distance`END`PUN:`END`PLN `END`LIT12`END`PLN\n' +1001 'car `END`PUN=`END`PLN\n' +1002 ' location`END`PUN:`END`PLN `END`STR"hurdle"`END`PLN\n' +1003 ' distance`END`PUN:`END`PLN `END`LIT2`END`PLN\n' +1004 '\n' +1005 '`END`COM###\n' +1006 'Tell him to travel:\n' +1007 '1. through the street\n' +1008 '2. over the car\n' +1009 '###`END`PLN\n' +1010 'tom`END`PUN.`END`PLNtravel street`END`PUN,`END`PLN car`END'1011 ),1012 issue14a: (1013 '`COM//comment`END<br>' +1014 '`KWDint`END`PLN main`END`PUN(`END`KWDint`END`PLN argc`END`PUN,`END' +1015 '`PLN `END`KWDchar`END`PLN `END`PUN**`END`PLNargv`END`PUN)`END' +1016 '`PLN\n' +1017 '`END`PUN{}`END'1018 ),1019 issue14b: (1020 '`COM&lt;!-- There\'s an `END<acronym title="tag soup">`COMHTML`END' +1021 '</acronym>`COM comment in my comment --&gt;`END`PLN\n' +1022 '`END`TAG&lt;p&gt;`END' +1023 '`PLNAnd another one inside the end tag`END' +1024 '`TAG&lt;/p`END`TAG&gt;`END'1025 ),1026 issue20: (1027 '`TAG&lt;html&gt;`END`PLN\n' +1028 '\n' +1029 '`END`TAG&lt;head&gt;`END'1030 ),1031 issue21: (1032 '`TAG&lt;html&gt;`END`PLN\n' +1033 ' `END`TAG&lt;head&gt;`END`PLN\n' +1034 ' `END`TAG&lt;title&gt;`END`PLNTest`END' +1035 '`TAG&lt;/title&gt;`END`PLN\n' +1036 ' `END`TAG&lt;/head&gt;`END`PLN\n' +1037 '`END`TAG&lt;/html&gt;`END'1038 ),1039 issue22: (1040 '<span class="nocode">01: `END`COM// This is a line of code`END`PLN\n' +1041 '`END<span class="nocode">02: `END`COM/* Multiline comments can\n' +1042 '`END<span class="nocode">03: `END`COM * span over and around\n' +1043 '`END<span class="nocode">04: `END`COM * line markers\n' +1044 '`END<span class="nocode annot">And can even be interrupted`END`COM\n' +1045 '`END<span class="nocode annot">by inline code annotations`END`COM\n' +1046 '`END<span class="nocode">05: `END`COM *\/`END`PLN\n' +1047 '`END<span class="nocode">06: `END`KWDclass`END`PLN `END`TYPMyClass`END' +1048 '`PLN `END`KWDextends`END`PLN `END`TYPFoo`END`PLN `END`PUN{`END' +1049 '`PLN\n' +1050 '`END<span class="nocode">07: `END`PLN `END`KWDpublic`END' +1051 '`PLN `END`KWDstatic`END`PLN `END`KWDvoid`END`PLN main`END`PUN(`END' +1052 '`TYPString`END`PUN...`END`PLN argv`END`PUN)`END`PLN `END`PUN{`END' +1053 '`PLN\n' +1054 '`END<span class="nocode">08: `END`PLN `END`TYPSystem`END' +1055 '`PUN.`END`PLNout`END`PUN.`END`PLNprint`END`PUN(`END' +1056 '`STR"Hello World"`END`PUN);`END`PLN\n' +1057 '`END<span class="nocode">09: `END`PLN `END`PUN}`END`PLN\n' +1058 '`END<span class="nocode">10: `END`PUN}`END'1059 ),1060 lua: (1061 '`PLNos`END`PUN=`END`PLNrequire`END`PUN(`END`STR"os"`END`PUN)`END`PLN\n' +1062 'math`END`PUN=`END`PLNrequire`END`PUN(`END`STR"math"`END`PUN)`END`PLN\n' +1063 '\n' +1064 '`END`COM-- Examples from the language reference`END`PLN\n' +1065 ' a `END`PUN=`END`PLN `END`STR\'alo\\n123"\'`END' +1066 '`PLN\n' +1067 ' a `END`PUN=`END`PLN `END`STR"alo\\n123\\""`END' +1068 '`PLN\n' +1069 ' a `END`PUN=`END`PLN `END' +1070 '`STR\'\\97lo\\10\\04923"\'`END`PLN\n' +1071 ' a `END`PUN=`END`PLN `END`STR[[alo\n' +1072 ' 123"]]`END`PLN\n' +1073 ' a `END`PUN=`END`PLN `END`STR[==[\n' +1074 ' alo\n' +1075 ' 123"]==]`END`PLN\n' +1076 '\n' +1077 '`END`LIT3`END`PLN `END`LIT3.0`END`PLN `END`LIT3.1416`END' +1078 '`PLN `END`LIT314.16e-2`END`PLN `END`LIT0.31416E1`END' +1079 '`PLN `END`LIT0xff`END`PLN `END`LIT0x56`END`PLN\n' +1080 '\n' +1081 '`END`COM-- Some comments that demonstrate long brackets`END`PLN\n' +1082 'double_quoted `END`PUN=`END`PLN `END`STR"Not a long bracket [=["`END' +1083 '`PLN\n' +1084 '`END`COM--[=[ quoting out\n' +1085 ' [[ foo ]]\n' +1086 ' [==[does not end comment either]==]\n' +1087 ']=]`END`PLN\n' +1088 'past_end_of_comment\n' +1089 '`END`COM--]=]`END`PLN\n' +1090 '\n' +1091 '`END`COM-- Example code courtesy Joseph Harmbruster`END`PLN\n' +1092 '`END`PUN#`END`PLN\n' +1093 '`END`KWDdo`END`PLN\n' +1094 ' `END`KWDlocal`END`PLN `END`KWDfunction`END`PLN ssgeneral`END' +1095 '`PUN(`END`PLNt`END`PUN,`END`PLN n`END`PUN,`END`PLN before`END' +1096 '`PUN)`END`PLN\n' +1097 ' `END`KWDfor`END`PLN _`END`PUN,`END`PLN h `END`KWDin`END' +1098 '`PLN ipairs`END`PUN(`END`PLNincs`END`PUN)`END`PLN `END`KWDdo`END' +1099 '`PLN\n' +1100 ' `END`KWDfor`END`PLN i `END`PUN=`END`PLN h `END' +1101 '`PUN+`END`PLN `END`LIT1`END`PUN,`END`PLN n `END`KWDdo`END`PLN\n' +1102 ' `END`KWDlocal`END`PLN v `END`PUN=`END' +1103 '`PLN t`END`PUN[`END`PLNi`END`PUN]`END`PLN\n' +1104 ' `END`KWDfor`END`PLN j `END`PUN=`END' +1105 '`PLN i `END`PUN-`END`PLN h`END`PUN,`END`PLN `END`LIT1`END`PUN,`END' +1106 '`PLN `END`PUN-`END`PLNh `END`KWDdo`END`PLN\n' +1107 ' `END`KWDlocal`END`PLN testval `END' +1108 '`PUN=`END`PLN t`END`PUN[`END`PLNj`END`PUN]`END`PLN\n' +1109 ' `END`KWDif`END`PLN `END`KWDnot`END' +1110 '`PLN before`END`PUN(`END`PLNv`END`PUN,`END`PLN testval`END' +1111 '`PUN)`END`PLN `END`KWDthen`END`PLN `END`KWDbreak`END`PLN `END' +1112 '`KWDend`END`PLN\n' +1113 ' t`END`PUN[`END`PLNi`END`PUN]`END' +1114 '`PLN `END`PUN=`END`PLN testval`END`PUN;`END`PLN i `END`PUN=`END' +1115 '`PLN j\n' +1116 ' `END`KWDend`END`PLN\n' +1117 ' t`END`PUN[`END`PLNi`END`PUN]`END`PLN `END' +1118 '`PUN=`END`PLN v\n' +1119 ' `END`KWDend`END`PLN \n' +1120 ' `END`KWDend`END`PLN\n' +1121 ' `END`KWDreturn`END`PLN t\n' +1122 ' `END`KWDend`END`PLN\n' +1123 '\n' +1124 ' `END`KWDfunction`END`PLN shellsort`END`PUN(`END`PLNt`END' +1125 '`PUN,`END`PLN before`END`PUN,`END`PLN n`END`PUN)`END`PLN\n' +1126 ' n `END`PUN=`END`PLN n `END`KWDor`END`PLN `END`PUN#`END' +1127 '`PLNt\n' +1128 ' `END`KWDif`END`PLN `END`KWDnot`END`PLN before `END' +1129 '`KWDor`END`PLN before `END`PUN==`END`PLN `END`STR"&lt;"`END' +1130 '`PLN `END`KWDthen`END`PLN `END`KWDreturn`END`PLN ssup`END`PUN(`END' +1131 '`PLNt`END`PUN,`END`PLN n`END`PUN)`END`PLN\n' +1132 ' `END`KWDelseif`END`PLN before `END`PUN==`END`PLN `END' +1133 '`STR"&gt;"`END`PLN `END`KWDthen`END`PLN `END`KWDreturn`END' +1134 '`PLN ssdown`END`PUN(`END`PLNt`END`PUN,`END`PLN n`END`PUN)`END' +1135 '`PLN\n' +1136 ' `END`KWDelse`END`PLN `END`KWDreturn`END' +1137 '`PLN ssgeneral`END`PUN(`END`PLNt`END`PUN,`END`PLN n`END`PUN,`END' +1138 '`PLN before`END`PUN)`END`PLN\n' +1139 ' `END`KWDend`END`PLN\n' +1140 ' `END`KWDend`END`PLN\n' +1141 ' `END`KWDreturn`END`PLN shellsort\n' +1142 '`END`KWDend`END'1143 ),1144 vbs: (1145 '`KWDImports`END`PLN System\n' +1146 '\n' +1147 '`END`KWDClass`END`PLN [class]\n' +1148 ' `END`KWDShared`END`PLN `END`KWDSub`END`PLN [shared]`END' +1149 '`PUN(`END`KWDByVal`END`PLN [boolean] `END`KWDAs`END`PLN `END' +1150 '`KWDBoolean`END`PUN)`END`PLN\n' +1151 ' `END`KWDIf`END`PLN [boolean] `END' +1152 '`KWDThen`END`PLN\n' +1153 ' Console`END`PUN.`END' +1154 '`PLNWriteLine`END`PUN(`END`STR"true"`END`PUN)`END`PLN\n' +1155 ' `END`KWDElse`END`PLN\n' +1156 ' Console`END`PUN.`END' +1157 '`PLNWriteLine`END`PUN(`END`STR"false"`END`PUN)`END`PLN\n' +1158 ' `END`KWDEnd`END`PLN `END`KWDIf`END' +1159 '`PLN\n' +1160 ' `END`KWDEnd`END`PLN `END`KWDSub`END`PLN\n' +1161 '`END`KWDEnd`END`PLN `END`KWDClass`END`PLN\n' +1162 '\n' +1163 '`END`COM\' Comment`END`PLN\n' +1164 '`END`COM\u2018 Second Line comment with a smart quote _\n' +1165 ' continued line using VB6 syntax.`END`PLN\n' +1166 '`END`KWDModule`END`PLN [module]\n' +1167 ' `END`KWDSub`END`PLN Main`END`PUN()`END`PLN\n' +1168 ' [class]`END`PUN.`END`PLN[shared]`END' +1169 '`PUN(`END`LITTrue`END`PUN)`END`PLN\n' +1170 '\n' +1171 ' `END`COM\' This prints out: \".`END' +1172 '`PLN\n' +1173 ' Console`END`PUN.`END`PLNWriteLine`END' +1174 '`PUN(`END`STR""""`END`PUN)`END`PLN\n' +1175 '\n' +1176 ' `END`COM\' This prints out: a"b.`END' +1177 '`PLN\n' +1178 ' Console`END`PUN.`END`PLNWriteLine`END' +1179 '`PUN(`END`STR"a""b"`END`PUN)`END`PLN\n' +1180 '\n' +1181 ' `END`COM\' This prints out: a.`END' +1182 '`PLN\n' +1183 ' Console`END`PUN.`END`PLNWriteLine`END' +1184 '`PUN(`END`STR"a"c`END`PUN)`END`PLN\n' +1185 '\n' +1186 ' `END`COM\' This prints out: ".`END' +1187 '`PLN\n' +1188 ' Console`END`PUN.`END`PLNWriteLine`END' +1189 '`PUN(`END`STR""""c`END`PUN)`END`PLN\n' +1190 '\n' +1191 ' `END`COMREM an old-style comment`END`PLN\n' +1192 ' REMOVE`END`PUN(`END`PLNnot_a_comment`END`PUN)`END`PLN\n' +1193 ' `END`KWDEnd`END`PLN `END`KWDSub`END`PLN\n' +1194 '`END`KWDEnd`END`PLN `END`KWDModule`END`PLN\n' +1195 '\n' +1196 '`END`KWDDim`END`PLN d `END`KWDAs`END`PLN `END`KWDDate`END`PLN\n' +1197 'd `END`PUN=`END`PLN `END`LIT# 8/23/1970 3:45:39AM #`END`PLN\n' +1198 'd `END`PUN=`END`PLN `END`LIT# 8/23/1970 #`END`PLN\n' +1199 'd `END`PUN=`END`PLN `END`LIT# 3:45:39AM #`END`PLN\n' +1200 'd `END`PUN=`END`PLN `END`LIT# 3:45:39 #`END`PLN\n' +1201 'd `END`PUN=`END`PLN `END`LIT# 13:45:39 #`END`PLN\n' +1202 'd `END`PUN=`END`PLN `END`LIT# 13:45:39PM #`END`PLN\n' +1203 '\n' +1204 '`END`KWDDim`END`PLN n `END`KWDAs`END`PLN Float\n' +1205 'n `END`PUN=`END`PLN `END`PUN(`END`LIT0.0`END`PUN,`END`PLN `END' +1206 '`LIT.99F`END`PUN,`END`PLN `END`LIT1.0E-2D`END`PUN,`END`PLN `END' +1207 '`LIT1.0E+3D`END`PUN,`END`PLN `END`LIT.5E4`END`PUN,`END`PLN `END' +1208 '`LIT1E3R`END`PUN,`END`PLN `END`LIT4D`END`PUN)`END`PLN\n' +1209 '\n' +1210 '`END`KWDDim`END`PLN i `END`KWDAs`END`PLN `END`KWDInteger`END`PLN\n' +1211 'i `END`PUN=`END`PLN `END`PUN(`END`LIT0`END`PUN,`END`PLN `END' +1212 '`LIT123`END`PUN,`END`PLN `END`LIT45L`END`PUN,`END`PLN `END' +1213 '`LIT&amp;HA0I`END`PUN,`END`PLN `END`LIT&amp;O177S`END`PUN)`END'1214 ),1215 haskell: (1216 '`COM-- A comment`END`PLN\n' +1217 'Not`END`PUN(--`END`STR"a comment"`END`PUN)`END`PLN\n' +1218 'Also.not`END`PUN(--(`END`PLNA.comment`END`PUN))`END`PLN\n' +1219 '\n' +1220 '`END`KWDmodule`END`PLN Foo`END`PUN(`END`PLNbar`END`PUN)`END`PLN `END' +1221 '`KWDwhere`END`PLN\n' +1222 '`END`KWDimport`END`PLN Blah\n' +1223 '`END`KWDimport`END`PLN BlahBlah`END`PUN(`END`PLNblah`END`PUN)`END' +1224 '`PLN\n' +1225 '`END`KWDimport`END`PLN Monads`END`PUN(`END`PLNException`END' +1226 '`PUN(..),`END`PLN FIO`END`PUN(..),`END`PLNunFIO`END`PUN,`END' +1227 '`PLNhandle`END`PUN,`END`PLNrunFIO`END`PUN,`END`PLNfixFIO`END' +1228 '`PUN,`END`PLNfio`END`PUN,`END`PLN\n' +1229 ' write`END`PUN,`END' +1230 '`PLNwriteln`END`PUN,`END`PLNHasNext`END`PUN(..),`END' +1231 '`PLNHasOutput`END`PUN(..))`END`PLN\n' +1232 '\n' +1233 '`END`COM{- nested comments\n' +1234 ' - don\'t work {-yet-}`END`PLN `END`PUN-}`END`PLN\n' +1235 '`END`KWDinstance`END`PLN Thingy Foo `END`KWDwhere`END`PLN\n' +1236 ' a `END`PUN=`END`PLN b\n' +1237 '\n' +1238 '`END`KWDdata`END`PLN Foo `END`PUN::`END`PLN `END`PUN(*`END`PLN `END' +1239 '`PUN-&gt;`END`PLN `END`PUN*`END`PLN `END`PUN-&gt;`END`PLN `END' +1240 '`PUN*)`END`PLN `END`PUN-&gt;`END`PLN `END`PUN*`END`PLN `END' +1241 '`PUN&gt;`END`PLN `END`PUN*`END`PLN `END`PUN-&gt;`END`PLN `END' +1242 '`PUN*`END`PLN `END`KWDwhere`END`PLN\n' +1243 ' Nil `END`PUN::`END`PLN Foo a b c\n' +1244 ' Cons `END`PUN::`END`PLN a b c `END`PUN-&gt;`END' +1245 '`PLN Foo abc `END`PUN-&gt;`END`PLN Foo a b c\n' +1246 '\n' +1247 'str `END`PUN=`END`PLN `END`STR"Foo\\\\Bar"`END`PLN\n' +1248 'char `END`PUN=`END`PLN `END`STR\'x\'`END`PLN\n' +1249 'Not.A.Char `END`PUN=`END`PLN `END`STR\'t`END`PLNoo long\' `END' +1250 '`COM-- Don\'t barf. Show that \'t is a lexical error.`END' +1251 '`PLN\n' +1252 '\n' +1253 '`END`PUN(`END`PLNident`END`PUN,`END`PLN ident\'`END`PUN,`END' +1254 '`PLN Fo\'\'o.b\'ar`END`PUN)`END`PLN\n' +1255 '\n' +1256 '`END`PUN(`END`LIT0`END`PUN,`END`PLN `END`LIT12`END`PUN,`END`PLN `END' +1257 '`LIT0x45`END`PUN,`END`PLN `END`LIT0xA7`END`PUN,`END`PLN `END' +1258 '`LIT0o177`END`PUN,`END`PLN `END`LIT0O377`END`PUN,`END`PLN `END' +1259 '`LIT0.1`END`PUN,`END`PLN `END`LIT1.0`END`PUN,`END`PLN `END' +1260 '`LIT1e3`END`PUN,`END`PLN `END`LIT0.5E-3`END`PUN,`END`PLN `END' +1261 '`LIT1.0E+45`END`PUN)`END'1262 ),1263 ml: (1264 '`COM(*\n' +1265 ' * Print the 10th fibonacci number\n' +1266 ' *)`END`PLN\n' +1267 '\n' +1268 '`END`COM//// A line comment`END`PLN\n' +1269 '`END`STR"A string"`END`PUN;;`END`PLN\n' +1270 '`END`PUN(`END`LIT0`END`PUN,`END`PLN `END`LIT125`END`PUN,`END' +1271 '`PLN `END`LIT0xa0`END`PUN,`END`PLN `END`LIT-1.0`END`PUN,`END' +1272 '`PLN `END`LIT1e6`END`PUN,`END`PLN `END`LIT1.2e-3`END`PUN);;`END' +1273 '`PLN `END`COM// number literals`END`PLN\n' +1274 '\n' +1275 '`END`COM#if fibby`END`PLN\n' +1276 ' `END`KWDlet`END`PLN\n' +1277 ' `END`KWDrec`END`PLN fib `END`PUN=`END`PLN `END' +1278 '`KWDfunction`END`PLN `END`PUN(`END`LIT0`END`PUN,`END`PLN a`END' +1279 '`PUN,`END`PLN _`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN a\n' +1280 ' ' +1281 ' `END`PUN|`END`PLN `END`PUN(`END`PLNn`END`PUN,`END`PLN a`END' +1282 '`PUN,`END`PLN b`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN fib`END' +1283 '`PUN(`END`PLNn `END`PUN-`END`PLN `END`LIT1`END`PUN,`END' +1284 '`PLN a `END`PUN+`END`PLN b`END`PUN,`END`PLN a`END`PUN)`END' +1285 '`PLN\n' +1286 ' `END`KWDin`END`PLN\n' +1287 ' print_int`END`PUN(`END`PLNfib`END`PUN(`END`LIT10`END' +1288 '`PUN,`END`PLN `END`LIT1`END`PUN,`END`PLN `END`LIT1`END' +1289 '`PUN));;`END`PLN\n' +1290 '`END`COM#endif`END`PLN\n' +1291 '\n' +1292 '`END`KWDlet`END`PLN zed `END`PUN=`END`PLN `END`STR\'z\'`END`PLN\n' +1293 '\n' +1294 '`END`KWDlet`END`PLN f\' x\' `END`PUN=`END`PLN x\' `END`PUN+`END`PLN `END`LIT1`END'1295 ),1296 lisp: (1297 '`COM; -*- mode: lisp -*-`END`PLN\n' +1298 '\n' +1299 '`END`OPN(`END`KWDdefun`END`PLN back-six-lines `END`OPN(`END`CLO)`END' +1300 '`PLN `END`OPN(`END`PLNinteractive`END`CLO)`END`PLN `END`OPN(`END' +1301 '`PLNforward-line `END`LIT-6`END`CLO))`END`PLN\n' +1302 '`END`OPN(`END`KWDdefun`END`PLN forward-six-lines `END`OPN(`END' +1303 '`CLO)`END`PLN `END`OPN(`END`PLNinteractive`END`CLO)`END`PLN `END' +1304 '`OPN(`END`PLNforward-line `END`LIT6`END`CLO))`END`PLN\n' +1305 '\n' +1306 '`END`OPN(`END`PLNglobal-set-key `END`STR"\\M-l"`END`PLN `END' +1307 '`LIT\'goto-line`END`CLO)`END`PLN\n' +1308 '`END`OPN(`END`PLNglobal-set-key `END`STR"\\C-z"`END`PLN `END' +1309 '`LIT\'advertised-undo`END`CLO)`END`PLN\n' +1310 '`END`OPN(`END`PLNglobal-set-key `END`PUN[`END`PLNC-insert`END' +1311 '`PUN]`END`PLN `END`LIT\'clipboard-kill-ring-save`END`CLO)`END' +1312 '`PLN\n' +1313 '`END`OPN(`END`PLNglobal-set-key `END`PUN[`END`PLNS-insert`END`PUN]`END' +1314 '`PLN `END`LIT\'clipboard-yank`END`CLO)`END`PLN\n' +1315 '`END`OPN(`END`PLNglobal-set-key `END`PUN[`END`PLNC-up`END`PUN]`END' +1316 '`PLN `END`LIT\'back-six-lines`END`CLO)`END`PLN\n' +1317 '`END`OPN(`END`PLNglobal-set-key `END`PUN[`END`PLNC-down`END`PUN]`END' +1318 '`PLN `END`LIT\'forward-six-lines`END`CLO)`END`PLN\n' +1319 '\n' +1320 '`END`OPN(`END`KWDsetq`END`PLN visible-bell `END`KWDt`END`CLO)`END' +1321 '`PLN\n' +1322 '`END`OPN(`END`KWDsetq`END`PLN user-mail-address `END' +1323 '`STR"foo@bar.com"`END`CLO)`END`PLN\n' +1324 '`END`OPN(`END`KWDsetq`END`PLN default-major-mode `END' +1325 '`LIT\'text-mode`END`CLO)`END`PLN\n' +1326 '\n' +1327 '`END`OPN(`END`PLNsetenv `END`STR"TERM"`END`PLN `END' +1328 '`STR"emacs"`END`CLO)`END`PLN\n' +1329 '`END`OPN(`END`PLNc-set-offset `END`LIT\'case-label`END`PLN `END' +1330 '`LIT2`END`CLO)`END`PLN\n' +1331 '`END`OPN(`END`KWDsetq`END`PLN c-basic-offset `END`LIT2`END`CLO)`END' +1332 '`PLN\n' +1333 '`END`OPN(`END`KWDsetq`END`PLN perl-indent-level `END`LIT0x2`END`CLO)`END' +1334 '`PLN\n' +1335 '`END`OPN(`END`KWDsetq`END`PLN delete-key-deletes-forward `END`KWDt`END' +1336 '`CLO)`END`PLN\n' +1337 '`END`OPN(`END`KWDsetq`END`PLN indent-tabs-mode `END`KWDnil`END' +1338 '`CLO)`END`PLN\n' +1339 '\n' +1340 '`END`COM;; Text mode`END`PLN\n' +1341 '`END`OPN(`END`PLNadd-hook `END`LIT\'text-mode-hook`END`PLN \n' +1342 ' `END`LIT\'`END`OPN(`END`KWDlambda`END`PLN `END`OPN(`END' +1343 '`CLO)`END`PLN\n' +1344 ' `END`OPN(`END`PLNturn-on-auto-fill`END`CLO)`END' +1345 '`PLN\n' +1346 ' `END`CLO)`END`PLN\n' +1347 '`END`CLO)`END`PLN\n' +1348 '\n' +1349 '`END`COM;; Fundamental mode`END`PLN\n' +1350 '`END`OPN(`END`PLNadd-hook `END`LIT\'fundamental-mode-hook`END' +1351 '`PLN \n' +1352 ' `END`LIT\'`END`OPN(`END`KWDlambda`END`PLN `END`OPN(`END' +1353 '`CLO)`END`PLN\n' +1354 ' `END`OPN(`END`PLNturn-on-auto-fill`END' +1355 '`CLO)`END`PLN\n' +1356 ' `END`CLO)`END`PLN\n' +1357 '`END`CLO)`END`PLN\n' +1358 '\n' +1359 '`END`COM;; Define and cond are keywords in scheme`END`PLN\n' +1360 '`END`OPN(`END`KWDdefine`END`PLN `END`OPN(`END`PLNsqt x`END`CLO)`END' +1361 '`PLN `END`OPN(`END`PLNsqrt-iter `END`LIT1.0`END`PLN `END' +1362 '`LIT2.0`END`PLN x`END`CLO))`END'1363 ),1364 issue45: (1365 '`KWDthrow`END`PLN `END`KWDnew`END`PLN `END`TYPRuntimeException`END' +1366 '`PUN(`END`STR"Element ["`END`PLN `END`PUN+`END`PLN element`END' +1367 '`PUN.`END`PLNgetName`END`PUN()`END`PLN `END`PUN+`END`PLN \n' +1368 ' `END`STR"] missing attribute."`END`PUN);`END`PLN\n' +1369 'variable`END`PUN++;`END'1370 ),1371 proto: (1372 '`KWDmessage`END`PLN `END`TYPSearchRequest`END`PLN `END`PUN{`END' +1373 '`PLN\n' +1374 ' `END`KWDrequired`END`PLN `END`TYPstring`END`PLN query `END' +1375 '`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +1376 ' `END`KWDoptional`END`PLN `END`TYPint32`END`PLN page_number `END' +1377 '`PUN=`END`PLN `END`LIT2`END`PUN;`END`PLN\n' +1378 ' `END`KWDoptional`END`PLN `END`TYPint32`END' +1379 '`PLN result_per_page `END`PUN=`END`PLN `END`LIT3`END`PLN `END' +1380 '`PUN[`END`KWDdefault`END`PLN `END`PUN=`END`PLN `END`LIT10`END' +1381 '`PUN];`END`PLN\n' +1382 ' `END`KWDenum`END`PLN `END`TYPCorpus`END`PLN `END`PUN{`END' +1383 '`PLN\n' +1384 ' UNIVERSAL `END`PUN=`END`PLN `END`LIT0`END`PUN;`END' +1385 '`PLN\n' +1386 ' WEB `END`PUN=`END`PLN `END`LIT1`END`PUN;`END`PLN\n' +1387 ' IMAGES `END`PUN=`END`PLN `END`LIT2`END`PUN;`END`PLN\n' +1388 ' LOCAL `END`PUN=`END`PLN `END`LIT3`END`PUN;`END`PLN\n' +1389 ' NEWS `END`PUN=`END`PLN `END`LIT4`END`PUN;`END`PLN\n' +1390 ' PRODUCTS `END`PUN=`END`PLN `END`LIT5`END`PUN;`END' +1391 '`PLN\n' +1392 ' VIDEO `END`PUN=`END`PLN `END`LIT6`END`PUN;`END`PLN\n' +1393 ' `END`PUN}`END`PLN\n' +1394 ' `END`KWDoptional`END`PLN `END`TYPCorpus`END`PLN corpus `END' +1395 '`PUN=`END`PLN `END`LIT4`END`PLN `END`PUN[`END`KWDdefault`END' +1396 '`PLN `END`PUN=`END`PLN UNIVERSAL`END`PUN];`END`PLN\n' +1397 '`END`PUN}`END'1398 ),1399 wiki: (1400 '`KWD#summary`END`PLN hello world\n' +1401 '`END`KWD#labels`END`PLN `END`LITHelloWorld`END`PLN `END' +1402 '`LITWikiWord`END`PLN Hiya\n' +1403 '\n' +1404 '`END`PUN[`END' +1405 '`STRhttp://www.google.com/?q=WikiSyntax+site:code.google.com`END' +1406 '`PLN `END`LITWikiSyntax`END`PUN]`END`PLN\n' +1407 '\n' +1408 'Lorem Ipsum ``END`KWDwhile`END`PLN `END`PUN(`END`LIT1`END' +1409 '`PUN)`END`PLN `END`KWDprint`END`PUN(`END`STR"blah blah"`END' +1410 '`PUN);`END`PLN`\n' +1411 '\n' +1412 ' `END`PUN*`END`PLN Bullet\n' +1413 ' `END`PUN*`END`PLN Points\n' +1414 ' `END`PUN*`END`PLN `END`LITNestedBullet`END' +1415 '`PLN\n' +1416 '\n' +1417 '`END`PUN==`END`LITDroningOnAndOn`END`PUN==`END`PLN\n' +1418 '{{{\n' +1419 ' `END`COM// Some EmbeddedSourceCode`END`PLN\n' +1420 ' `END`KWDvoid`END`PLN main`END`PUN()`END`PLN `END`PUN{`END' +1421 '`PLN\n' +1422 ' `END`TYPPrint`END`PUN(`END`STR\'hello world\'`END' +1423 '`PUN);`END`PLN\n' +1424 ' `END`PUN}`END`PLN\n' +1425 '}}}\n' +1426 '\n' +1427 '{{{\n' +1428 ' `END`COM&lt;!-- Embedded XML --&gt;`END`PLN\n' +1429 ' `END`TAG&lt;foo`END`PLN `END`ATNbar`END`PUN=`END' +1430 '`ATV"baz"`END`TAG&gt;&lt;boo`END`PLN `END' +1431 '`TAG/&gt;&lt;foo&gt;`END`PLN\n' +1432 '}}}`END'1433 ),1434 css: (1435 '`COM&lt;!--`END`PLN\n' +1436 '`END`KWD@charset`END`PUN(`END`STR\'UTF-8\'`END`PUN);`END`PLN\n' +1437 '\n' +1438 '`END`COM/** A url that is not quoted. *\/`END`PLN\n' +1439 '`END`KWD@import`END`PUN(`END`KWDurl`END`PUN(`END`STR/more-styles.css`END' +1440 '`PUN));`END`PLN\n' +1441 '\n' +1442 'HTML `END`PUN{`END`PLN `END`KWDcontent-before`END`PUN:`END`PLN `END' +1443 '`STR\'hello\\20\'`END`PUN;`END`PLN `END`KWDcontent-after`END' +1444 '`PUN:`END`PLN `END`STR\'w\\6f rld\'`END`PUN;`END`PLN\n' +1445 ' `END`KWD-moz-spiff`END`PUN:`END`PLN `END' +1446 '`KWDinherit`END`PLN `END`KWD!important`END`PLN `END`PUN}`END' +1447 '`PLN\n' +1448 '\n' +1449 '`END`COM/* Test units on numbers. *\/`END`PLN\n' +1450 'BODY `END`PUN{`END`PLN `END`KWDmargin-bottom`END`PUN:`END`PLN `END' +1451 '`LIT4px`END`PUN;`END`PLN `END`KWDmargin-left`END`PUN:`END' +1452 '`PLN `END`LIT3in`END`PUN;`END`PLN `END`KWDmargin-bottom`END' +1453 '`PUN:`END`PLN `END`LIT0`END`PUN;`END`PLN `END`KWDmargin-top`END' +1454 '`PUN:`END`PLN `END`LIT5%`END`PLN `END`PUN}`END`PLN\n' +1455 '\n' +1456 '`END`COM/** Test number literals and quoted values. *\/`END`PLN\n' +1457 'TABLE`END`PUN.`END`PLNfoo TR`END`PUN.`END`PLNbar A`END`PUN#`END' +1458 '`PLNvisited `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END`PLN `END' +1459 '`LIT#001123`END`PUN;`END`PLN `END`KWDfont-family`END`PUN:`END' +1460 '`PLN `END`STR"monospace"`END`PLN `END`PUN}`END`PLN\n' +1461 '`END`COM/** bolder is not a name, so should be plain. ' +1462 ' !IMPORTANT is a keyword\n' +1463 ' * regardless of case.\n' +1464 ' *\/`END`PLN\n' +1465 'blink `END`PUN{`END`PLN `END`KWDtext-decoration`END`PUN:`END' +1466 '`PLN BLINK `END`KWD!IMPORTANT`END`PUN;`END`PLN `END' +1467 '`KWDfont-weight`END`PUN:`END`PLN bolder `END`PUN}`END`PLN\n' +1468 '`END`COM/* Empty url() was causing infinite recursion */`END`PLN\n' +1469 'a `END`PUN{`END`PLN `END`KWDbackground-image`END`PUN:`END`PLN ' +1470 '`END`KWDurl`END`PUN();`END`PLN `END`PUN}`END`PLN\n' +1471 'p`END`PUN#`END`PLNfeatured`END`PUN{`END`KWDbackground`END`PUN:`END`LIT#fea`END`PUN}`END`PLN\n' +1472 '`END`COM--&gt;`END'1473 ),1474 css_style: (1475 '`TAG&lt;style`END`PLN `END`ATNtype`END`PUN=`END`ATV\'text/css\'`END' +1476 '`TAG&gt;`END`PLN\n' +1477 '`END`COM/* desert scheme ported from vim to google prettify */`END' +1478 '`PLN\n' +1479 'code`END`PUN.`END`PLNprettyprint `END`PUN{`END`PLN `END' +1480 '`KWDdisplay`END`PUN:`END`PLN block`END`PUN;`END`PLN `END' +1481 '`KWDpadding`END`PUN:`END`PLN `END`LIT2px`END`PUN;`END`PLN `END' +1482 '`KWDborder`END`PUN:`END`PLN `END`LIT1px`END`PLN solid `END' +1483 '`LIT#888`END`PUN;`END`PLN\n' +1484 '`END`KWDbackground-color`END`PUN:`END`PLN `END`LIT#333`END`PUN;`END' +1485 '`PLN `END`PUN}`END`PLN\n' +1486 '`END`PUN.`END`PLNstr `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1487 '`PLN `END`LIT#ffa0a0`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1488 '`COM/* string - pink */`END`PLN\n' +1489 '`END`PUN.`END`PLNkwd `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1490 '`PLN `END`LIT#f0e68c`END`PUN;`END`PLN `END`KWDfont-weight`END' +1491 '`PUN:`END`PLN bold`END`PUN;`END`PLN `END`PUN}`END`PLN\n' +1492 '`END`PUN.`END`PLNcom `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1493 '`PLN `END`LIT#87ceeb`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1494 '`COM/* comment - skyblue */`END`PLN\n' +1495 '`END`PUN.`END`PLNtyp `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1496 '`PLN `END`LIT#98fb98`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1497 '`COM/* type - lightgreen */`END`PLN\n' +1498 '`END`PUN.`END`PLNlit `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1499 '`PLN `END`LIT#cd5c5c`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1500 '`COM/* literal - darkred */`END`PLN\n' +1501 '`END`PUN.`END`PLNpun `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1502 '`PLN `END`LIT#fff`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1503 '`COM/* punctuation */`END`PLN\n' +1504 '`END`PUN.`END`PLNpln `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1505 '`PLN `END`LIT#fff`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1506 '`COM/* plaintext */`END`PLN\n' +1507 '`END`PUN.`END`PLNtag `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1508 '`PLN `END`LIT#f0e68c`END`PUN;`END`PLN `END`KWDfont-weight`END' +1509 '`PUN:`END`PLN bold`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1510 '`COM/* html/xml tag - lightyellow*/`END`PLN\n' +1511 '`END`PUN.`END`PLNatn `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1512 '`PLN `END`LIT#bdb76b`END`PUN;`END`PLN `END`KWDfont-weight`END' +1513 '`PUN:`END`PLN bold`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1514 '`COM/* attribute name - khaki*/`END`PLN\n' +1515 '`END`PUN.`END`PLNatv `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1516 '`PLN `END`LIT#ffa0a0`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1517 '`COM/* attribute value - pink */`END`PLN\n' +1518 '`END`PUN.`END`PLNdec `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END' +1519 '`PLN `END`LIT#98fb98`END`PUN;`END`PLN `END`PUN}`END`PLN `END' +1520 '`COM/* decimal - lightgreen */`END`PLN\n' +1521 '`END`TAG&lt;/style&gt;`END'1522 ),1523 issue84: '`KWDsuper`END`PUN(`END`STR"&amp;nbsp;"`END`PUN);`END',1524 issue86_0: '`COM#One Two words`END',1525 issue86_1: (1526 '`COM#One`END`PLN\n' +1527 '`END`TYPTwo`END`PLN lines`END'1528 ),1529 issue86_2: (1530 '`COM#One`END`PLN\n' +1531 '`END`TYPTwo`END`PLN lines`END'1532 ),1533 issue86_3: (1534 '`COM#One`END`PLN\n' +1535 '`END`TYPTwo`END`PLN lines`END'1536 ),1537 issue86_4: (1538 '`COM#One`END`PLN\n' +1539 '`END`TYPTwo`END`PLN lines`END'1540 ),1541 issue86_5: (1542 '`COM#One`END<br>`PLN ' +1543 '`END`TYPTwo`END`PLN lines`END'1544 ),1545 issue92: (1546 '`PUN&lt;?`END`PLNxml version`END`PUN=`END`STR"1.0"`END`PLN encoding`END`PUN=`END' +1547 '`STR"UTF-8"`END`PUN?&gt;`END`PLN\n' +1548 '`END`TAG&lt;kml`END`PLN `END`ATNxmlns`END`PUN=`END`ATV"http://www.opengis.net/kml/2.2"`END' +1549 '`TAG&gt;`END`PLN\n' +1550 ' `END`TAG&lt;Placemark&gt;`END`PLN\n' +1551 ' `END`TAG&lt;name&gt;`END`PLNSimple placemark`END`TAG&lt;/name&gt;`END`PLN\n' +1552 ' `END`TAG&lt;description`END' +1553 '`PLN `END`ATNLang`END`PUN=`END`ATV"en"`END`TAG&gt;`END' +1554 '`PLNAttached to the ground.' +1555 ' Intelligently places itself \n' +1556 ' at the height of the underlying terrain.`END' +1557 '`TAG&lt;/description&gt;`END`PLN\n' +1558 ' `END`TAG&lt;Point&gt;`END`PLN\n' +1559 ' `END`TAG&lt;coordinates&gt;`END' +1560 '`PLN-122.0822035425683,37.42228990140251,0`END`TAG&lt;/coordinates&gt;`END`PLN\n' +1561 ' `END`TAG&lt;/Point&gt;`END`PLN\n' +1562 ' `END`TAG&lt;/Placemark&gt;`END`PLN\n' +1563 '`END`TAG&lt;/kml&gt;`END'1564 ),1565 cs_verbatim: (1566 '`COM// The normal string syntax`END`PLN\n' +1567 '`END`KWDstring`END`PLN a `END`PUN=`END`PLN `END`STR"C:\\\\"`END`PUN;`END`PLN\n' +1568 '`END`COM// is equivalent to a verbatim string`END`PLN\n' +1569 '`END`KWDstring`END`PLN b `END`PUN=`END`PLN `END`STR@"C:\\"`END`PUN;`END'1570 ),1571 vhdl: (1572 '`KWDlibrary`END`PLN ieee`END`PUN;`END`PLN\n' +1573 '`END`KWDuse`END`PLN ieee`END`PUN.`END`PLNstd_logic_1164`END`PUN.`END`KWDall`END`PUN;`END`PLN\n' +1574 '`END`KWDuse`END`PLN ieee`END`PUN.`END`PLNnumeric_std`END`PUN.`END`KWDall`END`PUN;`END`PLN\n' +1575 '\n' +1576 '`END`COM-- A line comment`END`PLN\n' +1577 '`END`KWDentity`END`PLN foo_entity `END`KWDis`END`PLN\n' +1578 '\n' +1579 ' `END`KWDgeneric`END`PLN `END`PUN(`END`COM-- comment after punc`END`PLN\n' +1580 ' a `END`PUN:`END`PLN `END`TYPnatural`END`PLN `END`PUN:=`END' +1581 '`PLN `END`LIT42`END`PUN;`END`PLN\n' +1582 ' x `END`PUN:`END`PLN `END`TYPreal`END`PLN `END' +1583 '`PUN:=`END`PLN `END`LIT16#ab.cd#-3`END`PLN\n' +1584 ' `END`PUN);`END`PLN\n' +1585 ' `END`KWDport`END`PLN `END`PUN(`END`PLN\n' +1586 ' clk_i `END`PUN:`END`PLN `END`KWDin`END`PLN `END`TYPstd_logic`END`PUN;`END`PLN\n' +1587 ' b_i `END`PUN:`END`PLN `END`KWDin`END`PLN `END`TYPnatural`END`PLN `END`KWDrange`END`PLN `END`LIT0`END`PLN `END`KWDto`END`PLN `END`LIT100`END`PUN;`END`PLN\n' +1588 ' c_o `END`PUN:`END`PLN `END`KWDout`END`PLN `END`TYPstd_logic_vector`END`PUN(`END`LIT5`END`PLN `END`KWDdownto`END`PLN `END`LIT0`END`PUN);`END`PLN\n' +1589 ' \\a "name"\\ `END`PUN:`END`PLN `END`KWDout`END`PLN `END`TYPinteger`END`PLN `END`COM-- extended identifier`END`PLN\n' +1590 ' `END`PUN);`END`PLN\n' +1591 '\n' +1592 '`END`KWDend`END`PLN `END`KWDentity`END`PLN foo_entity`END`PUN;`END`PLN\n' +1593 '\n' +1594 '`END`KWDarchitecture`END`PLN foo_architecture `END`KWDof`END`PLN foo_entity `END`KWDis`END`PLN\n' +1595 ' `END`KWDsignal`END`PLN bar_s `END`PUN:`END`PLN `END`TYPstd_logic_vector`END`PUN(`END`LIT2`END`PLN `END`KWDdownto`END`PLN `END`LIT0`END`PUN);`END`PLN\n' +1596 '`END`KWDbegin`END`PLN\n' +1597 ' \n' +1598 ' bar_s `END`PUN&lt;=`END`PLN `END`STRb"101"`END`PUN;`END`PLN\n' +1599 '\n' +1600 ' dummy_p `END`PUN:`END`PLN `END`KWDprocess`END`PLN `END`PUN(`END`PLNclk_i`END`PUN)`END`PLN\n' +1601 ' `END`KWDbegin`END`PLN\n' +1602 ' `END`KWDif`END`PLN b_i `END`PUN=`END`PLN `END`LIT1`END`PLN `END`KWDthen`END`PLN\n' +1603 ' c_o `END`PUN&lt;=`END`PLN `END`PUN(`END`KWDothers`END`PLN `END`PUN=&gt;`END`PLN `END`STR\'0\'`END`PUN);`END`PLN\n' +1604 ' `END`KWDelsif`END`PLN rising_edge`END`PUN(`END`PLNclk_i`END`PUN)`END`PLN `END`KWDthen`END`PLN\n' +1605 ' c_o `END`PUN&lt;=`END`PLN `END`STR"1011"`END`PLN `END`PUN&amp;`END`PLN bar_s`END`PUN(`END`LIT1`END`PLN `END`KWDdownto`END`PLN `END`LIT0`END`PUN);`END`PLN\n' +1606 ' `END`KWDend`END`PLN `END`KWDif`END`PUN;`END`PLN\n' +1607 ' `END`KWDend`END`PLN `END`KWDprocess`END`PLN dummy_p`END`PUN;`END`PLN\n' +1608 '\n' +1609 '`END`KWDend`END`PLN `END`KWDarchitecture`END`PLN foo_architecture`END`PUN;`END'1610 ),1611 yaml1: (1612 '`KWDapplication: `END`PLNmirah`END`PUN-`END`PLNlang\n' +1613 '`END`KWDversion: `END`PLN1\n' +1614 '\n' +1615 '`END`COM# Here\'s a comment`END`PLN\n' +1616 '`END`KWDhandlers:\n' +1617 '`END`PLN `END`PUN-`END`PLN `END`KWDurl: `END`PLN/red/*\n' +1618 ' `END`KWDservlet: `END`PLNmysite.server.TeamServlet\n' +1619 ' `END`KWDinit_params:\n' +1620 '`END`PLN `END`KWDteamColor: `END`PLNred\n' +1621 ' `END`KWDbgColor: `END`STR"#CC0000"`END`PLN\n' +1622 ' `END`KWDname: `END`PLNredteam\n' +1623 ' `END`PUN-`END`PLN `END`KWDurl: `END`PLN/blue/*\n' +1624 ' `END`KWDservlet: `END`PLNmysite.server.TeamServlet\n' +1625 ' `END`KWDinit_params:\n' +1626 '`END`PLN `END`KWDteamColor: `END`PLNblue\n' +1627 ' `END`KWDbgColor: `END`STR"#0000CC"`END`PLN\n' +1628 ' `END`KWDname: `END`PLNblueteam\n' +1629 ' `END`PUN-`END`PLN `END`KWDurl: `END`PLN/register/*\n' +1630 ' `END`KWDjsp: `END`PLN/register/start.jsp\n' +1631 ' `END`PUN-`END`PLN `END`KWDurl: `END`PLN*.special\n' +1632 ' `END`KWDfilter: `END`PLNmysite.server.LogFilterImpl\n' +1633 ' `END`KWDinit_params:\n' +1634 '`END`PLN `END`KWDlogType: `END`PLNspecial\n' +1635 ' `END'1636 ),1637 yaml2: (1638 '`DEC%YAML 1.1`END`PLN\n' +1639 '`END`DEC---\n' +1640 '`END`TYP!!map`END`PLN {\n' +1641 ' `END`PUN?`END`PLN `END`TYP!!str`END`PLN `END`STR""`END`PLN\n' +1642 ' `END`PUN:`END`PLN `END`TYP!!str`END`PLN `END`STR"value"`END`PLN,\n' +1643 ' `END`PUN?`END`PLN `END`TYP!!str`END`PLN `END`STR"explicit key"`END`PLN\n' +1644 ' `END`PUN:`END`PLN `END`TYP!!str`END`PLN `END`STR"value"`END`PLN,\n' +1645 ' `END`PUN?`END`PLN `END`TYP!!str`END`PLN `END`STR"simple key"`END`PLN\n' +1646 ' `END`PUN:`END`PLN `END`TYP!!str`END`PLN `END`STR"value"`END`PLN,\n' +1647 ' `END`PUN?`END`PLN `END`TYP!!seq`END`PLN [\n' +1648 ' `END`TYP!!str`END`PLN `END`STR"collection"`END`PLN,\n' +1649 ' `END`TYP!!str`END`PLN `END`STR"simple"`END`PLN,\n' +1650 ' `END`TYP!!str`END`PLN `END`STR"key"`END`PLN\n' +1651 ' ]\n' +1652 ' `END`PUN:`END`PLN `END`TYP!!str`END`PLN `END`STR"value"`END`PLN\n' +1653 '}`END'1654 ),1655 scala: (1656 '`COM/* comment 1 *\/`END`PLN\n' +1657 '`END`COM/*\n' +1658 'comment 2\n' +1659 '*\/`END`PLN\n' +1660 '`END`COM/* comment / * comment 3 **\/`END`PLN\n' +1661 '`END`COM// strings`END`PLN\n' +1662 '`END`STR"Hello, World!"`END`PUN,`END`PLN `END`STR"\\n"`END`PUN,`END`PLN\n' +1663 '`END`LIT`an-identifier``END`PUN,`END`PLN `END`LIT`\\n``END`PUN,`END`PLN\n' +1664 '`END`STR\'A\'`END`PUN,`END`PLN `END`STR\'\\n\'`END`PUN,`END`PLN\n' +1665 '`END`LIT\'aSymbol`END`PUN,`END`PLN\n' +1666 '`END`STR"""Hello,\n' +1667 'World"""`END`PUN,`END`PLN `END`STR"""Hello,\\nWorld"""`END`PUN,`END`PLN\n' +1668 '`END`STR"""Hello, "World"!"""`END`PUN,`END`PLN\n' +1669 '`END`STR"""Hello, \\"World\\""""`END`PLN\n' +1670 '\n' +1671 '`END`COM// Numbers`END`PLN\n' +1672 '`END`LIT0`END`PLN\n' +1673 '`END`LIT0123`END`PLN\n' +1674 '`END`LIT0xa0`END`PLN\n' +1675 '`END`LIT0XA0L`END`PLN\n' +1676 '`END`LIT123`END`PLN\n' +1677 '`END`LIT123.45`END`PLN\n' +1678 '`END`LIT1.50F`END`PLN\n' +1679 '`END`LIT0.50`END`PLN\n' +1680 '`END`PUN.`END`LIT50`END`PLN\n' +1681 '`END`LIT123e-1`END`PLN\n' +1682 '`END`LIT123.45e+1`END`PLN\n' +1683 '`END`LIT1.50e2`END`PLN\n' +1684 '`END`LIT0.50e-6`END`PLN\n' +1685 '`END`PUN.`END`LIT50e+42f`END`PLN\n' +1686 '\n' +1687 '`END`COM// Values`END`PLN\n' +1688 '`END`LITfalse`END`PUN,`END`PLN `END`LITtrue`END`PUN,`END`PLN `END`LITnull`END`PUN,`END`PLN `END`LITthis`END`PUN;`END`PLN\n' +1689 '\n' +1690 '`END`COM// Keywords`END`PLN\n' +1691 '`END`KWDclass`END`PLN `END`TYPMyClass`END`PUN;`END`PLN\n' +1692 '`END`KWDimport`END`PLN foo`END`PUN.`END`PLNbar`END`PUN;`END`PLN\n' +1693 '`END`KWDpackage`END`PLN baz`END`PUN;`END`PLN\n' +1694 '\n' +1695 '`END`COM// From scala-lang.org/node/242`END`PLN\n' +1696 '`END`KWDdef`END`PLN act`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +1697 ' `END`KWDvar`END`PLN pongCount `END`PUN=`END`PLN `END`LIT0`END`PLN\n' +1698 ' loop `END`PUN{`END`PLN\n' +1699 ' react `END`PUN{`END`PLN\n' +1700 ' `END`KWDcase`END`PLN `END`TYPPing`END`PLN `END`PUN=&gt;`END`PLN\n' +1701 ' `END`KWDif`END`PLN `END`PUN(`END`PLNpongCount `END`PUN%`END`PLN `END`LIT1000`END`PLN `END`PUN==`END`PLN `END`LIT0`END`PUN)`END`PLN\n' +1702 ' `END`TYPConsole`END`PUN.`END`PLNprintln`END`PUN(`END`STR"Pong: ping "`END`PUN+`END`PLNpongCount`END`PUN)`END`PLN\n' +1703 ' sender `END`PUN!`END`PLN `END`TYPPong`END`PLN\n' +1704 ' pongCount `END`PUN=`END`PLN pongCount `END`PUN+`END`PLN `END`LIT1`END`PLN\n' +1705 ' `END`KWDcase`END`PLN `END`TYPStop`END`PLN `END`PUN=&gt;`END`PLN\n' +1706 ' `END`TYPConsole`END`PUN.`END`PLNprintln`END`PUN(`END`STR"Pong: stop"`END`PUN)`END`PLN\n' +1707 ' exit`END`PUN()`END`PLN\n' +1708 ' `END`PUN}`END`PLN\n' +1709 ' `END`PUN}`END`PLN\n' +1710 '`END`PUN}`END'1711 ),1712 go: (1713 '`PLNpackage main `END`COM/* Package of which this program is part. *\/`END`PLN\n' +1714 '\n' +1715 'import fmt "fmt" `END`COM// Package implementing formatted I/O.`END`PLN\n' +1716 '\n' +1717 '\n' +1718 'func main() {\n' +1719 ' fmt.Printf("Hello, world; or \u039a\u03b1\u03bb\u03b7\u03bc\u03ad\u03c1\u03b1 \u03ba\u03cc\u03c3\u03bc\u03b5; or \u3053\u3093\u306b\u3061\u306f \u4e16\u754c\\n") `END`COM// Semicolon inserted here`END`PLN\n' +1720 '}\n' +1721 '\n' +1722 '`END`COM/* " *\/`END`PLN "foo /* " `END`COM/*\/ *\/`END`PLN\n' +1723 '`END`COM/* ` *\/`END`PLN `foo /* ` `END`COM/*\/ *\/`END'1724 ),1725 erlang: (1726 '`COM% Sample comment`END`PLN\n' +1727 '\n' +1728 '`END`KWD-module`END`PLN(my_test)`END`PUN.`END`PLN\n' +1729 '`END`KWD-include_lib`END`PLN(`END`STR"my_sample_lib.hrl"`END`PLN)`END`PUN.`END`PLN\n' +1730 '`END`KWD-export`END`PLN([\n' +1731 ' test/`END`LIT2`END`PLN\n' +1732 '])`END`PUN.`END`PLN\n' +1733 '\n' +1734 '`END`COM%% @doc Define a macro`END`PLN\n' +1735 '`END`KWD-define`END`PLN(my_macro`END`PUN,`END`PLN `END`TYPVariable`END`PLN)`END`PUN.`END`PLN\n' +1736 '\n' +1737 '`END`COM%% @doc My function`END`PLN\n' +1738 'test(`END`TYPVariables`END`PUN,`END`PLN `END`TYPMoreVariables`END`PLN) -&gt;\n' +1739 ' `END`COM% Inline comment`END`PLN\n' +1740 ' {ok`END`PUN,`END`TYPScanned`END`PUN,`END`TYP_`END`PLN} = my_lib:do_stuff()`END`PUN,`END`PLN\n' +1741 '\n' +1742 ' `END`TYPVariable`END`PLN = `END`KWDfun`END`PLN(`END`TYPV`END`PLN) -&gt; {ok`END`PUN,`END`PLN `END`TYPV`END`PLN} `END`KWDend`END`PUN,`END`PLN\n' +1743 '\n' +1744 ' `END`KWDtry`END`PLN `END`LIT?my_macro`END`PLN({value`END`PUN,`END`PLN test}) `END`KWDof`END`PLN\n' +1745 ' {value`END`PUN,`END`PLN `END`TYPResult`END`PUN,`END`PLN `END`TYP_`END`PLN} -&gt;\n' +1746 ' {ok`END`PUN,`END`PLN `END`TYPResult`END`PLN}\n' +1747 ' `END`KWDcatch`END`PLN\n' +1748 ' `END`TYPType`END`PLN:`END`TYPError`END`PLN -&gt;\n' +1749 ' {`END`LIT\'error\'`END`PUN,`END`PLN `END`TYPType`END`PUN,`END`PLN `END`TYPError`END`PLN}\n' +1750 ' `END`KWDend`END`PUN.`END'1751 ),1752 rust: (1753 '`COM// Single line comment`END`PLN\n' +1754 '`END`COM/* Multi-line (nesting not highlighted properly, sorry)\n' +1755 'comment */`END`PLN\n' +1756 '\n' +1757 '`END`ATV#![feature(code_prettification)]`END`PLN\n' +1758 '\n' +1759 '`END`KWDuse`END`PLN std`END`PUN::`END`PLNio`END`PUN::{`END`LITself`END`PUN,`END`PLN Write`END`PUN};`END`PLN\n' +1760 '\n' +1761 '`END`KWDimpl`END`PUN&lt;`END`TAG\'a`END`PUN,`END`PLN T`END`PUN:`END`PLN `END`TAG\'a`END`PLN `END`PUN+`END`PLN `END`PUN?`END`TYPSized`END`PUN&gt;`END`PLN Foo`END`PUN&lt;`END`TAG\'a`END`PUN,`END`PLN `END`TAG\'static`END`PUN&gt;`END`PLN `END`KWDfor`END`PLN Bar`END`PUN&lt;`END`TAG\'b`END`PUN&gt;`END`PLN\n' +1762 '`END`KWDwhere`END`PLN T`END`PUN:`END`PLN `END`TYPIterator`END`PUN&lt;`END`PLNItem `END`PUN=`END`PLN `END`TYPBox`END`PUN&lt;`END`TYPFn`END`PUN()`END`PLN `END`PUN-&gt;`END`PLN `END`TYPu32`END`PUN&gt;&gt;`END`PLN `END`PUN{`END`PLN\n' +1763 ' `END`KWDfn`END`PLN something`END`PUN(&amp;`END`KWDmut`END`PLN `END`LITself`END`PUN)`END`PLN `END`PUN-&gt;`END`PLN `END`TYPu32`END`PLN `END`PUN{`END`PLN\n' +1764 ' `END`KWDif`END`PLN `END`KWDlet`END`PLN `END`TYPSome`END`PUN(`END`KWDref`END`PLN x`END`PUN)`END`PLN `END`PUN=`END`PLN `END`LITself`END`PUN.`END`PLNfoo`END`PUN(`END`STR"multi li\\ne\n' +1765 's\\tring"`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +1766 ' `END`ATNpanic!`END`PUN(`END`STRr"\\things is going wrong!"`END`PUN);`END`PLN\n' +1767 ' `END`ATNpanic!`END`PUN(`END`STRr#"Things is "really" goig\\n wront!"#`END`PUN);`END`PLN\n' +1768 ' `END`ATNpanic!`END`PUN(`END`STRr##"Raw strings are #"#fancy#"#"##`END`PUN);`END`PLN\n' +1769 ' `END`PUN}`END`PLN\n' +1770 ' `END`PUN}`END`PLN\n' +1771 '`END`PUN}`END`PLN\n' +1772 '\n' +1773 '`END`KWDpub`END`PLN `END`KWDtype`END`PLN CowString`END`PUN&lt;`END`TAG\'a`END`PUN&gt;`END`PLN `END`PUN=`END`PLN std`END`PUN::`END`PLNcow`END`PUN::`END`PLNCow`END`PUN&lt;`END`TAG\'a`END`PUN,`END`PLN `END`TYPstr`END`PUN&gt;;`END`PLN\n' +1774 '\n' +1775 '`END`KWDfn`END`PLN main`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +1776 ' `END`KWDlet`END`PLN `END`PUN(`END`PLNi`END`PUN,`END`PLN r`END`PUN)`END`PLN `END`PUN=`END`PLN `END`PUN(`END`LIT1u8`END`PUN,`END`PLN `END`STR\'c\'`END`PUN);`END`PLN\n' +1777 ' `END`KWDlet`END`PLN s `END`PUN=`END`PLN `END`STRr#"Take a raw egg,\n' +1778 ' "break" it (or the line),\n' +1779 ' and beat it"#`END`PUN;`END`PLN\n' +1780 '`END`PUN}`END'1781 )...

Full Screen

Full Screen

prettify_test_2.js

Source:prettify_test_2.js Github

copy

Full Screen

1/**2 * maps ids of rewritten code to the expected output.3 * For brevity, <span class="foo"> has been changed to `FOO4 * and < /span> has been changed to `END.5 */6var goldens = {7 xquery: (8 '`COM(: \n' +9 '\tTook some of Mike Brevoort\'s xquery code samples because they are nice and show common xquery syntax \n' +10 ':)`END`PLN\n' +11 ' \n' +12 ' `END`COM(:~\n' +13 ' : Given a sequence of version URIs, publish all of these versions of each document\n' +14 ' : If there is a version of the same document already published, unpublish it 1st\n' +15 ' :\n' +16 ' : When "publish" is referred to, we mean that it is put into the PUBLISHED collection\n' +17 ' : unpublish removes content from this collection\n' +18 ' : @param $version_uris - sequence of uris of versions of managed documents to publish\n' +19 ' :)`END`PLN\n' +20 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:publish(`END<span class="var pln">$version_uris`END`PLN `END`KWDas`END`PLN `END`KWDitem`END`PLN()*) {\n' +21 ' `END`KWDfor`END`PLN `END<span class="var pln">$uri`END`PLN `END`KWDin`END`PLN `END<span class="var pln">$version_uris`END`PLN\n' +22 ' `END`KWDlet`END`PLN `END<span class="var pln">$doc`END`PLN := `END<span class="fun pln">fn:doc`END`PLN(`END<span class="var pln">$uri`END`PLN)\n' +23 ' `END`KWDlet`END`PLN `END<span class="var pln">$managed_base_uri`END`PLN := `END<span class="var pln">$doc`END`PLN/`END`KWDnode`END`PLN()/property::dls:version/dls:document-uri/`END`KWDtext`END`PLN()\n' +24 ' `END`KWDlet`END`PLN `END<span class="var pln">$existing`END`PLN := comoms-dls:publishedDoc(`END<span class="var pln">$managed_base_uri`END`PLN)\n' +25 ' `END`KWDlet`END`PLN `END<span class="var pln">$unpublishExisting`END`PLN := `END`KWDif`END`PLN(`END<span class="var pln">$existing`END`PLN) `END`KWDthen`END`PLN comoms-dls:unpublishVersion((`END<span class="fun pln">xdmp:node-uri`END`PLN(`END<span class="var pln">$existing`END`PLN))) `END`KWDelse`END`PLN ()\n' +26 ' `END`KWDlet`END`PLN `END<span class="var pln">$addPermissions`END`PLN := `END<span class="fun pln">dls:document-add-permissions`END`PLN(`END<span class="var pln">$uri`END`PLN, (`END<span class="fun pln">xdmp:permission`END`PLN(`END`STR\'mkp-anon\'`END`PLN, `END`STR\'read\'`END`PLN)))\n' +27 ' `END`KWDreturn`END`PLN\n' +28 ' `END<span class="fun pln">dls:document-add-collections`END`PLN(`END<span class="var pln">$uri`END`PLN, (`END`STR"PUBLISHED"`END`PLN)) \n' +29 ' };\n' +30 ' \n' +31 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:publishLatest(`END<span class="var pln">$uri`END`PLN) {\n' +32 ' `END`COM(: TODO check if it\'s in the draft collection probably :)`END`PLN\n' +33 ' \n' +34 ' `END`KWDlet`END`PLN `END<span class="var pln">$latest_version_uri`END`PLN := comoms-dls:latestVersionUri(`END<span class="var pln">$uri`END`PLN)\n' +35 ' `END`KWDlet`END`PLN `END<span class="var pln">$log`END`PLN:= `END<span class="fun pln">xdmp:log`END`PLN(`END<span class="fun pln">fn:concat`END`PLN(`END`STR"latest: "`END`PLN, `END<span class="var pln">$latest_version_uri`END`PLN)) \n' +36 ' `END`KWDlet`END`PLN `END<span class="var pln">$log`END`PLN:= `END<span class="fun pln">xdmp:log`END`PLN(`END<span class="fun pln">fn:concat`END`PLN(`END`STR"uri: "`END`PLN, `END<span class="var pln">$uri`END`PLN)) \n' +37 ' `END`KWDreturn`END`PLN comoms-dls:publish(`END<span class="var pln">$latest_version_uri`END`PLN) \n' +38 ' \n' +39 ' };\n' +40 ' \n' +41 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:latestVersionUri(`END<span class="var pln">$uri`END`PLN) {\n' +42 ' `END`KWDlet`END`PLN `END<span class="var pln">$latest_version_num`END`PLN :=\n' +43 ' (\n' +44 ' `END`KWDfor`END`PLN `END<span class="var pln">$version`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">dls:document-history`END`PLN(`END<span class="var pln">$uri`END`PLN)/dls:version\n' +45 ' `END`KWDorder`END`PLN `END`KWDby`END`PLN `END<span class="fun pln">fn:number`END`PLN(`END<span class="var pln">$version`END`PLN//dls:version-id/`END`KWDtext`END`PLN()) `END`KWDdescending`END`PLN\n' +46 ' `END`KWDreturn`END`PLN `END<span class="var pln">$version`END`PLN//dls:version-id/`END`KWDtext`END`PLN()\n' +47 ' )[1]\n' +48 ' \n' +49 ' \n' +50 ' `END`KWDreturn`END`PLN `END<span class="fun pln">dls:document-version-uri`END`PLN(`END<span class="var pln">$uri`END`PLN, `END<span class="var pln">$latest_version_num`END`PLN)\n' +51 ' };\n' +52 ' \n' +53 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:unpublish(`END<span class="var pln">$uris`END`PLN `END`KWDas`END`PLN `END`KWDitem`END`PLN()*) {\n' +54 ' `END`KWDfor`END`PLN `END<span class="var pln">$uri`END`PLN `END`KWDin`END`PLN `END<span class="var pln">$uris`END`PLN\n' +55 ' `END`KWDreturn`END`PLN\n' +56 ' `END`KWDlet`END`PLN `END<span class="var pln">$published_doc`END`PLN := comoms-dls:publishedDoc(`END<span class="var pln">$uri`END`PLN)\n' +57 ' `END`KWDreturn`END`PLN\n' +58 ' `END`KWDif`END`PLN(`END<span class="var pln">$published_doc`END`PLN) `END`KWDthen`END`PLN\n' +59 ' `END`KWDlet`END`PLN `END<span class="var pln">$published_version_uri`END`PLN := `END<span class="fun pln">xdmp:node-uri`END`PLN(`END<span class="var pln">$published_doc`END`PLN)\n' +60 ' `END`KWDreturn`END`PLN comoms-dls:unpublishVersion(`END<span class="var pln">$published_version_uri`END`PLN) \n' +61 ' `END`KWDelse`END`PLN\n' +62 ' ()\n' +63 ' };\n' +64 ' \n' +65 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:latestPublishedDocAuthor(`END<span class="var pln">$uri`END`PLN) {\n' +66 ' `END`KWDlet`END`PLN `END<span class="var pln">$author_id`END`PLN := `END<span class="fun pln">doc`END`PLN(`END<span class="var pln">$uri`END`PLN)/property::dls:version/dls:author/`END`KWDtext`END`PLN()\n' +67 ' `END`KWDreturn`END`PLN\n' +68 ' `END`KWDif`END`PLN(`END<span class="var pln">$author_id`END`PLN) `END`KWDthen`END`PLN\n' +69 ' comoms-user:getUsername(`END<span class="var pln">$author_id`END`PLN)\n' +70 ' `END`KWDelse`END`PLN\n' +71 ' ()\n' +72 ' \n' +73 ' };\n' +74 ' \n' +75 ' `END`COM(:~\n' +76 ' : Given a sequence of version URIs, unpublish all of these versions of each document\n' +77 ' :)`END`PLN\n' +78 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:unpublishVersion(`END<span class="var pln">$version_uris`END`PLN `END`KWDas`END`PLN `END`KWDitem`END`PLN()*) {\n' +79 ' `END`KWDfor`END`PLN `END<span class="var pln">$uri`END`PLN `END`KWDin`END`PLN `END<span class="var pln">$version_uris`END`PLN\n' +80 ' `END`KWDreturn`END`PLN\n' +81 ' `END`KWDlet`END`PLN `END<span class="var pln">$removePermissions`END`PLN := `END<span class="fun pln">dls:document-remove-permissions`END`PLN(`END<span class="var pln">$uri`END`PLN, (`END<span class="fun pln">xdmp:permission`END`PLN(`END`STR\'mkp-anon\'`END`PLN, `END`STR\'read\'`END`PLN)))\n' +82 ' `END`KWDreturn`END`PLN `END<span class="fun pln">dls:document-remove-collections`END`PLN(`END<span class="var pln">$uri`END`PLN, (`END`STR"PUBLISHED"`END`PLN)) \n' +83 ' };\n' +84 ' \n' +85 ' `END`COM(:~\n' +86 ' : Given the base URI of a managed piece of content, return the document of the node\n' +87 ' : of the version that is published\n' +88 ' :)`END`PLN\n' +89 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:publishedDoc(`END<span class="var pln">$uri`END`PLN) {\n' +90 ' `END<span class="fun pln">fn:collection`END`PLN(`END`STR"PUBLISHED"`END`PLN)[property::dls:version/dls:document-uri = `END<span class="var pln">$uri`END`PLN]\n' +91 ' };\n' +92 ' \n' +93 ' \n' +94 ' `END`COM(:~\n' +95 ' : Test if any version of the managed document is published\n' +96 ' :)`END`PLN\n' +97 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:isPublished(`END<span class="var pln">$uri`END`PLN) {\n' +98 ' `END`KWDif`END`PLN( comoms-dls:publishedDoc(`END<span class="var pln">$uri`END`PLN)) `END`KWDthen`END`PLN\n' +99 ' `END<span class="fun pln">fn:true`END`PLN()\n' +100 ' `END`KWDelse`END`PLN\n' +101 ' `END<span class="fun pln">fn:false`END`PLN()\n' +102 ' };\n' +103 ' \n' +104 ' \n' +105 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:publishedState(`END<span class="var pln">$uri`END`PLN) {\n' +106 ' `END`KWDlet`END`PLN `END<span class="var pln">$doc`END`PLN := comoms-dls:publishedDoc(`END<span class="var pln">$uri`END`PLN)\n' +107 ' `END`KWDlet`END`PLN `END<span class="var pln">$published_uri`END`PLN := `END`KWDif`END`PLN(`END<span class="var pln">$doc`END`PLN) `END`KWDthen`END`PLN `END<span class="fun pln">xdmp:node-uri`END`PLN(`END<span class="var pln">$doc`END`PLN) `END`KWDelse`END`PLN ()\n' +108 ' `END`KWDlet`END`PLN `END<span class="var pln">$latest`END`PLN := comoms-dls:latestVersionUri(`END<span class="var pln">$uri`END`PLN)\n' +109 ' `END`KWDreturn`END`PLN\n' +110 ' `END`KWDif`END`PLN(`END<span class="var pln">$doc`END`PLN) `END`KWDthen`END`PLN\n' +111 ' `END`KWDif`END`PLN(`END<span class="var pln">$latest`END`PLN ne `END<span class="var pln">$published_uri`END`PLN) `END`KWDthen`END`PLN\n' +112 ' `END`STR"stale"`END`PLN\n' +113 ' `END`KWDelse`END`PLN\n' +114 ' `END`STR"published"`END`PLN\n' +115 ' `END`KWDelse`END`PLN\n' +116 ' `END`STR"unpublished"`END`PLN\n' +117 ' };\n' +118 ' \n' +119 ' \n' +120 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:getManagedDocUri(`END<span class="var pln">$uri`END`PLN) {\n' +121 ' `END`KWDlet`END`PLN `END<span class="var pln">$doc`END`PLN := `END<span class="fun pln">fn:doc`END`PLN(`END<span class="var pln">$uri`END`PLN)\n' +122 ' `END`KWDlet`END`PLN `END<span class="var pln">$managed_uri`END`PLN := `END<span class="var pln">$doc`END`PLN/property::dls:version/dls:document-uri/`END`KWDtext`END`PLN()\n' +123 ' `END`KWDlet`END`PLN `END<span class="var pln">$managed_uri`END`PLN := `END`KWDif`END`PLN(`END<span class="var pln">$managed_uri`END`PLN) `END`KWDthen`END`PLN `END<span class="var pln">$managed_uri`END`PLN `END`KWDelse`END`PLN `END<span class="var pln">$uri`END`PLN\n' +124 ' `END`KWDreturn`END`PLN `END<span class="var pln">$managed_uri`END`PLN\n' +125 ' };\n' +126 ' \n' +127 ' `END`COM(:~\n' +128 ' : Given a manage content url (e.g. /content/123456.xml) return the appropriate\n' +129 ' : version of the document based on what stage collection is being viewed and\n' +130 ' : what\'s published\n' +131 ' :\n' +132 ' : @param $uri a manage content url (e.g. /content/123456.xml) - NOT A VERSIONED URI\n' +133 ' :)`END`PLN\n' +134 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:doc(`END<span class="var pln">$uri`END`PLN) {\n' +135 ' `END`KWDlet`END`PLN `END<span class="var pln">$doc`END`PLN := `END<span class="fun pln">fn:root`END`PLN(comoms-dls:collection()[property::dls:version/dls:document-uri = `END<span class="var pln">$uri`END`PLN][1])\n' +136 ' `END`KWDreturn`END`PLN\n' +137 ' `END`KWDif`END`PLN(`END<span class="var pln">$doc`END`PLN) `END`KWDthen`END`PLN\n' +138 ' `END<span class="var pln">$doc`END`PLN\n' +139 ' `END`KWDelse`END`PLN\n' +140 ' `END`KWDlet`END`PLN `END<span class="var pln">$managedDocInCollection`END`PLN := comoms-dls:collection-name() = `END<span class="fun pln">xdmp:document-get-collections`END`PLN(`END<span class="var pln">$uri`END`PLN)\n' +141 ' `END`KWDreturn`END`PLN\n' +142 ' `END`KWDif`END`PLN(`END<span class="var pln">$managedDocInCollection`END`PLN) `END`KWDthen`END`PLN\n' +143 ' `END<span class="fun pln">fn:doc`END`PLN(`END<span class="var pln">$uri`END`PLN)\n' +144 ' `END`KWDelse`END`PLN\n' +145 ' ()\n' +146 ' };\n' +147 ' \n' +148 ' `END`COM(:~\n' +149 ' : Get the collection to be used when querying for content\n' +150 ' : THIS or comoms-dls:collection-name() SHOULD BE USED WHEN BUILDING ANY QUERY FOR MANAGED CONTENT\n' +151 ' :)`END`PLN\n' +152 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:collection() {\n' +153 ' `END<span class="fun pln">fn:collection`END`PLN( comoms-dls:collection-name() )\n' +154 ' };\n' +155 ' \n' +156 ' `END`COM(:~\n' +157 ' : Get the collection nameto be used when querying for content\n' +158 ' : THIS or comoms-dls:collection() SHOULD BE USED WHEN BUILDING ANY QUERY FOR MANAGED CONTENT\n' +159 ' :)`END`PLN\n' +160 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:collection-name() `END`KWDas`END`PLN `END`TYPxs:string`END`PLN {\n' +161 ' `END`KWDlet`END`PLN `END<span class="var pln">$default_collection`END`PLN := `END`STR"PUBLISHED"`END`PLN\n' +162 ' `END`KWDreturn`END`PLN\n' +163 ' `END`KWDif`END`PLN(comoms-user:isAdmin()) `END`KWDthen`END`PLN\n' +164 ' `END`KWDlet`END`PLN `END<span class="var pln">$pub_stage_collection_cookie`END`PLN := comoms-util:getCookie(`END`STR"COMOMS_COLLECTION"`END`PLN)\n' +165 ' `END`KWDreturn`END`PLN\n' +166 ' `END`KWDif`END`PLN(`END<span class="var pln">$pub_stage_collection_cookie`END`PLN) `END`KWDthen`END`PLN\n' +167 ' `END<span class="var pln">$pub_stage_collection_cookie`END`PLN\n' +168 ' `END`KWDelse`END`PLN\n' +169 ' `END<span class="var pln">$default_collection`END`PLN\n' +170 ' `END`KWDelse`END`PLN\n' +171 ' `END<span class="var pln">$default_collection`END`PLN\n' +172 ' };\n' +173 ' \n' +174 ' `END`COM(:~\n' +175 ' : Check if the published collection is being viewed\n' +176 ' :)`END`PLN\n' +177 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:isViewingPublished() {\n' +178 ' `END`KWDif`END`PLN(comoms-dls:collection-name() = `END`STR"PUBLISHED"`END`PLN) `END`KWDthen`END`PLN\n' +179 ' `END<span class="fun pln">fn:true`END`PLN()\n' +180 ' `END`KWDelse`END`PLN\n' +181 ' `END<span class="fun pln">fn:false`END`PLN()\n' +182 ' };\n' +183 ' \n' +184 ' `END`COM(:~\n' +185 ' : Get the best URL for the content URI.\n' +186 ' : This is either the default URI based on detail type or should also take\n' +187 ' : into account friendly urls and navigation structures to figure out the\n' +188 ' : best choice\n' +189 ' :)`END`PLN\n' +190 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:contentUrl(`END<span class="var pln">$uri`END`PLN) {\n' +191 ' \n' +192 ' `END`COM(: TODO: add friendly URL and nav structure logic 1st :)`END`PLN\n' +193 ' \n' +194 ' `END`KWDlet`END`PLN `END<span class="var pln">$doc`END`PLN := `END<span class="fun pln">fn:doc`END`PLN(`END<span class="var pln">$uri`END`PLN)\n' +195 ' `END`KWDlet`END`PLN `END<span class="var pln">$managedDocUri`END`PLN := `END<span class="var pln">$doc`END`PLN/property::dls:version/dls:document-uri\n' +196 ' `END`KWDlet`END`PLN `END<span class="var pln">$uri`END`PLN := `END`KWDif`END`PLN(`END<span class="var pln">$managedDocUri`END`PLN) `END`KWDthen`END`PLN `END<span class="var pln">$managedDocUri`END`PLN `END`KWDelse`END`PLN `END<span class="var pln">$uri`END`PLN\n' +197 ' `END`KWDlet`END`PLN `END<span class="var pln">$type`END`PLN := `END<span class="var pln">$doc`END`PLN/`END`KWDnode`END`PLN()/`END<span class="fun pln">fn:name`END`PLN()\n' +198 ' `END`KWDlet`END`PLN `END<span class="var pln">$content_id`END`PLN := `END<span class="fun pln">fn:tokenize`END`PLN( `END<span class="fun pln">fn:tokenize`END`PLN(`END<span class="var pln">$uri`END`PLN, `END`STR"/"`END`PLN)[3], `END`STR"\\."`END`PLN)[1]\n' +199 ' `END`KWDreturn`END`PLN\n' +200 ' `END<span class="fun pln">fn:concat`END`PLN(`END`STR"/"`END`PLN, `END<span class="var pln">$type`END`PLN, `END`STR"/"`END`PLN, `END<span class="var pln">$content_id`END`PLN)\n' +201 ' };\n' +202 ' \n' +203 ' `END`COM(:\n' +204 ' :\n' +205 ' : gets list of doc versions and uri.\n' +206 ' :\n' +207 ' :)`END`PLN\n' +208 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:versionHistory(`END<span class="var pln">$uri`END`PLN) {\n' +209 ' `END`KWDlet`END`PLN `END<span class="var pln">$published_doc`END`PLN := comoms-dls:publishedDoc(`END<span class="var pln">$uri`END`PLN)\n' +210 ' `END`KWDlet`END`PLN `END<span class="var pln">$published_uri`END`PLN := `END`KWDif`END`PLN(`END<span class="var pln">$published_doc`END`PLN) `END`KWDthen`END`PLN `END<span class="fun pln">xdmp:node-uri`END`PLN(`END<span class="var pln">$published_doc`END`PLN) `END`KWDelse`END`PLN ()\n' +211 ' `END`KWDreturn`END`PLN\n' +212 ' `END`TAG&lt;versions&gt;`END`PLN\n' +213 ' {\n' +214 ' `END`KWDfor`END`PLN `END<span class="var pln">$version`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">dls:document-history`END`PLN(`END<span class="var pln">$uri`END`PLN)/dls:version\n' +215 ' `END`KWDlet`END`PLN `END<span class="var pln">$version_num`END`PLN := `END<span class="var pln">$version`END`PLN/dls:version-id/`END`KWDtext`END`PLN()\n' +216 ' `END`KWDlet`END`PLN `END<span class="var pln">$created`END`PLN := `END<span class="var pln">$version`END`PLN/dls:created/`END`KWDtext`END`PLN()\n' +217 ' `END`KWDlet`END`PLN `END<span class="var pln">$author_id`END`PLN := `END<span class="var pln">$version`END`PLN/dls:author/`END`KWDtext`END`PLN()\n' +218 ' `END`KWDlet`END`PLN `END<span class="var pln">$author`END`PLN := comoms-user:getUsername(`END<span class="var pln">$author_id`END`PLN)\n' +219 ' \n' +220 ' \n' +221 ' `END`KWDlet`END`PLN `END<span class="var pln">$note`END`PLN := `END<span class="var pln">$version`END`PLN/dls:annotation/`END`KWDtext`END`PLN()\n' +222 ' `END`KWDlet`END`PLN `END<span class="var pln">$version_uri`END`PLN := `END<span class="fun pln">xdmp:node-uri`END`PLN(`END<span class="fun pln">dls:document-version`END`PLN(`END<span class="var pln">$uri`END`PLN, `END<span class="var pln">$version_num`END`PLN))\n' +223 ' `END`KWDlet`END`PLN `END<span class="var pln">$published`END`PLN := `END<span class="var pln">$published_uri`END`PLN `END`KWDeq`END`PLN `END<span class="var pln">$version_uri`END`PLN\n' +224 ' `END`KWDreturn`END`PLN\n' +225 ' `END`TAG&lt;version&gt;`END`PLN\n' +226 ' `END`TAG&lt;version-number&gt;`END`PLN{`END<span class="var pln">$version_num`END`PLN}`END`TAG&lt;/version-number&gt;`END`PLN\n' +227 ' `END`TAG&lt;created&gt;`END`PLN{`END<span class="var pln">$created`END`PLN}`END`TAG&lt;/created&gt;`END`PLN \n' +228 ' `END`TAG&lt;author&gt;`END`PLN{`END<span class="var pln">$author`END`PLN}`END`TAG&lt;/author&gt;`END`PLN\n' +229 ' `END`TAG&lt;published&gt;`END`PLN{`END<span class="var pln">$published`END`PLN}`END`TAG&lt;/published&gt;`END`PLN\n' +230 ' `END`TAG&lt;version-uri&gt;`END`PLN{`END<span class="var pln">$version_uri`END`PLN}`END`TAG&lt;/version-uri&gt;`END`PLN\n' +231 ' `END`TAG&lt;/version&gt;`END`PLN \n' +232 ' } \n' +233 ' `END`TAG&lt;/versions&gt;`END`PLN\n' +234 ' };\n' +235 ' \n' +236 ' \n' +237 ' \n' +238 ' \n' +239 ' \n' +240 ' \n' +241 ' `END`COM(: ########################################################################### :)`END`PLN\n' +242 ' `END`COM(: PRIVATE FUNCTIONS :)`END`PLN\n' +243 ' `END`COM(: ########################################################################### :)`END`PLN\n' +244 ' \n' +245 ' `END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN comoms-dls:_import() {\n' +246 ' `END`STR"xquery version \'1.0-ml\';\n' +247 ' import module namespace dls = \'http://marklogic.com/xdmp/dls\' at \'/MarkLogic/dls.xqy\'; "`END`PLN\n' +248 ' }; \n' +249 ' \n' +250 '`END`COM(: ----\n' +251 '---- :)`END`PLN\n' +252 '`END`KWDxquery`END`PLN `END`KWDversion`END`PLN `END`STR\'1.0-ml\'`END`PLN;\n' +253 '`END`KWDdeclare`END`PLN `END`KWDvariable`END`PLN `END<span class="var pln">$URI`END`PLN `END`KWDas`END`PLN `END`TYPxs:string`END`PLN `END`KWDexternal`END`PLN;\n' +254 ' \n' +255 '`END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN local:document-move-forest(`END<span class="var pln">$uri`END`PLN `END`KWDas`END`PLN `END`TYPxs:string`END`PLN, `END<span class="var pln">$forest-ids`END`PLN `END`KWDas`END`PLN `END`TYPxs:unsignedLong`END`PLN*)\n' +256 '{\n' +257 ' `END<span class="fun pln">xdmp:document-insert`END`PLN(\n' +258 ' `END<span class="var pln">$uri`END`PLN,\n' +259 ' `END<span class="fun pln">fn:doc`END`PLN(`END<span class="var pln">$uri`END`PLN),\n' +260 ' `END<span class="fun pln">xdmp:document-get-permissions`END`PLN(`END<span class="var pln">$uri`END`PLN),\n' +261 ' `END<span class="fun pln">xdmp:document-get-collections`END`PLN(`END<span class="var pln">$uri`END`PLN),\n' +262 ' `END<span class="fun pln">xdmp:document-get-quality`END`PLN(`END<span class="var pln">$uri`END`PLN),\n' +263 ' `END<span class="var pln">$forest-ids`END`PLN\n' +264 ' )\n' +265 '};\n' +266 ' \n' +267 '`END`KWDlet`END`PLN `END<span class="var pln">$xml`END`PLN :=\n' +268 ' `END`TAG&lt;xml`END`PLN att=`END`STR"blah"`END`PLN att2=`END`STR"blah"`END`TAG&gt;`END`PLN\n' +269 ' sdasd`END`TAG&lt;b&gt;`END`PLNasdasd`END`TAG&lt;/b&gt;`END`PLN\n' +270 ' `END`TAG&lt;/xml&gt;`END`PLN\n' +271 '`END`COM(: -------- :)`END`PLN\n' +272 '`END`KWDfor`END`PLN `END<span class="var pln">$d`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">fn:doc`END`PLN(`END`STR"depts.xml"`END`PLN)/depts/deptno\n' +273 '`END`KWDlet`END`PLN `END<span class="var pln">$e`END`PLN := `END<span class="fun pln">fn:doc`END`PLN(`END`STR"emps.xml"`END`PLN)/emps/emp[deptno = `END<span class="var pln">$d`END`PLN]\n' +274 '`END`KWDwhere`END`PLN `END<span class="fun pln">fn:count`END`PLN(`END<span class="var pln">$e`END`PLN) &gt;= 10\n' +275 '`END`KWDorder`END`PLN `END`KWDby`END`PLN `END<span class="fun pln">fn:avg`END`PLN(`END<span class="var pln">$e`END`PLN/salary) `END`KWDdescending`END`PLN\n' +276 '`END`KWDreturn`END`PLN\n' +277 ' `END`TAG&lt;big-dept&gt;`END`PLN\n' +278 ' {\n' +279 ' `END<span class="var pln">$d`END`PLN,\n' +280 ' `END`TAG&lt;headcount&gt;`END`PLN{`END<span class="fun pln">fn:count`END`PLN(`END<span class="var pln">$e`END`PLN)}`END`TAG&lt;/headcount&gt;`END`PLN,\n' +281 ' `END`TAG&lt;avgsal&gt;`END`PLN{`END<span class="fun pln">fn:avg`END`PLN(`END<span class="var pln">$e`END`PLN/salary)}`END`TAG&lt;/avgsal&gt;`END`PLN\n' +282 ' }\n' +283 ' `END`TAG&lt;/big-dept&gt;`END`PLN\n' +284 '`END`COM(: -------- :)`END`PLN\n' +285 '`END`KWDdeclare`END`PLN `END`KWDfunction`END`PLN local:depth(`END<span class="var pln">$e`END`PLN `END`KWDas`END`PLN `END`KWDnode`END`PLN()) `END`KWDas`END`PLN `END`TYPxs:integer`END`PLN\n' +286 '{\n' +287 ' `END`COM(: A node with no children has depth 1 :)`END`PLN\n' +288 ' `END`COM(: Otherwise, add 1 to max depth of children :)`END`PLN\n' +289 ' `END`KWDif`END`PLN (`END<span class="fun pln">fn:empty`END`PLN(`END<span class="var pln">$e`END`PLN/*)) `END`KWDthen`END`PLN 1\n' +290 ' `END`KWDelse`END`PLN `END<span class="fun pln">fn:max`END`PLN(`END`KWDfor`END`PLN `END<span class="var pln">$c`END`PLN `END`KWDin`END`PLN `END<span class="var pln">$e`END`PLN/* `END`KWDreturn`END`PLN local:depth(`END<span class="var pln">$c`END`PLN)) + 1\n' +291 '};\n' +292 ' \n' +293 'local:depth(`END<span class="fun pln">fn:doc`END`PLN(`END`STR"partlist.xml"`END`PLN))\n' +294 ' \n' +295 '`END`COM(: -------- :)`END`PLN\n' +296 '`END`TAG&lt;html&gt;&lt;head`END`PLN/`END`TAG&gt;&lt;body&gt;`END`PLN\n' +297 '{\n' +298 ' `END`KWDfor`END`PLN `END<span class="var pln">$act`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">doc`END`PLN(`END`STR"hamlet.xml"`END`PLN)//ACT\n' +299 ' `END`KWDlet`END`PLN `END<span class="var pln">$speakers`END`PLN := `END<span class="fun pln">distinct-values`END`PLN(`END<span class="var pln">$act`END`PLN//SPEAKER)\n' +300 ' `END`KWDreturn`END`PLN\n' +301 ' `END`TAG&lt;div&gt;`END`PLN{ `END<span class="fun pln">string`END`PLN(`END<span class="var pln">$act`END`PLN/TITLE) }`END`TAG&lt;/h1&gt;`END`PLN\n' +302 ' `END`TAG&lt;ul&gt;`END`PLN\n' +303 ' {\n' +304 ' `END`KWDfor`END`PLN `END<span class="var pln">$speaker`END`PLN `END`KWDin`END`PLN `END<span class="var pln">$speakers`END`PLN\n' +305 ' `END`KWDreturn`END`PLN `END`TAG&lt;li&gt;`END`PLN{ `END<span class="var pln">$speaker`END`PLN }`END`TAG&lt;/li&gt;`END`PLN\n' +306 ' }\n' +307 ' `END`TAG&lt;/ul&gt;`END`PLN\n' +308 ' `END`TAG&lt;/div&gt;`END`PLN\n' +309 '}\n' +310 '`END`TAG&lt;/body&gt;&lt;/html&gt;`END`PLN\n' +311 '`END`COM(: -------- :)`END`PLN\n' +312 '{\n' +313 '\t`END`KWDfor`END`PLN `END<span class="var pln">$book`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">doc`END`PLN(`END`STR"books.xml"`END`PLN)//book\n' +314 ' `END`KWDreturn`END`PLN\n' +315 '\t`END`KWDif`END`PLN (`END<span class="fun pln">contains`END`PLN(`END<span class="var pln">$book`END`PLN/author/`END`KWDtext`END`PLN(),`END`STR"Herbert"`END`PLN) `END`KWDor`END`PLN `END<span class="fun pln">contains`END`PLN(`END<span class="var pln">$book`END`PLN/author/`END`KWDtext`END`PLN(),`END`STR"Asimov"`END`PLN))\n' +316 '\t\t`END`KWDthen`END`PLN `END<span class="var pln">$book`END`PLN\n' +317 '\t`END`KWDelse`END`PLN `END<span class="var pln">$book`END`PLN/`END`KWDtext`END`PLN()\n' +318 '\t\n' +319 '\t`END`KWDlet`END`PLN `END<span class="var pln">$let`END`PLN := `END`TAG&lt;x&gt;`END`STR"test"`END`TAG&lt;/x&gt;`END`PLN\n' +320 '\t`END`KWDreturn`END`PLN `END`KWDelement`END`PLN `END`KWDelement`END`PLN {\n' +321 '\t`END`KWDattribute`END`PLN `END`KWDattribute`END`PLN { 1 },\n' +322 '\t`END`KWDelement`END`PLN test { `END`STR\'a\'`END`PLN },\n' +323 '\t`END`KWDattribute`END`PLN foo { `END`STR"bar"`END`PLN },\n' +324 '\t`END<span class="fun pln">fn:doc`END`PLN()[ foo/`END`LIT@bar`END`PLN `END`KWDeq`END`PLN `END<span class="var pln">$let`END`PLN ],\n' +325 '\t//x }\n' +326 '}\n' +327 '`END`COM(: -------- :)`END`PLN\n' +328 '`END`TAG&lt;bib&gt;`END`PLN\n' +329 ' {\n' +330 ' `END`KWDfor`END`PLN `END<span class="var pln">$b`END`PLN `END`KWDin`END`PLN `END<span class="fun pln">doc`END`PLN(`END`STR"http://bstore1.example.com/bib.xml"`END`PLN)/bib/book\n' +331 ' `END`KWDwhere`END`PLN `END<span class="var pln">$b`END`PLN/publisher = `END`STR"Addison-Wesley"`END`PLN `END`KWDand`END`PLN `END<span class="var pln">$b`END`PLN/`END`LIT@year`END`PLN &gt; 1991\n' +332 ' `END`KWDreturn`END`PLN\n' +333 ' `END`TAG&lt;book`END`PLN year=`END`STR"`END`PLN{ `END<span class="var pln">$b`END`PLN/`END`LIT@year`END`PLN }`END`STR"`END`TAG&gt;`END`PLN\n' +334 ' { `END<span class="var pln">$b`END`PLN/title }\n' +335 ' `END`TAG&lt;/book&gt;`END`PLN\n' +336 ' }\n' +337 '`END`TAG&lt;/bib&gt;`END`PLN\n' +338 '`END`COM(: -------- :)`END'339 ),340 nemerle: (341 '`KWDclass`END`PLN Set `END`PUN[`END`PLN\'a`END`PUN]`END`PLN\n' +342 '`END`PUN{`END`PLN\n' +343 ' `END`KWDmutable`END`PLN storage `END`PUN:`END`PLN `END`TYPlist`END`PLN `END`PUN[`END`PLN\'a`END`PUN]`END`PLN `END`PUN=`END`PLN `END`PUN[];`END`PLN\n' +344 ' `END`KWDpublic`END`PLN Add `END`PUN(`END`PLNe `END`PUN:`END`PLN \'a`END`PUN)`END`PLN `END`PUN:`END`PLN `END`TYPvoid`END`PLN\n' +345 ' `END`PUN{`END`PLN\n' +346 ' `END`KWDwhen`END`PLN `END`PUN(!`END`PLN Contains `END`PUN(`END`PLNe`END`PUN))`END`PLN\n' +347 ' storage `END`PUN::=`END`PLN e`END`PUN;`END`PLN\n' +348 ' `END`PUN}`END`PLN\n' +349 ' `END`KWDpublic`END`PLN Contains `END`PUN(`END`PLNe `END`PUN:`END`PLN \'a`END`PUN)`END`PLN `END`PUN:`END`PLN `END`TYPbool`END`PLN\n' +350 ' `END`PUN{`END`PLN\n' +351 ' storage`END`PUN.`END`PLNContains `END`PUN(`END`PLNe`END`PUN)`END`PLN\n' +352 ' `END`PUN}`END`PLN\n' +353 '`END`PUN}`END`PLN\n' +354 ' \n' +355 '`END`KWDdef`END`PLN s1 `END`PUN=`END`PLN Set `END`PUN();`END`PLN\n' +356 's1`END`PUN.`END`PLNAdd `END`PUN(`END`LIT3`END`PUN);`END`PLN\n' +357 's1`END`PUN.`END`PLNAdd `END`PUN(`END`LIT42`END`PUN);`END`PLN\n' +358 '`END`KWDassert`END`PLN `END`PUN(`END`PLNs1`END`PUN.`END`PLNContains `END`PUN(`END`LIT3`END`PUN));`END`PLN\n' +359 '`END`COM// s1.Add ("foo"); // error here!`END`PLN\n' +360 '`END`KWDdef`END`PLN s2 `END`PUN=`END`PLN Set `END`PUN();`END`PLN\n' +361 's2`END`PUN.`END`PLNAdd `END`PUN(`END`STR"foo"`END`PUN);`END`PLN\n' +362 '`END`KWDassert`END`PLN `END`PUN(`END`PLNs2`END`PUN.`END`PLNContains `END`PUN(`END`STR"foo"`END`PUN));`END'363 ),364 latex: (365 '`COM% resume.tex`END`PLN\n' +366 '`END`COM% vim:set ft=tex spell:`END`PLN\n' +367 '`END`KWD\\documentclass`END`PUN[`END`LIT10pt`END`PLN,letterpaper`END`PUN]{`END`PLNarticle`END`PUN}`END`PLN\n' +368 '`END`KWD\\usepackage`END`PUN[`END`PLNletterpaper,margin`END`PUN=`END`LIT0.8in`END`PUN]{`END`PLNgeometry`END`PUN}`END`PLN\n' +369 '`END`KWD\\usepackage`END`PUN{`END`PLNmdwlist`END`PUN}`END`PLN\n' +370 '`END`KWD\\usepackage`END`PUN[`END`PLNT1`END`PUN]{`END`PLNfontenc`END`PUN}`END`PLN\n' +371 '`END`KWD\\usepackage`END`PUN{`END`PLNtextcomp`END`PUN}`END`PLN\n' +372 '`END`KWD\\pagestyle`END`PUN{`END`PLNempty`END`PUN}`END`PLN\n' +373 '`END`KWD\\setlength`END`PUN{`END`KWD\\tabcolsep`END`PUN}{`END`LIT0em`END`PUN}`END'374 ),375 issue144: (376 '`COM#! /bin/bash`END`PLN\n' +377 '`END`COM# toascii.sh`END`PLN\n' +378 '`END`KWDfor`END`PLN i `END`KWDin`END`PLN $`END`PUN(`END`PLNecho $`END`PUN*' +379 '`END`PLN `END`PUN|`END`PLN fold `END`PUN-`END`PLNw `END`LIT1`END`PUN);`END' +380 '`KWDdo`END`PLN\n' +381 ' printf `END`STR"%x "`END`PLN \\\'$i`END`PUN;`END`PLN\n' +382 '`END`KWDdone`END`PUN;`END`PLN\n' +383 'echo`END'384 ),385 issue145: (386 '`TAG&lt;script`END`PLN `END`ATNtype`END`PUN=`END`ATV"text/javascript"`END`TAG&gt;`END`PLN\n' +387 '`END`PUN&lt;!--`END`PLN\n' +388 ' `END`KWDvar`END`PLN target `END`PUN=`END`PLN $$`END`PUN.`END`PLNcss`END`PUN(`END`STR\'backgroundImage\'`END`PUN).`END`PLNreplace`END`PUN(`END`STR/^url[\\(\\)\'"]/`END`PLNg`END`PUN,`END`PLN `END`STR\'\'`END`PUN);`END`PLN\n' +389 '\n' +390 ' `END`COM// nice long chain: wrap img element in span`END`PLN\n' +391 ' $$`END`PUN.`END`PLNwrap`END`PUN(`END`STR\'&lt;span style="position: relative;"&gt;&lt;/span&gt;\'`END`PUN)`END`PLN\n' +392 '`END`PUN--&gt;`END`PLN\n' +393 '`END`TAG&lt;/script&gt;`END'394 ),395 clojure: (396 '`COM; Clojure test comment`END`PLN\n' +397 '`END`OPN(`END`KWDns`END`PLN test\n' +398 ' `END`OPN(`END`TYP:gen-class`END`CLO))`END`PLN\n' +399 '\n' +400 '`END`OPN(`END`KWDdef`END`PLN foo `END`STR"bar"`END`CLO)`END`PLN\n' +401 '`END`OPN(`END`KWDdefn`END`PLN bar `END`OPN[`END`PLNarg1 arg2 &amp; args`END`CLO]`END`PLN\n' +402 ' `END`STR"sample function"`END`PLN\n' +403 ' `END`OPN(`END`KWDfor`END`PLN `END`OPN[`END`PLNarg args`END`CLO]`END`PLN\n' +404 ' `END`OPN(`END`KWDprn`END`PLN arg`END`CLO)))`END`PLN\n' +405 '\n' +406 '`END`OPN(`END`PLNbar `END`STR"foo"`END`PLN `END`STR"bar"`END`PLN `END`STR"blah"`END`PLN `END`TYP:baz`END`CLO)`END'407 ),408 html5conv1: '`COM; foo`END',409 html5conv2: '<code class="language-lisp">`COM; foo`END</code>',410 html5conv3: (411 '<code class="language-lisp">`PLN\n' +412 '`END`COM; foo`END`PLN\n' +413 '`END</code>\n'414 ),415 html5conv4: (416 '`PLNbefore CODE\n' +417 '`END<code class="language-lisp">`PUN;`END`PLN foo`END</code>\n'418 ),419 procinstr1: '`COM; foo`END',420 procinstr2: '<ol class="linenums"><li class="L3" value="4">`COM; foo`END</li></ol>',421 procinstr3: '<ol class="linenums"><li class="L0">`COM; foo`END</li></ol>',422 procinstr4: '`COM; foo`END',423 issue185: '`STR"No tag backs."`END',424 issue261: '<ol class="linenums"><li class="L0">`STR"No tag backs."`END</li></ol>',425 issue201: (426 '`KWDstatic`END`PLN `END`TYPPersistent`END' +427 '`PUN&lt;`END`TYPString`END`PUN&gt;`END`PLN listeners_symbol`END`PUN;`END'428 ),429 dart: (430 '`KWDpart of`END`PLN myLib`END`PUN;`END`PLN\n' +431 '\n' +432 '`END`KWDpart`END`PLN `END`STR\'something.dart\'`END`PUN;`END`PLN\n' +433 '\n' +434 '`END`KWDimport`END`PLN `END`STR\'dart:math\'`END`PLN `END' +435 '`KWDas`END`PLN test `END`KWDshow`END`PLN foo`END`PUN,`END`PLN bar`END`PUN;`END' +436 '`PLN\n' +437 '\n' +438 '`END`KWDclass`END`PLN `END`TYPPoint`END`PLN `END`PUN{`END`PLN\n' +439 ' `END`KWDfinal`END`PLN `END`TYPnum`END`PLN x`END`PUN,`END`PLN y`END`PUN;`END`PLN\n' +440 '\n' +441 ' `END`TYPPoint`END`PUN(`END`KWDthis`END`PUN.`END`PLNx`END' +442 '`PUN,`END`PLN `END`KWDthis`END`PUN.`END`PLNy`END`PUN);`END`PLN\n' +443 ' `END`TYPPoint`END`PUN.`END`PLNzero`END`PUN()`END`PLN `END' +444 '`PUN:`END`PLN x `END`PUN=`END`PLN `END`LIT0`END`PUN,`END' +445 '`PLN y `END`PUN=`END`PLN `END`LIT0`END`PUN;`END`PLN `END' +446 '`COM// Named constructor`END`PLN\n' +447 ' `END' +448 '`COM// with an initializer list.`END`PLN\n' +449 '\n' +450 ' `END`TYPnum`END`PLN distanceTo`END`PUN(`END`TYPPoint`END`PLN other`END' +451 '`PUN)`END`PLN `END`PUN{`END`PLN\n' +452 ' `END`KWDvar`END`PLN dx `END`PUN=`END`PLN x `END`PUN-`END' +453 '`PLN other`END`PUN.`END`PLNx`END`PUN;`END`PLN\n' +454 ' `END`KWDvar`END`PLN dy `END`PUN=`END`PLN y `END`PUN-`END' +455 '`PLN other`END`PUN.`END`PLNy`END`PUN;`END`PLN\n' +456 ' `END`KWDreturn`END`PLN sqrt`END`PUN(`END`PLNdx `END`PUN*`END' +457 '`PLN dx `END`PUN+`END`PLN dy `END`PUN*`END`PLN dy`END`PUN);`END' +458 '`PLN\n' +459 ' `END`PUN}`END`PLN\n' +460 '`END`PUN}`END`PLN\n' +461 '\n' +462 '`END`COM// This is a single-line comment.`END`PLN\n' +463 '\n' +464 '`END`COM/*\n' +465 'This is a\n' +466 'multiline comment.\n' +467 '*/`END`PLN\n' +468 '\n' +469 'main`END`PUN()`END`PLN `END`PUN{`END`PLN\n' +470 ' `END`TYPPoint`END`PLN p `END`PUN=`END`PLN `END`KWDnew`END' +471 '`PLN `END`TYPPoint`END`PUN(`END`LIT7`END`PUN,`END`PLN `END' +472 '`LIT12`END`PUN);`END`PLN\n' +473 ' `END`TYPString`END`PLN thing `END`PUN=`END`PLN `END' +474 '`STR\'It\\\'s awesome!\'`END`PUN;`END`PLN\n' +475 ' `END`TYPString`END`PLN thing2 `END`PUN=`END`PLN `END' +476 '`STR\'\'\'\n' +477 'This is a test! \\\'\'\'\n' +478 'This is the end of the test\'\'\'`END`PUN;`END`PLN\n' +479 ' `END`TYPString`END`PLN thing3 `END`PUN=`END`PLN `END' +480 '`STRr\"\"\"\n' +481 'This is a raw\n' +482 'multiline string!\"\"\"`END`PUN;`END`PLN\n' +483 ' `END`TYPnum`END`PLN x `END`PUN=`END`PLN `END`LIT0x123ABC`END`PUN;`END`PLN\n' +484 ' `END`TYPnum`END`PLN y `END`PUN=`END`PLN `END`LIT1.8e-12`END`PUN;`END`PLN\n' +485 ' `END`TYPbool`END`PLN flag `END`PUN=`END`PLN `END`KWDfalse`END' +486 '`PUN;`END`PLN\n' +487 ' `END`TYPString`END`PLN raw `END`PUN=`END`PLN `END' +488 '`STRr\"This is a raw string, where \\n doesn\'t matter\"`END' +489 '`PUN;`END`PLN\n' +490 '`END`PUN}`END'491 ),492 tcl_lang: (493 '`COM#!/bin/tclsh`END`PLN\n' +494 '`END`KWDproc`END`PLN fib `END`OPN{`END`PLNn`END`CLO}`END`PLN `END`OPN{`END`PLN\n' +495 ' `END`KWDset`END`PLN a `END`LIT0`END`PLN\n' +496 ' `END`KWDset`END`PLN b `END`LIT1`END`PLN\n' +497 ' `END`KWDwhile`END`PLN `END`OPN{`END`PUN$`END`PLNn `END`PUN&gt;`END`PLN `END`LIT0`END`CLO}`END`PLN `END`OPN{`END`PLN\n' +498 ' `END`KWDset`END`PLN tmp `END`PUN$`END`PLNa\n' +499 ' `END`KWDset`END`PLN a `END`PUN[`END`KWDexpr`END`PLN `END`PUN$`END`PLNa `END`PUN+`END`PLN `END`PUN$`END`PLNb`END`PUN]`END`PLN\n' +500 ' `END`KWDset`END`PLN b `END`PUN$`END`PLNtmp\n' +501 ' `END`KWDincr`END`PLN n `END`LIT-1`END`PLN\n' +502 ' `END`CLO}`END`PLN\n' +503 ' `END`KWDreturn`END`PLN `END`PUN$`END`PLNa\n' +504 '`END`CLO}`END'505 ),506 r_lang: (507 '`COM### Example R script for syntax highlighting`END`PLN\n' +508 '\n' +509 '`END`COM# This is a comment`END`PLN\n' +510 '\n' +511 '`END`COM## Valid names`END`PLN\n' +512 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV0123456789._a `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +513 '.foo_ `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +514 '._foo `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +515 '\n' +516 '`END`COM## Invalid names`END`PLN\n' +517 '`END`LIT0`END`PLNabc `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +518 '`END`LIT.0`END`PLNabc `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +519 'abc`END`PUN+`END`PLNcde `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +520 '\n' +521 '`END`COM## Reserved Words`END`PLN\n' +522 '`END`LITNA`END`PLN\n' +523 '`END`LITNA_integer_`END`PLN\n' +524 '`END`LITNA_real_`END`PLN\n' +525 '`END`LITNA_character_`END`PLN\n' +526 '`END`LITNA_complex_`END`PLN\n' +527 '`END`LITNULL`END`PLN\n' +528 '`END`LITNaN`END`PLN\n' +529 '`END`LITInf`END`PLN\n' +530 '`END`COM## Not reserved`END`PLN\n' +531 'NULLa `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +532 'NULL1 `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +533 'NULL. `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +534 'NA_foo_ `END`PUN&lt;-`END`PLN `END`LITNULL`END`PLN\n' +535 '\n' +536 '`END`COM## Numbers`END`PLN\n' +537 '`END`LIT12345678901`END`PLN\n' +538 '`END`LIT123456.78901`END`PLN\n' +539 '`END`LIT123e3`END`PLN\n' +540 '`END`LIT123E3`END`PLN\n' +541 '`END`LIT1.23e-3`END`PLN\n' +542 '`END`LIT1.23e3`END`PLN\n' +543 '`END`LIT1.23e-3`END`PLN\n' +544 '`END`COM## integer constants`END`PLN\n' +545 '`END`LIT123L`END`PLN\n' +546 '`END`LIT1.23L`END`PLN\n' +547 '`END`COM## imaginary numbers`END`PLN\n' +548 '`END`LIT123i`END`PLN\n' +549 '`END`LIT-123i`END`PLN\n' +550 '`END`LIT123e4i`END`PLN\n' +551 '`END`LIT123e-4i`END`PLN\n' +552 '`END`COM## Hex numbers`END`PLN\n' +553 '`END`LIT0xabcdefABCDEF01234`END`PLN\n' +554 '`END`LIT0xabcp123`END`PLN\n' +555 '`END`LIT0xabcP123`END`PLN\n' +556 '`END`COM## Not hex`END`PLN\n' +557 '`END`LIT0`END`PLNxg\n' +558 '\n' +559 '`END`COM## Special operators %xyz%`END`PLN\n' +560 '`END`COM## %xyz%`END`PLN\n' +561 '`END`LIT1`END`PLN `END`PUN%%`END`PLN `END`LIT2`END`PLN\n' +562 'diag`END`PUN(`END`LIT2`END`PUN)`END`PLN `END`PUN%*%`END`PLN diag`END`PUN(`END`LIT2`END`PUN)`END`PLN\n' +563 '`END`LIT1`END`PLN `END`PUN%/%`END`PLN `END`LIT2`END`PLN\n' +564 '`END`LIT1`END`PLN `END`PUN%in%`END`PLN `END`LIT1`END`PUN:`END`LIT10`END`PLN\n' +565 'diag`END`PUN(`END`LIT2`END`PUN)`END`PLN `END`PUN%o%`END`PLN diag`END`PUN(`END`LIT2`END`PUN)`END`PLN\n' +566 'diag`END`PUN(`END`LIT2`END`PUN)`END`PLN `END`PUN%x%`END`PLN diag`END`PUN(`END`LIT2`END`PUN)`END`PLN\n' +567 '`END`STR`%foo bar%``END`PLN `END`PUN&lt;-`END`PLN `END`KWDfunction`END`PUN(`END`PLNx`END`PUN,`END`PLN y`END`PUN)`END`PLN x `END`PUN+`END`PLN y\n' +568 '`END`LIT1`END`PLN `END`PUN%foo bar%`END`PLN `END`LIT2`END`PLN\n' +569 '\n' +570 '`END`COM## Control Structures (3.2) and Function`END`PLN\n' +571 '`END`COM## if, else`END`PLN\n' +572 '`END`KWDif`END`PLN `END`PUN(`END`LITTRUE`END`PUN)`END`PLN print`END`PUN(`END`STR"foo"`END`PUN)`END`PLN `END`KWDelse`END`PLN print`END`PUN(`END`STR"bar"`END`PUN)`END`PLN\n' +573 '`END`COM## For, in`END`PLN\n' +574 '`END`KWDfor`END`PUN(`END`PLNi `END`KWDin`END`PLN `END`LIT1`END`PUN:`END`LIT5`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +575 ' print`END`PUN(`END`PLNi`END`PUN)`END`PLN\n' +576 '`END`PUN}`END`PLN\n' +577 '`END`COM## While, break`END`PLN\n' +578 'i `END`PUN&lt;-`END`PLN `END`LIT1`END`PLN\n' +579 '`END`KWDwhile`END`PLN `END`PUN(`END`LITTRUE`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +580 ' i `END`PUN&lt;-`END`PLN i `END`PUN+`END`PLN `END`LIT1`END`PLN\n' +581 ' `END`KWDif`END`PLN `END`PUN(`END`PLNi `END`PUN&gt;`END`PLN `END`LIT3`END`PUN)`END`PLN `END`KWDbreak`END`PLN\n' +582 '`END`PUN}`END`PLN\n' +583 '`END`COM## Repeat`END`PLN\n' +584 '`END`KWDrepeat`END`PLN `END`PUN{`END`LIT1+1`END`PUN}`END`PLN\n' +585 '`END`COM## Switch`END`PLN\n' +586 'x `END`PUN&lt;-`END`PLN `END`LIT3`END`PLN\n' +587 '`END`KWDswitch`END`PUN(`END`PLNx`END`PUN,`END`PLN `END`LIT2+2`END`PUN,`END`PLN mean`END`PUN(`END`LIT1`END`PUN:`END`LIT10`END`PUN),`END`PLN rnorm`END`PUN(`END`LIT5`END`PUN))`END`PLN\n' +588 '`END`COM## Function, dot-dot-dot, return`END`PLN\n' +589 'foo `END`PUN&lt;-`END`PLN `END`KWDfunction`END`PUN(`END`LIT...`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +590 ' `END`KWDreturn`END`PUN(`END`PLNsum`END`PUN(`END`LIT...`END`PUN))`END`PLN\n' +591 '`END`PUN}`END`PLN\n' +592 '`END`COM# Not keywords`END`PLN\n' +593 'functiona `END`PUN&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +594 'function. `END`PUN&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +595 'function1 `END`PUN&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +596 '\n' +597 '\n' +598 '`END`COM## Grouping Tokens 10.3.7`END`PLN\n' +599 '`END`COM## Parentheses`END`PLN\n' +600 '`END`LIT1`END`PLN `END`PUN+`END`PLN `END`PUN(`END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT3`END`PUN)`END`PLN\n' +601 '`END`COM## brackets`END`PLN\n' +602 'foo `END`PUN&lt;-`END`PLN `END`KWDfunction`END`PUN(`END`PLNa`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +603 ' a `END`PUN+`END`PLN `END`LIT1`END`PLN\n' +604 '`END`PUN}`END`PLN\n' +605 '\n' +606 '`END`COM## Indexing 10.3.8`END`PLN\n' +607 '`END`COM## []`END`PLN\n' +608 'bar `END`PUN&lt;-`END`PLN `END`LIT1`END`PUN:`END`LIT10`END`PLN\n' +609 'bar`END`PUN[`END`LIT3`END`PUN]`END`PLN\n' +610 '`END`COM## [[]]`END`PLN\n' +611 'foo `END`PUN&lt;-`END`PLN list`END`PUN(`END`PLNa`END`PUN=`END`LIT1`END`PUN,`END`PLN b`END`PUN=`END`LIT2`END`PUN,`END`PLN c`END`PUN=`END`LIT3`END`PUN)`END`PLN\n' +612 'foo`END`PUN[[`END`STR"a"`END`PUN]]`END`PLN\n' +613 '`END`COM## $`END`PLN\n' +614 'foo`END`PUN$`END`PLNa\n' +615 'foo`END`PUN$`END`STR"a"`END`PLN\n' +616 '\n' +617 '`END`COM## Operators`END`PLN\n' +618 '`END`LIT2`END`PLN `END`PUN-`END`PLN `END`LIT2`END`PLN\n' +619 '`END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +620 '`END`LIT2`END`PLN `END`PUN~`END`PLN `END`LIT2`END`PLN\n' +621 '`END`PUN!`END`PLN `END`LITTRUE`END`PLN\n' +622 '`END`PUN?`END`STR"help"`END`PLN\n' +623 '`END`LIT1`END`PUN:`END`LIT2`END`PLN\n' +624 '`END`LIT2`END`PLN `END`PUN*`END`PLN `END`LIT2`END`PLN\n' +625 '`END`LIT2`END`PLN `END`PUN/`END`PLN `END`LIT2`END`PLN\n' +626 '`END`LIT2`END`PUN^`END`LIT2`END`PLN\n' +627 '`END`LIT2`END`PLN `END`PUN&lt;`END`PLN `END`LIT2`END`PLN\n' +628 '`END`LIT2`END`PLN `END`PUN&gt;`END`PLN `END`LIT2`END`PLN\n' +629 '`END`LIT2`END`PLN `END`PUN==`END`PLN `END`LIT2`END`PLN\n' +630 '`END`LIT2`END`PLN `END`PUN&gt;=`END`PLN `END`LIT2`END`PLN\n' +631 '`END`LIT2`END`PLN `END`PUN&lt;=`END`PLN `END`LIT2`END`PLN\n' +632 '`END`LIT2`END`PLN `END`PUN!=`END`PLN `END`LIT2`END`PLN\n' +633 '`END`LITTRUE`END`PLN `END`PUN&amp;`END`PLN `END`LITFALSE`END`PLN\n' +634 '`END`LITTRUE`END`PLN `END`PUN&amp;&amp;`END`PLN `END`LITFALSE`END`PLN\n' +635 '`END`LITTRUE`END`PLN `END`PUN|`END`PLN `END`LITFALSE`END`PLN\n' +636 '`END`LITTRUE`END`PLN `END`PUN||`END`PLN `END`LITFALSE`END`PLN\n' +637 'foo `END`PUN&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +638 'foo `END`PUN=`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +639 '`END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN `END`PUN-&gt;`END`PLN foo\n' +640 'foo `END`PUN&lt;&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN\n' +641 '`END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END`PLN `END`PUN-&gt;&gt;`END`PLN foo\n' +642 'base`END`PUN:::`END`PLNsum\n' +643 'base`END`PUN::`END`PLNsum\n' +644 '\n' +645 '`END`COM## Strings`END`PLN\n' +646 'foo `END`PUN&lt;-`END`PLN `END`STR"hello, world!"`END`PLN\n' +647 'foo `END`PUN&lt;-`END`PLN `END`STR\'hello, world!\'`END`PLN\n' +648 'foo `END`PUN&lt;-`END`PLN `END`STR"Hello, \'world!"`END`PLN\n' +649 'foo `END`PUN&lt;-`END`PLN `END`STR\'Hello, "world!\'`END`PLN\n' +650 'foo `END`PUN&lt;-`END`PLN `END`STR\'Hello, \\\'world!\\\'\'`END`PLN\n' +651 'foo `END`PUN&lt;-`END`PLN `END`STR"Hello, \\"world!\\""`END`PLN\n' +652 'foo `END`PUN&lt;-`END`PLN `END`STR"Hello,\n' +653 'world!"`END`PLN\n' +654 'foo `END`PUN&lt;-`END`PLN `END`STR\'Hello,\n' +655 'world!\'`END`PLN\n' +656 '\n' +657 '`END`COM## Backtick strings`END`PLN\n' +658 '`END`STR`foo123 +!"bar\'baz``END`PLN `END`PUN&lt;-`END`PLN `END`LIT2`END`PLN `END`PUN+`END`PLN `END`LIT2`END'659 ),660 mumps: (661 '`PLNHDR `END`COM; -- prt/display header`END`PLN\n' +662 ' `END`KWDN`END`PLN `END`KWDX`END`PUN,`END`KWDI`END`PLN\n' +663 ' `END`KWDI`END`PLN `END`PUN\'`END`DEC$D`END`PUN(`END`PLNVALMHDR`END`PUN)`END`PLN `END`KWDX`END`PUN:`END`DEC$G`END`PUN(`END`PLNVALM`END`PUN(`END`STR"HDR"`END`PUN))]`END`STR""`END`PLN VALM`END`PUN(`END`STR"HDR"`END`PUN)`END`PLN\n' +664 ' `END`COM; -- prt hdr line`END`PLN\n' +665 ' `END`KWDW`END`PUN:\'`END`DEC$D`END`PUN(`END`PLNVALMPG1`END`PUN)`END`PLN `END`PUN@`END`PLNIOF `END`KWDK`END`PLN VALMPG1\n' +666 ' `END`KWDW`END`PUN:`END`PLNVALMCC `END`DEC$C`END`PUN(`END`LIT13`END`PUN)_`END`PLNIOUON`END`PUN_`END`DEC$C`END`PUN(`END`LIT13`END`PUN)_`END`PLNIOINHI`END`PUN_`END`DEC$C`END`PUN(`END`LIT13`END`PUN)`END`PLN `END`COM; -- turn on undln/hi`END`PLN\n' +667 ' `END`KWDI`END`PLN `END`DEC$E`END`PUN(`END`PLNIOST`END`PUN,`END`LIT1`END`PUN,`END`LIT2`END`PUN)=`END`STR"C-"`END`PLN `END`KWDD`END`PLN IOXY^VALM4`END`PUN(`END`LIT0`END`PUN,`END`LIT0`END`PUN)`END`PLN `END`COM; -- position cursor`END`PLN\n' +668 ' `END`KWDW`END`PLN `END`DEC$E`END`PUN(`END`PLNVALM`END`PUN(`END`STR"TITLE"`END`PUN),`END`LIT1`END`PUN,`END`LIT30`END`PUN)`END`PLN `END`COM; -- prt title`END`PLN\n' +669 ' `END`KWDW`END`PUN:`END`PLNVALMCC IOINORM`END`PUN,`END`PLNIOUON `END`COM; -- turn off hi`END`PLN\n' +670 ' `END`KWDW`END`PLN `END`DEC$J`END`PUN(`END`STR""`END`PUN,`END`LIT30`END`PUN-`END`DEC$L`END`PUN(`END`PLNVALM`END`PUN(`END`STR"TITLE"`END`PUN)))`END`PLN `END`COM; -- fill in w/blanks`END`PLN\n' +671 ' `END`KWDI`END`PLN `END`DEC$E`END`PUN(`END`PLNIOST`END`PUN,`END`LIT1`END`PUN,`END`LIT2`END`PUN)=`END`STR"C-"`END`PLN `END`KWDW`END`PLN `END`DEC$C`END`PUN(`END`LIT13`END`PUN)`END`PLN `END`KWDD`END`PLN IOXY^VALM4`END`PUN(`END`LIT30`END`PUN,`END`LIT0`END`PUN)`END`PLN `END`COM; -- position cursor`END`PLN\n' +672 ' `END`KWDW`END`PLN `END`DEC$J`END`PUN(`END`STR""`END`PUN,((`END`PLNVALMWD`END`LIT-80`END`PUN)/`END`LIT2`END`PUN)),`END`PLN$$HTE^XLFDT`END`PUN(`END`DEC$H`END`PUN,`END`LIT1`END`PUN),`END`DEC$J`END`PUN(`END`STR""`END`PUN,`END`LIT10`END`PUN+((`END`PLNVALMWD`END`LIT-80`END`PUN)/`END`LIT2`END`PUN)),`END`STR"Page: "`END`PUN,`END`DEC$J`END`PUN(`END`PLNVALMPGE`END`PUN,`END`LIT4`END`PUN),`END`STR" of "`END`PUN,`END`DEC$J`END`PUN(`END`PLN$$PAGE^VALM4`END`PUN(`END`PLNVALMCNT`END`PUN,`END`PLNVALM`END`PUN(`END`STR"LINES"`END`PUN)),`END`LIT4`END`PUN)_`END`DEC$S`END`PUN(`END`DEC$D`END`PUN(`END`PLNVALMORE`END`PUN):`END`STR"+"`END`PUN,`END`LIT1`END`PUN:`END`STR" "`END`PUN)`END`PLN `END`COM; -- prt rest of hdr`END`PLN\n' +673 ' `END`KWDW`END`PUN:`END`PLNVALMCC IOUOFF `END`KWDI`END`PLN `END`DEC$E`END`PUN(`END`PLNIOST`END`PUN,`END`LIT1`END`PUN,`END`LIT2`END`PUN)=`END`STR"C-"`END`PLN `END`KWDD`END`PLN IOXY^VALM4`END`PUN(`END`LIT0`END`PUN,`END`LIT0`END`PUN)`END`PLN `END`COM; -- turn off undln`END`PLN\n' +674 ' `END`KWDF`END`PLN `END`KWDI`END`PUN=`END`LIT1`END`PUN:`END`LIT1`END`PUN:`END`PLNVALM`END`PUN(`END`STR"TM"`END`PUN)`END`LIT-3`END`PLN `END`KWDW`END`PLN `END`PUN!,`END`DEC$S`END`PUN(\'`END`DEC$D`END`PUN(`END`PLNVALMHDR`END`PUN(`END`KWDI`END`PUN)):`END`STR""`END`PUN,`END`DEC$L`END`PUN(`END`PLNVALMHDR`END`PUN(`END`KWDI`END`PUN))&gt;(`END`PLNVALMWD`END`LIT-1`END`PUN):`END`PLN$`END`DEC$EXTRACT`END`PLN^VALM4`END`PUN(`END`DEC$G`END`PUN(`END`PLNVALMHDR`END`PUN(`END`KWDI`END`PUN))),`END`LIT1`END`PUN:`END`PLNVALMHDR`END`PUN(`END`KWDI`END`PUN))`END`PLN `END`COM; -- prt hdr`END`PLN\n' +675 ' `END`KWDQ`END'676 ),677 basic_lang: (678 '`LIT200`END`PLN `END`COMREM ----- method teardown`END`PLN\n' +679 '`END`LIT210`END`PLN `END`KWDPRINT`END`PLN `END`STR"green"`END`PLN\n' +680 '`END`LIT220`END`PLN `END`KWDRETURN`END`PLN\n' +681 '`END`LIT470`END`PLN `END`KWDIF`END`PLN af`END`PUN=`END`LIT0`END`PLN `END`KWDTHEN`END`PLN `END`KWDGOTO`END`PLN `END`LIT520`END`PLN\n' +682 '`END`LIT480`END`PLN `END`KWDFOR`END`PLN j`END`PUN=`END`LIT1`END`PLN `END`KWDTO`END`PLN af\n' +683 '`END`LIT500`END`PLN ac`END`PUN=`END`PLNpf`END`PUN(`END`PLNj`END`PUN)`END`PLN `END`PUN:`END`PLN me$`END`PUN=`END`PLNSTR$`END`PUN(`END`PLNj`END`PUN)+`END`STR". factor"`END`PLN `END`PUN:`END`PLN `END`KWDGOSUB`END`PLN `END`LIT100`END`PLN\n' +684 '`END`LIT510`END`PLN `END`KWDNEXT`END`PLN\n' +685 '`END`LIT530`END`PLN `END`KWDRETURN`END`PLN\n' +686 '`END`LIT1000`END`PLN `END`KWDDATA`END`PLN `END`STR"one"`END`PUN,`END`PLN `END`LIT1`END`PUN,`END`PLN `END`LIT0`END'687 ),688 pascal_lang: (689 '`COM(* some comment here *)`END`PLN\n' +690 '`END`KWDPROCEDURE`END`PLN TestCase`END`PUN.`END`PLNAssertEquals`END`PUN(`END`PLNmsg`END`PUN:`END`PLNString`END`PUN;`END`PLN expect`END`PUN,`END`PLN act`END`PUN:`END`PLNLongint`END`PUN);`END`PLN\n' +691 '`END`KWDVAR`END`PLN ex`END`PUN,`END`PLN ac`END`PUN:`END`PLNString`END`PUN;`END`PLN\n' +692 '`END`KWDBEGIN`END`PLN\n' +693 ' `END`KWDIF`END`PLN expect `END`PUN&lt;&gt;`END`PLN act `END`KWDTHEN`END`PLN\n' +694 ' `END`KWDBEGIN`END`PLN\n' +695 ' Str`END`PUN(`END`PLNexpect`END`PUN,`END`PLN ex`END`PUN);`END`PLN\n' +696 ' Fail`END`PUN(`END`PLNConcat`END`PUN(`END`PLNmsg`END`PUN,`END`STR\' expected \'`END`PUN,`END`PLNex`END`PUN,`END`STR\' but was \'`END`PUN,`END`PLNac`END`PUN));`END`PLN\n' +697 ' `END`KWDEND`END`PUN;`END`PLN\n' +698 '\n' +699 ' factors `END`PUN:=`END`PLN new`END`PUN(`END`PLNArrayListPtr`END`PUN,`END`PLN Init`END`PUN);`END`PLN\n' +700 '\n' +701 ' `END`KWDFOR`END`PLN candidate `END`PUN:=`END`PLN `END`LIT2`END`PLN `END`KWDTO`END`PLN i `END`KWDDO`END`PLN\n' +702 ' `END`KWDBEGIN`END`PLN\n' +703 ' `END`KWDWHILE`END`PLN i `END`KWDMOD`END`PLN candidate `END`PUN=`END`PLN `END`LIT0`END`PLN `END`KWDDO`END`PLN\n' +704 ' `END`KWDBEGIN`END`PLN\n' +705 ' factors`END`PUN^.`END`PLNAdd`END`PUN(`END`PLNcandidate`END`PUN);`END`PLN\n' +706 ' i `END`PUN:=`END`PLN i `END`KWDDIV`END`PLN candidate`END`PUN;`END`PLN\n' +707 ' `END`KWDEND`END`PUN;`END`PLN\n' +708 ' `END`KWDEND`END`PUN;`END`PLN\n' +709 '`END`KWDEND`END`PUN;`END'710 ),711 kotlin: (712 '`KWDpackage`END`PLN test`END`PUN;`END`PLN\n' +713 '\n' +714 '`END`KWDimport`END`PLN kotlin`END`PUN.`END`TYPInt`END`PLN\n' +715 '\n' +716 '`END`COM// Single line comment`END`PLN\n' +717 '`END`COM/*\n' +718 ' * Multiline\n' +719 ' * comment\n' +720 ' */`END`PLN\n' +721 '\n' +722 '`END`KWDtypealias`END`PLN `END`TYPSomeNumber`END`PLN `END`PUN=`END`PLN `END`TYPInt`END`PLN\n' +723 '\n' +724 '`END`KWDval`END`PLN number`END`PUN:`END`PLN `END`TYPLong`END`PLN `END`PUN=`END`PLN `END`LIT1_000L`END`PLN\n' +725 '`END`KWDvar`END`PLN float`END`PUN:`END`PLN `END`TYPFloat`END`PLN `END`PUN=`END`PLN `END`LIT12.34f`END`PLN\n' +726 '`END`LIT0xFF_FF`END`PLN\n' +727 '`END`LIT3.14`END`PLN\n' +728 '\n' +729 '`END`LIT314e-2`END`PLN\n' +730 '`END`LIT0.314e1`END`PLN\n' +731 '\n' +732 '`END`KWDprotected`END`PLN `END`KWDoverride`END`PLN `END`KWDfun`END`PLN ifBoolean`END`PUN(`END`PLNcondition`END`PUN:`END`PLN `END`TYPBoolean`END`PUN?`END`PLN `END`PUN=`END`PLN `END`LITnull`END`PUN)`END' +733 '`PLN `END`PUN{}`END`PLN\n' +734 '\n' +735 '`END`PUN::`END`PLNifBoolean\n' +736 '\n' +737 '`END`KWDconstructor`END`PUN()`END`PLN `END`PUN:`END`PLN `END`KWDsuper`END`PUN()`END`PLN\n' +738 '\n' +739 '`END`STR"\\\"true\\\""`END`PLN\n' +740 '`END`STR\'a\'`END`PLN\n' +741 '\n' +742 '`END`STR"""\n' +743 'aaaaaaaaaaa\n' +744 '"""`END`PLN\n' +745 '\n' +746 '`END`LITloop@`END`PLN `END`KWDfor`END`PUN()`END`PLN\n' +747 '\n' +748 '`END`KWDbreak`END`PLN `END`LIT@loop`END`PLN\n' +749 '\n' +750 '`END`KWDenum class`END`PLN `END`TYP\`true\``END`PLN\n' +751 '\n' +752 '`END`KWDdata class`END`PLN `END`TYPPerson`END`PUN(`END`KWDval`END`PLN name`END`PUN:`END`PLN `END`TYPString`END`PUN)`END`PLN\n' +753 '\n' +754 '`END`KWDenum class`END`PLN `END`TYPSize`END`PLN `END`PUN{`END`PLN\n' +755 ' BIG`END`PUN,`END`PLN MEDIUM`END`PUN,`END`PLN SMALL\n' +756 '`END`PUN}`END`PLN\n' +757 '\n' +758 '`END`KWDclass`END`PLN `END`TYPBall`END`PUN(`END`KWDval`END`PLN color`END`PUN:`END`PLN `END`TYPString`END`PUN,`END`PLN `END`KWDval`END`PLN size`END`PUN:`END`PLN `END`TYPSize`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +759 ' `END`KWDcompanion object`END`PLN `END`PUN{}`END`PLN\n' +760 '\n' +761 ' `END`KWDfun`END`PLN isBig`END`PUN()`END`PLN `END`PUN=`END`PLN size `END`PUN==`END`PLN `END`TYPSize`END`PUN.`END`PLNBIG\n' +762 '\n' +763 ' `END`KWDval`END`PLN isMedium`END`PUN:`END`PLN `END`TYPBoolean`END`PLN\n' +764 ' `END`KWDget`END`PUN()`END`PLN `END`PUN=`END`PLN size `END`PUN==`END`PLN `END`TYPSize`END`PUN.`END`PLNMEDIUM\n' +765 '`END`PUN}`END`PLN\n' +766 '\n' +767 '`END`KWDfun`END`PLN `END`TYPBoolean`END`PUN?.`END`PLNisNull`END`PUN():`END`PLN `END`TYPBoolean`END`PLN `END`PUN=`END`PLN `END`KWDthis`END`PLN `END`PUN==`END`PLN `END`LITnull`END`PLN\n' +768 '\n' +769 '`END`KWDfun`END`PLN `END`TYPBoolean`END`PUN?.`END`PLNgetOrThrow`END`PUN():`END`PLN `END`TYPBoolean`END`PLN `END`PUN=`END`PLN `END`KWDthis`END`PLN `END`PUN?:`END`PLN `END`KWDthrow`END`PLN `END`TYPException`END`PUN()`END'770 ),771 llvm: (772 '`COM; Declare the string constant as a global constant.`END`PLN\n' +773 '@.str `END`PUN=`END`PLN `END`KWDprivate`END`PLN `END`KWDunnamed_addr`END`PLN `END`KWDconstant`END`PLN `END`PUN[`END`LIT13`END`PLN `END`KWDx`END`PLN `END`KWDi8`END`PUN]`END`PLN `END`KWDc`END`STR"hello world\\0A\\00"`END`PLN\n' +774 '\n' +775 '`END`COM; External declaration of the puts function`END`PLN\n' +776 '`END`KWDdeclare`END`PLN `END`KWDi32`END`PLN @puts`END`PUN(`END`KWDi8`END`PUN*`END`PLN `END`KWDnocapture`END`PUN)`END`PLN `END`KWDnounwind`END`PLN\n' +777 '\n' +778 '`END`COM; Definition of main function`END`PLN\n' +779 '`END`KWDdefine`END`PLN `END`KWDi32`END`PLN @main`END`PUN()`END`PLN `END`PUN{`END`PLN `END`COM; i32()*`END`PLN\n' +780 ' `END`COM; Convert [13 x i8]* to i8 *...`END`PLN\n' +781 ' %cast210 `END`PUN=`END`PLN `END`KWDgetelementptr`END`PLN `END`PUN[`END`LIT13`END`PLN `END`KWDx`END`PLN `END`KWDi8`END`PUN]*`END`PLN @.str`END`PUN,`END`PLN `END`KWDi64`END`PLN `END`LIT0`END`PUN,`END`PLN `END`KWDi64`END`PLN `END`LIT0`END`PLN\n' +782 '\n' +783 ' `END`COM; Call puts function to write out the string to stdout.`END`PLN\n' +784 ' `END`KWDcall`END`PLN `END`KWDi32`END`PLN @puts`END`PUN(`END`KWDi8`END`PUN*`END`PLN %cast210`END`PUN)`END`PLN\n' +785 ' `END`KWDret`END`PLN `END`KWDi32`END`PLN `END`LIT0`END`PLN\n' +786 '`END`PUN}`END`PLN\n' +787 '\n' +788 '`END`COM; Named metadata`END`PLN\n' +789 '!1 `END`PUN=`END`PLN `END`KWDmetadata`END`PLN !`END`PUN{`END`KWDi32`END`PLN `END`LIT42`END`PUN}`END`PLN\n' +790 '!foo `END`PUN=`END`PLN !`END`PUN{`END`PLN!1`END`PUN,`END`PLN `END`KWDnull`END`PUN}`END'791 ),792 issue217: (793 '`KWDif`END`PUN(!`END`STR/^https?:\\/\\//`END`PLNi`END`PUN.`END`PLNtest`END`PUN(`END`PLNval`END`PUN)`END`PLN `END`PUN&amp;&amp;`END`PLN foo `END`PUN==`END`PLN `END`STR\'bar\'`END`PUN)`END`PLN `END`PUN{`END`PLN\n' +794 ' val `END`PUN=`END`PLN `END`STR\'http://\'`END`PLN `END`PUN+`END`PLN val`END`PUN;`END`PLN\n' +795 '`END`PUN}`END'796 ),797 matlab: (798 '`COM%%%%%%%%%%%%%%%%%% DATA TYPES %%%%%%%%%%%%%%%%%%`END`PLN\n' +799 '\n' +800 '`END<span class="ident">v`END`PLN `END`PUN=`END`PLN `END`TAG[`END`LIT1`END`PUN,`END`LIT2`END`PUN,`END`LIT3`END`PUN;`END`LIT4`END`PUN,`END`LIT5`END`PUN,`END`LIT6`END`TAG]`END`PUN;`END`PLN\n' +801 '`END<span class="ident">v`END`TAG(`END<span class="ident">v`END`PUN&gt;`END`LIT4`END`TAG)`END`PLN `END`PUN=`END`PLN `END`LIT0`END`PUN;`END`PLN\n' +802 '\n' +803 '`END<span class="ident">s`END`PLN `END`PUN=`END`PLN `END`TYPstruct`END`TAG(`END`STR\'key\'`END`PUN,`END`LIT1`END`PUN,`END`PLN `END`STR\'key2\'`END`PUN,`END`STR\'string\'`END`TAG)`END`PUN;`END`PLN\n' +804 '`END<span class="ident">s.key`END`PLN `END`PUN=`END`PLN `END`LIT2`END`PUN;`END`PLN\n' +805 '\n' +806 '`END<span class="ident">C`END`PLN `END`PUN=`END`PLN `END`TYPcell`END`TAG(`END`LIT1`END`PUN,`END`LIT2`END`TAG)`END`PUN;`END`PLN\n' +807 '`END<span class="ident">C`END`TAG{`END`LIT1`END`PUN,`END`LIT1`END`TAG}`END`PLN `END`PUN=`END`PLN `END`LIT0`END`PUN:`END`LIT9`END`PUN;`END`PLN\n' +808 '\n' +809 '`END`TYPdouble`END`TAG(`END`LIT1`END`TAG)`END`PLN\n' +810 '`END`TYPsingle`END`TAG(`END`LIT1`END`TAG)`END`PLN\n' +811 '`END`TYPuint8`END`TAG(`END`LIT1`END`TAG)`END`PLN\n' +812 '`END`TYPint8`END`TAG(`END`LIT1`END`TAG)`END`PLN\n' +813 '\n' +814 '`END`COM%%%%%%%%%%%%%%%%%% STRINGS &amp; TRANSPOSE %%%%%%%%%%%%%%%%%%`END`PLN\n' +815 '\n' +816 '`END`FUNplot`END`TAG(`END<span class="ident">data`END<span class="transpose">\'`END`TAG)`END`PUN;`END`PLN\n' +817 '`END`FUNlegend`END`TAG(`END<span class="ident">labels`END`TAG)`END`PLN\n' +818 '\n' +819 '`END<span class="ident">str`END`PLN `END`PUN=`END`PLN `END`STR\'asdasd\'`END`PUN;`END`PLN `END`COM% this is a string`END`PLN\n' +820 '`END<span class="ident">str`END`PLN `END`PUN=`END`PLN `END`STR\'asdas\'`END`PUN;`END`PLN\n' +821 '`END<span class="ident">str`END`PLN `END`PUN=`END`PLN `END`STR\'sdasd\'\'sdasd\'`END`PUN;`END`PLN\n' +822 '\n' +823 '`END<span class="ident">str`END`PLN `END`PUN=`END`PLN `END`TAG[`END`STR\'one\'`END`PLN `END`STR\'two\'`END`PLN `END`STR\'three\'`END`TAG]`END`PUN;`END`PLN\n' +824 '`END<span class="ident">str`END`PLN `END`PUN=`END`PLN `END`FUNstrcat`END`TAG(`END`STR\'one\'`END`PUN,`END`PLN `END`STR\'two\'`END`PUN,`END`PLN `END`STR\'three\'`END`TAG)`END`PUN;`END`PLN\n' +825 '\n' +826 '`END`COM% matrix transpose`END`PLN\n' +827 '`END<span class="ident">M`END`PLN `END`PUN=`END`PLN `END`FUNrand`END`TAG(`END`LIT3`END`PUN,`END`LIT3`END`TAG)`END<span class="transpose">\'`END`PUN;`END`PLN\n' +828 '`END<span class="ident">x`END`PLN `END`PUN=`END`PLN `END<span class="ident">M`END`PUN.`END<span class="transpose">\'`END`PUN;`END`PLN\n' +829 '`END<span class="ident">x`END`PLN `END`PUN=`END`PLN `END`TAG[`END`LIT10`END`PLN `END`LIT20`END`PUN;`END`PLN `END`LIT30`END`PUN,`END`PLN `END`LIT40`END`TAG]`END<span class="transpose">\'`END`PUN;`END`PLN\n' +830 '`END`FUNdisp`END`TAG(`END<span class="ident">x`END<span class="transpose">\'`END`TAG)`END`PLN\n' +831 '`END`FUNfprintf`END`TAG(`END`STR\'%d\\n\'`END`PUN,`END`PLN `END<span class="ident">x`END`TAG(`END`PUN:`END`TAG)`END<span class="transpose">\'`END`TAG)`END`PLN `END`COM% with comment`END`PLN\n' +832 '`END`TAG{`END`LIT1`END`PUN,`END`LIT2`END`TAG}`END<span class="transpose">\'`END`PLN `END`COM% another comment`END`PLN\n' +833 '\n' +834 '`END`COM%%%%%%%%%%%%%%%%%% LINE CONTINUATION %%%%%%%%%%%%%%%%%%`END`PLN\n' +835 '\n' +836 '`END`TAG[`END`LIT1`END`PLN `END`LIT20`END`PUN;`END`PLN `END<span class="linecont">...\n' +837 '`END`LIT30`END`PLN `END`LIT4`END`TAG]`END`PLN\n' +838 '\n' +839 '`END`TAG[`END`STR\'gdgsd\'`END<span class="linecont">...\n' +840 '`END`STR\'sdfs\'`END`TAG]`END`PLN\n' +841 '\n' +842 '`END`TAG{`END<span class="linecont">...\n' +843 '`END`STR\'sdasd\'`END`PLN `END`PUN;`END`PLN\n' +844 '`END`STR\'asdsad\'`END`TAG}`END`PLN\n' +845 '\n' +846 '`END`COM%%%%%%%%%%%%%%%%%% SYSTEM COMMANDS %%%%%%%%%%%%%%%%%%`END`PLN\n' +847 '\n' +848 '`END<span class="syscmd">!touch file.txt`END`PLN\n' +849 '\n' +850 '`END`COM%%%%%%%%%%%%%%%%%% COMMAND OUTPUT %%%%%%%%%%%%%%%%%%`END`PLN\n' +851 '\n' +852 '`END<span class="codeoutput">&gt;&gt; `END`LIT1+1`END`PLN\n' +853 '`END<span class="const">ans`END`PLN `END`PUN=`END`PLN\n' +854 ' `END`LIT2`END`PLN\n' +855 '\n' +856 '`END<span class="codeoutput">&gt;&gt; `END`LIT1+1`END`PLN\n' +857 '\n' +858 '`END<span class="const">ans`END`PLN `END`PUN=`END`PLN\n' +859 '\n' +860 ' `END`LIT2`END`PLN\n' +861 '\n' +862 '`END`COM%%%%%%%%%%%%%%%%%% KEYWORDS %%%%%%%%%%%%%%%%%%`END`PLN\n' +863 '\n' +864 '`END`KWDfunction`END`PLN `END<span class="ident">ret`END`PLN `END`PUN=`END`PLN `END<span class="ident">fcn`END`TAG(`END<span class="ident">in`END`TAG)`END`PLN\n' +865 ' `END<span class="ident">ret`END`PLN `END`PUN=`END`PLN `END`FUNsum`END`TAG(`END<span class="ident">in`END`PUN.^`END`LIT2`END`TAG)`END`PUN;`END`PLN\n' +866 '`END`KWDend`END`PLN\n' +867 '\n' +868 '`END`KWDclassdef`END`PLN `END<span class="ident">CC`END`PLN `END`PUN&lt;`END`PLN `END`FUNhandle`END`PLN\n' +869 ' `END<span class="ident">properties`END`PLN `END`TAG(`END<span class="ident">SetAccess`END`PLN `END`PUN=`END`PLN `END<span class="ident">public`END`TAG)`END`PLN\n' +870 ' `END<span class="ident">x`END`PLN `END`PUN=`END`PLN `END`LIT0`END`PUN;`END`PLN\n' +871 ' `END`KWDend`END`PLN\n' +872 ' `END`FUNmethods`END`PLN\n' +873 ' `END`KWDfunction`END`PLN `END<span class="ident">this`END`PLN `END`PUN=`END`PLN `END<span class="ident">CC`END`TAG(`END<span class="const">varargin`END`TAG)`END`PLN\n' +874 ' `END<span class="ident">this.x`END`PLN `END`PUN=`END`PLN `END`LIT9`END`PUN;`END`PLN\n' +875 ' `END`KWDend`END`PLN\n' +876 ' `END`KWDend`END`PLN\n' +877 '`END`KWDend`END`PLN\n' +878 '\n' +879 '`END<span class="ident">x`END`PLN `END`PUN=`END`PLN `END`TAG[]`END`PUN;`END`PLN\n' +880 '`END`KWDparfor`END`PLN `END<span class="ident">i`END`PUN=`END`LIT1`END`PUN:`END`LIT10`END`PLN\n' +881 ' `END<span class="ident">x`END`TAG[`END<span class="ident">i`END`TAG]`END`PLN `END`PUN=`END`PLN `END<span class="ident">i`END`PUN;`END`PLN\n' +882 '`END`KWDend`END`PLN\n' +883 '\n' +884 '`END<span class="const">true`END`PLN `END`PUN~=`END`PLN `END<span class="const">false`END`PLN\n' +885 '\n' +886 '`END`KWDif`END`PLN `END<span class="ident">x`END`PUN==`END`LIT1`END`PLN\n' +887 ' `END<span class="const">true`END`PLN\n' +888 '`END`KWDelseif`END`PLN\n' +889 ' `END<span class="const">false`END`PLN\n' +890 '`END`KWDelse`END`PLN\n' +891 ' `END`KWDreturn`END`PLN\n' +892 '`END`KWDend`END`PLN\n' +893 '\n' +894 '`END`KWDwhile`END`PLN `END<span class="const">true`END`PLN\n' +895 ' `END`KWDcontinue`END`PLN\n' +896 ' `END`KWDbreak`END`PLN\n' +897 '`END`KWDend`END`PLN\n' +898 '\n' +899 '`END`KWDtry`END`PLN\n' +900 ' `END`FUNerror`END`TAG(`END`STR\'aa:aa\'`END`PUN,`END`PLN `END`STR\'asdasd\'`END`TAG)`END`PLN\n' +901 '`END`KWDcatch`END`PLN `END<span class="ident">ME`END`PLN\n' +902 ' `END`FUNwarning`END`TAG(`END<span class="ident">ME`END`TAG)`END`PLN\n' +903 '`END`KWDend`END`PLN\n' +904 '\n' +905 '`END`KWDswitch`END`PLN `END<span class="ident">x`END`PLN\n' +906 ' `END`KWDcase`END`PLN `END`LIT1`END`PLN\n' +907 ' `END`FUNdisp`END`TAG(`END`LIT1`END`TAG)`END`PLN\n' +908 ' `END`KWDotherwise`END`PLN\n' +909 ' `END`LIT0`END`PLN\n' +910 '`END`KWDend`END`PLN\n' +911 '\n' +912 '`END`COM%%%%%%%%%%%%%%%%%% NUM LITERALS %%%%%%%%%%%%%%%%%%`END`PLN\n' +913 '\n' +914 '`END`LIT1`END`PLN\n' +915 '`END`LIT1.`END`PLN\n' +916 '`END`LIT.1`END`PLN\n' +917 '`END`LIT1.0`END`PLN\n' +918 '`END`LIT-1`END`PLN\n' +919 '`END`LIT-1.`END`PLN\n' +920 '`END`LIT-.1`END`PLN\n' +921 '`END`LIT-1.0`END`PLN\n' +922 '`END`LIT+10`END`PLN\n' +923 '`END`LIT+01.`END`PLN\n' +924 '`END`LIT+.1`END`PLN\n' +925 '`END`LIT+1.0`END`PLN\n' +926 '`END`LIT1e1`END`PLN\n' +927 '`END`LIT1e-1`END`PLN\n' +928 '`END`LIT1.e1`END`PLN\n' +929 '`END`LIT1.e-1`END`PLN\n' +930 '`END`LIT1.0e1`END`PLN\n' +931 '`END`LIT1.0e-1`END`PLN\n' +932 '`END`LIT.1e1`END`PLN\n' +933 '`END`LIT.1e-1`END`PLN\n' +934 '`END`LIT-.1e+1`END`PLN\n' +935 '`END`LIT+1.e-1`END`PLN\n' +936 '\n' +937 '`END`LIT1i`END`PLN\n' +938 '`END`LIT.10j`END`PLN\n' +939 '`END`LIT-1.001i`END`PLN\n' +940 '`END`LIT+1e-100j`END`PLN\n' +941 '`END`LIT-.10e-01i`END`PLN\n' +942 '\n' +943 '`END`COM% unary vs binary operators`END`PLN\n' +944 '`END`LIT1+1`END`PLN\n' +945 '`END`LIT1`END`PUN+`END`PLN `END`LIT1`END`PLN\n' +946 '`END`LIT1`END`PLN `END`LIT+1`END`PLN\n' +947 '`END`LIT1`END`PLN `END`PUN+`END`PLN `END`LIT1`END`PLN\n' +948 '`END`LIT+1+1`END`PLN\n' +949 '`END`LIT+1`END`PUN+`END`PLN `END`LIT1`END`PLN\n' +950 '`END`LIT+1`END`PLN `END`LIT+1`END`PLN\n' +951 '`END`LIT+1`END`PLN `END`PUN+`END`PLN `END`LIT1`END`PLN\n' +952 '\n' +953 '`END`COM%%%%%%%%%%%%%%%%%% COMMENTS %%%%%%%%%%%%%%%%%%`END`PLN\n' +954 '\n' +955 '`END`COM% % comment % %`END`PLN\n' +956 ' `END`COM% comment`END`PLN\n' +957 '`END`COM% comment`END`PLN\n' +958 '`END`COM%# comment`END`PLN\n' +959 '`END`COM%% comment`END`PLN\n' +960 '`END`COM%#x = sum(x);`END`PLN\n' +961 '\n' +962 '`END`COM%{\n' +963 'block comment\n' +964 '%}`END`PLN\n' +965 '\n' +966 '`END`COM%{\n' +967 '%}`END`PLN\n' +968 '\n' +969 '`END`COM%{\n' +970 '\n' +971 '%}`END`PLN\n' +972 '\n' +973 '`END`COM%{\n' +974 '1\n' +975 '2\n' +976 '%}`END`PLN\n' +977 '\n' +978 '`END`COM%{\n' +979 '% sdf {}\n' +980 'sdf\n' +981 '%asda{}\n' +982 'sfds\n' +983 '%}`END`PLN\n' +984 '\n' +985 ' `END`COM%{\n' +986 'dsf\n' +987 ' %}`END`PLN\n' +988 '\n' +989 '`END`COM%{%}`END`PLN\n' +990 '\n' +991 '`END`COM%{ zzz=10; %}`END`PLN\n' +992 '\n' +993 '`END`COM%{%x=10;%}`END`PLN\n' +994 '\n' +995 '`END`COM%{ x\n' +996 'a=10;\n' +997 '%}`END`PLN\n' +998 '\n' +999 '`END`COM%{\n' +1000 '%a=10;\n' +1001 '%}`END`PLN `END<span class="ident">x`END`PLN\n' +1002 '\n' +1003 '`END`COM% nested block comments fail`END`PLN\n' +1004 '`END`COM%{\n' +1005 'dfsdf\n' +1006 '%{\n' +1007 'xxx\n' +1008 '%}`END`PLN\n' +1009 '`END<span class="ident">dfsdf`END`PLN\n' +1010 '`END`COM%}`END`PLN\n' +1011 '\n' +1012 '`END`COM% fails here!`END`PLN\n' +1013 '`END`COM%{\n' +1014 'x=10;\n' +1015 '%%{\n' +1016 '%%}`END`PLN\n' +1017 '`END<span class="ident">y`END`PUN=`END`LIT20`END`PUN;`END`PLN\n' +1018 '`END`COM%}`END'1019 ),1020 elixir: ('`KWDdefmodule`END`PLN `END`TYPFoo`END`PUN.`END`TYPBar`END`PLN `END`KWDdo`END`PLN\n' +1021' `END`ATN@moduledoc`END`PLN `END`STR"""\n' +1022' Tests syntax highlighting for Elixir\n' +1023' """`END`PLN\n' +1024'\n' +1025' `END`KWDuse`END`PLN `END`TYPBitwise`END`PLN\n' +1026' `END`KWDrequire`END`PLN `END`TYPLogger`END`PLN\n' +1027' `END`KWDalias`END`PLN `END`ATN__MODULE__`END`PUN,`END`PLN `END`LITas:`END`PLN `END`TYPThis`END`PLN\n' +1028'\n' +1029' `END`ATN@default_token_length`END`PLN `END`LIT10_000`END`PLN\n' +1030'\n' +1031'\n' +1032' `END`ATN@spec`END`PLN token`END`PUN(`END`PLNlength `END`PUN::`END`PLN integer`END`PUN)`END`PLN `END`PUN::`END`PLN `END`TYPString`END`PUN.`END`PLNt\n' +1033'\n' +1034' `END`KWDdef`END`PLN token`END`PUN(`END`PLNlength `END`PUN\\\\`END`PLN `END`ATN@default_token_length`END`PUN),`END`PLN `END`KWDdo`END`PUN:`END`PLN `END`TYPString`END`PUN.`END`PLNduplicate`END`PUN(`END`STR"x"`END`PUN,`END`PLN length`END`PUN)`END`PLN\n' +1035'\n' +1036'\n' +1037' `END`KWDdefp`END`PLN `END`COM_not_exported`END`PUN(),`END`PLN `END`KWDdo`END`PUN:`END`PLN `END`LIT0xFF`END`PLN `END`PUN+`END`PLN `END`LIT0xF_F`END`PLN `END`PUN-`END`PLN `END`LIT0xff`END`PLN\n' +1038'\n' +1039'\n' +1040' `END`KWDdef`END`PLN other`END`PUN(`END`PLNfoo`END`PUN,`END`PLN bar`END`PUN)`END`PLN `END`KWDdo`END`PLN\n' +1041' fun `END`PUN=`END`PLN `END`KWDfn`END`PUN{`END`COM_a`END`PUN,`END`PLN b`END`PUN}`END`PLN `END`PUN-&gt;`END`PLN b `END`PUN+`END`PLN `END`LIT1_3.1_4`END`PLN `END`KWDend`END`PLN\n' +1042' fun`END`PUN.(`END`LIT1.0e+20`END`PUN)`END`PLN\n' +1043' `END`COM_str`END`PLN `END`PUN=`END`PLN `END`STR"string without #{inspect(42)} interpolation"`END`PLN `END`PUN&lt;&gt;`END`PLN `END`STR" some more\n' +1044' with newlines \\\n' +1045' and newlines"`END`PLN\n' +1046' charlist `END`PUN=`END`PLN `END`LIT\'some\\\'chars\n' +1047' with newlines \\\n' +1048' and newlines\'`END`PLN\n' +1049' `END`PUN&lt;&lt;`END`PLNx`END`PUN::`END`PLNutf8`END`PUN,`END`PLN `END`COM_y`END`PUN::`END`PLNsize`END`PUN(`END`LIT8`END`PUN),`END`PLN data`END`PUN::`END`PLNbinary`END`PUN&gt;&gt;`END`PLN `END`PUN=`END`PLN `END`STR"fooo"`END`PLN\n' +1050' ls `END`PUN=`END`PLN `END`PUN[`END`LIT1`END`PLN `END`PUN|`END`PLN `END`PUN[`END`LIT2`END`PUN,`END`PLN `END`LIT3`END`PUN]]`END`PLN\n' +1051' map `END`PUN=`END`PLN `END`PUN%{`END`STR"baz"`END`PLN `END`PUN=&gt;`END`PLN `END`STR"ban"`END`PUN}`END`PLN\n' +1052' map `END`PUN=`END`PLN `END`PUN%{`END`LITfoo:`END`PLN `END`LIT:bar`END`PUN,`END`PLN `END`LIT"yes, this compiles":`END`PLN `END`LIT:"also an atom"`END`PUN}`END`PLN\n' +1053' `END`LIT:erlang`END`PUN.`END`PLNtime`END`PUN()`END`PLN\n' +1054' `END`KWDcase`END`PLN `END`PUN{`END`PLNfoo`END`PUN,`END`PLN bar`END`PUN}`END`PLN `END`KWDdo`END`PLN\n' +1055' `END`PUN{`END`LIT1`END`PUN,`END`PLN `END`LIT2`END`PUN}`END`PLN `END`PUN-&gt;`END`PLN `END`LIT3`END`PLN\n' +1056' `END`COM_something_else`END`PLN `END`PUN-&gt;`END`PLN `END`LIT:error`END`PLN\n' +1057' `END`COM_`END`PLN `END`PUN-&gt;`END`PLN `END`LIT:"this won\'t match"`END`PLN\n' +1058' `END`KWDend`END`PLN\n' +1059' r `END`PUN=`END`PLN `END`LIT2`END`PLN\n' +1060' `END`COM_bitwise_not`END`PLN `END`PUN=`END`PLN `END`PUN~~~`END`PLNr\n' +1061'\n' +1062' `END`ATV~r/foo/iu`END`PLN `END`COM# regex sigils are treated as normal ones`END`PLN\n' +1063' `END`ATV~S|we have "quotes" and \'quotes\' and|`END`PLN `END`PUN&lt;&gt;`END`PLN `END`STR" more string"`END`PLN\n' +1064' `END`ATV~c"custom sigil char \\"is\\" fine too"`END`PLN\n' +1065' `END`ATV~r\'hello\'`END`PLN\n' +1066' `END`ATV~w[hell\\] #o]`END`PLN `END`COM#sigil does not expand to the comment`END`PLN\n' +1067' `END`ATV~w{hello}`END`PLN\n' +1068' `END`ATV~C&lt;hello&gt;`END`PLN\n' +1069' `END`KWDend`END`PLN\n' +1070'\n' +1071'`END`KWDend`END')...

Full Screen

Full Screen

code-coverage-block.js

Source:code-coverage-block.js Github

copy

Full Screen

1// Copyright 2017 the V8 project authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4// Flags: --allow-natives-syntax --no-always-opt --no-stress-flush-bytecode5// Files: test/mjsunit/code-coverage-utils.js6%DebugToggleBlockCoverage(true);7TestCoverage(8"call an IIFE",9`10(function f() {})();11`,12[{"start":0,"end":20,"count":1},{"start":1,"end":16,"count":1}]13);14TestCoverage(15"call locally allocated function",16`let f = () => 1; f();`,17[{"start":0,"end":21,"count":1},{"start":8,"end":15,"count":1}]18);19TestCoverage(20"if statements",21`22function g() {} // 000023function f(x) { // 005024 if (x == 42) { // 010025 if (x == 43) g(); else g(); // 015026 } // 020027 if (x == 42) { g(); } else { g(); } // 025028 if (x == 42) g(); else g(); // 030029 if (false) g(); else g(); // 035030 if (false) g(); // 040031 if (true) g(); else g(); // 045032 if (true) g(); // 050033} // 055034f(42); // 060035f(43); // 065036if (true) { // 070037 const foo = 'bar'; // 075038} else { // 080039 const bar = 'foo'; // 085040} // 090041`,42[{"start":0,"end":949,"count":1},43 {"start":801,"end":901,"count":0},44 {"start":0,"end":15,"count":11},45 {"start":50,"end":551,"count":2},46 {"start":115,"end":203,"count":1},47 {"start":167,"end":171,"count":0},48 {"start":265,"end":287,"count":1},49 {"start":315,"end":329,"count":1},50 {"start":363,"end":367,"count":0},51 {"start":413,"end":417,"count":0},52 {"start":466,"end":476,"count":0}]53);54TestCoverage(55"if statement (early return)",56`57!function() { // 000058 if (true) { // 005059 nop(); // 010060 return; // 015061 nop(); // 020062 } // 025063 nop(); // 030064}() // 035065`,66[{"start":0,"end":399,"count":1},67 {"start":1,"end":351,"count":1},68 {"start":161,"end":350,"count":0}]69);70TestCoverage(71"if statement (no semi-colon)",72`73!function() { // 000074 if (true) nop() // 005075 if (true) nop(); else nop() // 010076 nop(); // 015077}() // 020078`,79[{"start":0,"end":249,"count":1},80 {"start":1,"end":201,"count":1},81 {"start":118,"end":129,"count":0}]82);83TestCoverage(84"for statements",85`86function g() {} // 000087!function() { // 005088 for (var i = 0; i < 12; i++) g(); // 010089 for (var i = 0; i < 12; i++) { // 015090 g(); // 020091 } // 025092 for (var i = 0; false; i++) g(); // 030093 for (var i = 0; true; i++) break; // 035094 for (var i = 0; i < 12; i++) { // 040095 if (i % 3 == 0) g(); else g(); // 045096 } // 050097}(); // 055098`,99[{"start":0,"end":599,"count":1},100 {"start":0,"end":15,"count":36},101 {"start":51,"end":551,"count":1},102 {"start":131,"end":135,"count":12},103 {"start":181,"end":253,"count":12},104 {"start":330,"end":334,"count":0},105 {"start":431,"end":503,"count":12},106 {"start":470,"end":474,"count":4},107 {"start":474,"end":484,"count":8}]108);109TestCoverage(110"for statements pt. 2",111`112function g() {} // 0000113!function() { // 0050114 let j = 0; // 0100115 for (let i = 0; i < 12; i++) g(); // 0150116 for (const i = 0; j < 12; j++) g(); // 0200117 for (j = 0; j < 12; j++) g(); // 0250118 for (;;) break; // 0300119}(); // 0350120`,121[{"start":0,"end":399,"count":1},122 {"start":0,"end":15,"count":36},123 {"start":51,"end":351,"count":1},124 {"start":181,"end":185,"count":12},125 {"start":233,"end":237,"count":12},126 {"start":277,"end":281,"count":12}]127);128TestCoverage(129"for statements (no semicolon)",130`131function g() {} // 0000132!function() { // 0050133 for (let i = 0; i < 12; i++) g() // 0100134 for (let i = 0; i < 12; i++) break // 0150135 for (let i = 0; i < 12; i++) break; g() // 0200136}(); // 0250137`,138[{"start":0,"end":299,"count":1},139 {"start":0,"end":15,"count":13},140 {"start":51,"end":251,"count":1},141 {"start":131,"end":134,"count":12}]142);143TestCoverage(144"for statement (early return)",145`146!function() { // 0000147 for (var i = 0; i < 10; i++) { // 0050148 nop(); // 0100149 continue; // 0150150 nop(); // 0200151 } // 0250152 nop(); // 0300153 for (;;) { // 0350154 nop(); // 0400155 break; // 0450156 nop(); // 0500157 } // 0550158 nop(); // 0600159 for (;;) { // 0650160 nop(); // 0700161 return; // 0750162 nop(); // 0800163 } // 0850164 nop(); // 0900165}() // 0950166`,167[{"start":0,"end":999,"count":1},168 {"start":1,"end":951,"count":1},169 {"start":81,"end":253,"count":10},170 {"start":163,"end":253,"count":0},171 {"start":460,"end":553,"count":0},172 {"start":761,"end":950,"count":0}]173);174TestCoverage(175"for-of and for-in statements",176`177!function() { // 0000178 var i; // 0050179 for (i of [0,1,2,3]) { nop(); } // 0100180 for (let j of [0,1,2,3]) { nop(); } // 0150181 for (i in [0,1,2,3]) { nop(); } // 0200182 for (let j in [0,1,2,3]) { nop(); } // 0250183 var xs = [{a:0, b:1}, {a:1,b:0}]; // 0300184 for (var {a: x, b: y} of xs) { nop(); } // 0350185}(); // 0400186`,187[{"start":0,"end":449,"count":1},188 {"start":1,"end":401,"count":1},189 {"start":123,"end":133,"count":4},190 {"start":177,"end":187,"count":4},191 {"start":223,"end":233,"count":4},192 {"start":277,"end":287,"count":4},193 {"start":381,"end":391,"count":2}]194);195TestCoverage(196"for-await-of statements",197`198!async function() { // 0000199 for await (var x of [0,1,2,3]) { // 0050200 nop(); // 0100201 } // 0150202}(); // 0200203%PerformMicrotaskCheckpoint(); // 0250204`,205[{"start":0,"end":299,"count":1},206 {"start":1,"end":201,"count":1},207 {"start":83,"end":153,"count":4}]208);209TestCoverage(210"while and do-while statements",211`212function g() {} // 0000213!function() { // 0050214 var i; // 0100215 i = 0; while (i < 12) i++; // 0150216 i = 0; while (i < 12) { g(); i++; } // 0200217 i = 0; while (false) g(); // 0250218 i = 0; while (true) break; // 0300219 // 0350220 i = 0; do i++; while (i < 12); // 0400221 i = 0; do { g(); i++; } // 0450222 while (i < 12); // 0500223 i = 0; do { g(); } while (false); // 0550224 i = 0; do { break; } while (true); // 0600225}(); // 0650226`,227[{"start":0,"end":699,"count":1},228 {"start":0,"end":15,"count":25},229 {"start":51,"end":651,"count":1},230 {"start":174,"end":178,"count":12},231 {"start":224,"end":237,"count":12},232 {"start":273,"end":277,"count":0},233 {"start":412,"end":416,"count":12},234 {"start":462,"end":475,"count":12}]235);236TestCoverage(237"while statement (early return)",238`239!function() { // 0000240 let i = 0; // 0050241 while (i < 10) { // 0100242 i++; // 0150243 continue; // 0200244 nop(); // 0250245 } // 0300246 nop(); // 0350247 while (true) { // 0400248 nop(); // 0450249 break; // 0500250 nop(); // 0550251 } // 0600252 nop(); // 0650253 while (true) { // 0700254 nop(); // 0750255 return; // 0800256 nop(); // 0850257 } // 0900258 nop(); // 0950259}() // 1000260`,261[{"start":0,"end":1049,"count":1},262 {"start":1,"end":1001,"count":1},263 {"start":117,"end":303,"count":10},264 {"start":213,"end":303,"count":0},265 {"start":510,"end":603,"count":0},266 {"start":811,"end":1000,"count":0}]267);268TestCoverage(269"do-while statement (early return)",270`271!function() { // 0000272 let i = 0; // 0050273 do { // 0100274 i++; // 0150275 continue; // 0200276 nop(); // 0250277 } while (i < 10); // 0300278 nop(); // 0350279 do { // 0400280 nop(); // 0450281 break; // 0500282 nop(); // 0550283 } while (true); // 0600284 nop(); // 0650285 do { // 0700286 nop(); // 0750287 return; // 0800288 nop(); // 0850289 } while (true); // 0900290 nop(); // 0950291}() // 1000292`,293[{"start":0,"end":1049,"count":1},294 {"start":1,"end":1001,"count":1},295 {"start":105,"end":303,"count":10},296 {"start":213,"end":303,"count":0},297 {"start":510,"end":603,"count":0},298 {"start":811,"end":1000,"count":0}]299);300TestCoverage(301"return statements",302`303!function() { nop(); return; nop(); }(); // 0000304!function() { nop(); return 42; // 0050305 nop(); }(); // 0100306`,307[{"start":0,"end":149,"count":1},308 {"start":1,"end":37,"count":1},309 {"start":28,"end":36,"count":0},310 {"start":51,"end":122,"count":1},311 {"start":81,"end":121,"count":0}]312);313TestCoverage(314"try/catch/finally statements",315`316!function() { // 0000317 try { nop(); } catch (e) { nop(); } // 0050318 try { nop(); } finally { nop(); } // 0100319 try { // 0150320 try { throw 42; } catch (e) { nop(); }// 0200321 } catch (e) { nop(); } // 0250322 try { // 0300323 try { throw 42; } finally { nop(); } // 0350324 } catch (e) { nop(); } // 0400325 try { // 0450326 throw 42; // 0500327 } catch (e) { // 0550328 nop(); // 0600329 } finally { // 0650330 nop(); // 0700331 } // 0750332}(); // 0800333`,334[{"start":0,"end":849,"count":1},335 {"start":1,"end":801,"count":1},336 {"start":67,"end":87,"count":0},337 {"start":221,"end":222,"count":0},338 {"start":254,"end":274,"count":0},339 {"start":371,"end":372,"count":0},340 {"start":403,"end":404,"count":0},341 {"start":553,"end":554,"count":0}]342);343TestCoverage("try/catch/finally statements with early return",344`345!function() { // 0000346 try { throw 42; } catch (e) { return; } // 0050347 nop(); // 0100348}(); // 0150349!function() { // 0200350 try { throw 42; } catch (e) {} // 0250351 finally { return; } // 0300352 nop(); // 0350353}(); // 0400354`,355[{"start":0,"end":449,"count":1},356 {"start":1,"end":151,"count":1},357 {"start":69,"end":70,"count":0},358 {"start":91,"end":150,"count":0},359 {"start":201,"end":401,"count":1},360 {"start":269,"end":270,"count":0},361 {"start":321,"end":400,"count":0}]362);363TestCoverage(364"early return in blocks",365`366!function() { // 0000367 try { throw 42; } catch (e) { return; } // 0050368 nop(); // 0100369}(); // 0150370!function() { // 0200371 try { nop(); } finally { return; } // 0250372 nop(); // 0300373}(); // 0350374!function() { // 0400375 { // 0450376 let x = 42; // 0500377 return () => x; // 0550378 } // 0600379 nop(); // 0650380}(); // 0700381!function() { // 0750382 try { throw 42; } catch (e) { // 0800383 return; // 0850384 nop(); // 0900385 } // 0950386 nop(); // 1000387}(); // 1050388`,389[{"start":0,"end":1099,"count":1},390 {"start":1,"end":151,"count":1},391 {"start":69,"end":70,"count":0},392 {"start":91,"end":150,"count":0},393 {"start":201,"end":351,"count":1},394 {"start":286,"end":350,"count":0},395 {"start":401,"end":701,"count":1},396 {"start":603,"end":700,"count":0},397 {"start":561,"end":568,"count":0},398 {"start":751,"end":1051,"count":1},399 {"start":819,"end":820,"count":0},400 {"start":861,"end":1050,"count":0}]401);402TestCoverage(403"switch statements",404`405!function() { // 0000406 var x = 42; // 0050407 switch (x) { // 0100408 case 41: nop(); break; // 0150409 case 42: nop(); break; // 0200410 default: nop(); break; // 0250411 } // 0300412}(); // 0350413`,414[{"start":0,"end":399,"count":1},415 {"start":1,"end":351,"count":1},416 {"start":154,"end":204,"count":0},417 {"start":226,"end":350,"count":0}]418);419TestCoverage(420"labeled break statements",421`422!function() { // 0000423 var x = 42; // 0050424 l0: switch (x) { // 0100425 case 41: return; // 0150426 case 42: // 0200427 switch (x) { case 42: break l0; } // 0250428 break; // 0300429 } // 0350430 l1: for (;;) { // 0400431 for (;;) break l1; // 0450432 } // 0500433 l2: while (true) { // 0550434 while (true) break l2; // 0600435 } // 0650436 l3: do { // 0700437 do { break l3; } while (true); // 0750438 } while (true); // 0800439 l4: { break l4; } // 0850440 l5: for (;;) for (;;) break l5; // 0900441}(); // 0950442`,443[{"start":0,"end":999,"count":1},444 {"start":1,"end":951,"count":1},445 {"start":152,"end":202,"count":0},446 {"start":285,"end":353,"count":0}]447);448TestCoverage(449"labeled continue statements",450`451!function() { // 0000452 l0: for (var i0 = 0; i0 < 2; i0++) { // 0050453 for (;;) continue l0; // 0100454 } // 0150455 var i1 = 0; // 0200456 l1: while (i1 < 2) { // 0250457 i1++; // 0300458 while (true) continue l1; // 0350459 } // 0400460 var i2 = 0; // 0450461 l2: do { // 0500462 i2++; // 0550463 do { continue l2; } while (true); // 0600464 } while (i2 < 2); // 0650465}(); // 0700466`,467[{"start":0,"end":749,"count":1},468 {"start":1,"end":701,"count":1},469 {"start":87,"end":153,"count":2},470 {"start":271,"end":403,"count":2},471 {"start":509,"end":653,"count":2}]472);473TestCoverage(474"conditional expressions",475`476var TRUE = true; // 0000477var FALSE = false; // 0050478!function() { // 0100479 TRUE ? nop() : nop(); // 0150480 true ? nop() : nop(); // 0200481 false ? nop() : nop(); // 0250482 FALSE ? TRUE ? nop() // 0300483 : nop() // 0350484 : nop(); // 0400485 TRUE ? FALSE ? nop() // 0450486 : nop() // 0500487 : nop(); // 0550488 TRUE ? nop() : FALSE ? nop() // 0600489 : nop(); // 0650490 FALSE ? nop() : TRUE ? nop() // 0700491 : nop(); // 0750492}(); // 0800493`,494[{"start":0,"end":849,"count":1},495 {"start":101,"end":801,"count":1},496 {"start":165,"end":172,"count":0},497 {"start":215,"end":222,"count":0},498 {"start":258,"end":265,"count":0},499 {"start":308,"end":372,"count":0},500 {"start":465,"end":472,"count":0},501 {"start":557,"end":564,"count":0},502 {"start":615,"end":680,"count":0},503 {"start":708,"end":715,"count":0},504 {"start":773,"end":780,"count":0}]505);506TestCoverage(507"yield expressions",508`509const it = function*() { // 0000510 yield nop(); // 0050511 yield nop() ? nop() : nop() // 0100512 return nop(); // 0150513}(); // 0200514it.next(); it.next(); // 0250515`,516[{"start":0,"end":299,"count":1},517 {"start":11,"end":201,"count":1},518 {"start":114,"end":121,"count":0},519 {"start":129,"end":200,"count":0}]520);521TestCoverage(522"yield expressions twice",523`524function* gen() { // 0000525 yield nop(); // 0050526 yield nop() ? nop() : nop() // 0100527 return nop(); // 0150528}; // 0200529{const it = gen(); it.next(); it.next();} // 0250530{const it = gen(); it.next(); it.next();} // 0300531`,532[{"start":0,"end":349,"count":1},533 {"start":0,"end":201,"count":2},534 {"start":114,"end":121,"count":0},535 {"start":129,"end":200,"count":0}]536);537TestCoverage(538"yield expressions (.return and .throw)",539`540const it0 = function*() { // 0000541 yield 1; yield 2; yield 3; // 0050542}(); // 0100543it0.next(); it0.return(); // 0150544try { // 0200545 const it1 = function*() { // 0250546 yield 1; yield 2; yield 3; // 0300547 }(); // 0350548 it1.next(); it1.throw(); // 0400549} catch (e) {} // 0450550`,551[{"start":0,"end":499,"count":1},552 {"start":451,"end":452,"count":0},553 {"start":12,"end":101,"count":1},554 {"start":60,"end":100,"count":0},555 {"start":264,"end":353,"count":1},556 {"start":312,"end":352,"count":0}]557);558TestCoverage("yield expressions (.return and try/catch/finally)",559`560const it = function*() { // 0000561 try { // 0050562 yield 1; yield 2; yield 3; // 0100563 } catch (e) { // 0150564 nop(); // 0200565 } finally { nop(); } // 0250566 yield 4; // 0300567}(); // 0350568it.next(); it.return(); // 0450569`,570[{"start":0,"end":449,"count":1},571 {"start":11,"end":351,"count":1},572 {"start":112,"end":254,"count":0},573 {"start":272,"end":350,"count":0}]574);575TestCoverage("yield expressions (.throw and try/catch/finally)",576`577const it = function*() { // 0000578 try { // 0050579 yield 1; yield 2; yield 3; // 0100580 } catch (e) { // 0150581 nop(); // 0200582 } finally { nop(); } // 0250583 yield 4; // 0300584}(); // 0350585it.next(); it.throw(42); // 0550586`,587[{"start":0,"end":449,"count":1},588 {"start":11,"end":351,"count":1},589 {"start":112,"end":154,"count":0},590 {"start":310,"end":350,"count":0}]591);592TestCoverage(593"yield* expressions",594`595const it = function*() { // 0000596 yield* gen(); // 0050597 yield* nop() ? gen() : gen() // 0100598 return gen(); // 0150599}(); // 0200600it.next(); it.next(); it.next(); // 0250601it.next(); it.next(); it.next(); // 0300602`,603[{"start":0,"end":349,"count":1},604 {"start":11,"end":201,"count":1},605 {"start":115,"end":122,"count":0},606 {"start":130,"end":200,"count":0}]607);608TestCoverage(609"yield* expressions (.return and .throw)",610`611const it0 = function*() { // 0000612 yield* gen(); yield* gen(); yield 3; // 0050613}(); // 0100614it0.next(); it0.return(); // 0150615try { // 0200616 const it1 = function*() { // 0250617 yield* gen(); yield* gen(); yield 3; // 0300618 }(); // 0350619 it1.next(); it1.throw(); // 0400620} catch (e) {} // 0450621`,622[{"start":0,"end":499,"count":1},623 {"start":451,"end":452,"count":0},624 {"start":12,"end":101,"count":1},625 {"start":65,"end":100,"count":0},626 {"start":264,"end":353,"count":1},627 {"start":317,"end":352,"count":0}]628);629TestCoverage(630"await expressions",631`632async function f() { // 0000633 await 42; // 0050634 await 42; // 0100635}; // 0150636f(); // 0200637%PerformMicrotaskCheckpoint(); // 0250638`,639[{"start":0,"end":299,"count":1},640 {"start":0,"end":151,"count":1}]641);642TestCoverage(643"LogicalOrExpression assignment",644`645const a = true || 99 // 0000646function b () { // 0050647 const b = a || 2 // 0100648} // 0150649b() // 0200650b() // 0250651`,652[{"start":0,"end":299,"count":1},653 {"start":15,"end":20,"count":0},654 {"start":50,"end":151,"count":2},655 {"start":114,"end":118,"count":0}]656);657TestCoverage(658"LogicalOrExpression IsTest()",659`660true || false // 0000661const a = 99 // 0050662a || 50 // 0100663const b = false // 0150664if (b || true) {} // 0200665`,666[{"start":0,"end":249,"count":1},667 {"start":5,"end":13,"count":0},668 {"start":102,"end":107,"count":0}]);669TestCoverage(670"LogicalAndExpression assignment",671`672const a = false && 99 // 0000673function b () { // 0050674 const b = a && 2 // 0100675} // 0150676b() // 0200677b() // 0250678const c = true && 50 // 0300679`,680[{"start":0,"end":349,"count":1},681 {"start":16,"end":21,"count":0},682 {"start":50,"end":151,"count":2},683 {"start":114,"end":118,"count":0}]684);685TestCoverage(686"LogicalAndExpression IsTest()",687`688false && true // 0000689const a = 0 // 0050690a && 50 // 0100691const b = true // 0150692if (b && true) {} // 0200693true && true // 0250694`,695[{"start":0,"end":299,"count":1},696 {"start":6,"end":13,"count":0},697 {"start":102,"end":107,"count":0}]);698TestCoverage(699"NaryLogicalOr assignment",700`701const a = true // 0000702const b = false // 0050703const c = false || false || 99 // 0100704const d = false || true || 99 // 0150705const e = true || true || 99 // 0200706const f = b || b || 99 // 0250707const g = b || a || 99 // 0300708const h = a || a || 99 // 0350709const i = a || (b || c) || d // 0400710`,711[{"start":0,"end":449,"count":1},712 {"start":174,"end":179,"count":0},713 {"start":215,"end":222,"count":0},714 {"start":223,"end":228,"count":0},715 {"start":317,"end":322,"count":0},716 {"start":362,"end":366,"count":0},717 {"start":367,"end":372,"count":0},718 {"start":412,"end":423,"count":0},719 {"start":424,"end":428,"count":0}]);720TestCoverage(721"NaryLogicalOr IsTest()",722`723const a = true // 0000724const b = false // 0050725false || false || 99 // 0100726false || true || 99 // 0150727true || true || 99 // 0200728b || b || 99 // 0250729b || a || 99 // 0300730a || a || 99 // 0350731`,732[{"start":0,"end":399,"count":1},733 {"start":164,"end":169,"count":0},734 {"start":205,"end":212,"count":0},735 {"start":213,"end":218,"count":0},736 {"start":307,"end":312,"count":0},737 {"start":352,"end":356,"count":0},738 {"start":357,"end":362,"count":0}]);739TestCoverage(740"NaryLogicalAnd assignment",741`742const a = true // 0000743const b = false // 0050744const c = false && false && 99 // 0100745const d = false && true && 99 // 0150746const e = true && true && 99 // 0200747const f = true && false || true // 0250748const g = true || false && true // 0300749`,750[{"start":0,"end":349,"count":1},751 {"start":116,"end":124,"count":0},752 {"start":125,"end":130,"count":0},753 {"start":166,"end":173,"count":0},754 {"start":174,"end":179,"count":0},755 {"start":315,"end":331,"count":0}756]);757TestCoverage(758"NaryLogicalAnd IsTest()",759`760const a = true // 0000761const b = false // 0050762false && false && 99 // 0100763false && true && 99 // 0150764true && true && 99 // 0200765true && false || true // 0250766true || false && true // 0300767false || false || 99 || 55 // 0350768`,769[{"start":0,"end":399,"count":1},770 {"start":106,"end":114,"count":0},771 {"start":115,"end":120,"count":0},772 {"start":156,"end":163,"count":0},773 {"start":164,"end":169,"count":0},774 {"start":305,"end":321,"count":0},775 {"start":371,"end":376,"count":0}]);776// see regression: https://bugs.chromium.org/p/chromium/issues/detail?id=785778777TestCoverage(778"logical expressions + conditional expressions",779`780const a = true // 0000781const b = 99 // 0050782const c = false // 0100783const d = '' // 0150784const e = a && (b ? 'left' : 'right') // 0200785const f = a || (b ? 'left' : 'right') // 0250786const g = c || d ? 'left' : 'right' // 0300787const h = a && b && (b ? 'left' : 'right')// 0350788const i = d || c || (c ? 'left' : 'right')// 0400789`,790[{"start":0,"end":449,"count":1},791 {"start":227,"end":236,"count":0},792 {"start":262,"end":287,"count":0},793 {"start":317,"end":325,"count":0},794 {"start":382,"end":391,"count":0},795 {"start":423,"end":431,"count":0}796]);797TestCoverage(798"https://crbug.com/827530",799`800Util = {}; // 0000801Util.escape = function UtilEscape(str) { // 0050802 if (!str) { // 0100803 return 'if'; // 0150804 } else { // 0200805 return 'else'; // 0250806 } // 0300807}; // 0350808Util.escape("foo.bar"); // 0400809`,810[{"start":0,"end":449,"count":1},811 {"start":64,"end":351,"count":1},812 {"start":112,"end":203,"count":0}]813);814TestCoverage(815"https://crbug.com/v8/8237",816`817!function() { // 0000818 if (true) // 0050819 while (false) return; else nop(); // 0100820}(); // 0150821!function() { // 0200822 if (true) l0: { break l0; } else // 0250823 if (nop()) { } // 0300824}(); // 0350825!function() { // 0400826 if (true) { if (false) { return; } // 0450827 } else if (nop()) { } }(); // 0500828!function(){ // 0550829 if(true)while(false)return;else nop() // 0600830}(); // 0650831!function(){ // 0700832 if(true) l0:{break l0}else if (nop()){} // 0750833}(); // 0800834!function(){ // 0850835 if(true){if(false){return}}else // 0900836 if(nop()){} // 0950837}(); // 1000838`,839[{"start":0,"end":1049,"count":1},840 {"start":1,"end":151,"count":1},841 {"start":118,"end":137,"count":0},842 {"start":201,"end":351,"count":1},843 {"start":279,"end":318,"count":0},844 {"start":401,"end":525,"count":1},845 {"start":475,"end":486,"count":0},846 {"start":503,"end":523,"count":0},847 {"start":551,"end":651,"count":1},848 {"start":622,"end":639,"count":0},849 {"start":701,"end":801,"count":1},850 {"start":774,"end":791,"count":0},851 {"start":851,"end":1001,"count":1},852 {"start":920,"end":928,"count":0},853 {"start":929,"end":965,"count":0}]854);855TestCoverage(856"terminal break statement",857`858while (true) { // 0000859 const b = false // 0050860 break // 0100861} // 0150862let stop = false // 0200863while (true) { // 0250864 if (stop) { // 0300865 break // 0350866 } // 0400867 stop = true // 0450868} // 0500869`,870[{"start":0,"end":549,"count":1},871 {"start":263,"end":501,"count":2},872 {"start":312,"end":501,"count":1}]873);874TestCoverage(875"terminal return statement",876`877function a () { // 0000878 const b = false // 0050879 return 1 // 0100880} // 0150881const b = (early) => { // 0200882 if (early) { // 0250883 return 2 // 0300884 } // 0350885 return 3 // 0400886} // 0450887const c = () => { // 0500888 if (true) { // 0550889 return // 0600890 } // 0650891} // 0700892a(); b(false); b(true); c() // 0750893`,894[{"start":0,"end":799,"count":1},895 {"start":0,"end":151,"count":1},896 {"start":210,"end":451,"count":2},897 {"start":263,"end":450,"count":1},898 {"start":510,"end":701,"count":1}]899);900TestCoverage(901"terminal blocks",902`903function a () { // 0000904 { // 0050905 return 'a' // 0100906 } // 0150907} // 0200908function b () { // 0250909 { // 0300910 { // 0350911 return 'b' // 0400912 } // 0450913 } // 0500914} // 0550915a(); b() // 0600916`,917[{"start":0,"end":649,"count":1},918 {"start":0,"end":201,"count":1},919 {"start":250,"end":551,"count":1}]920);921TestCoverage(922"terminal if statements",923`924function a (branch) { // 0000925 if (branch) { // 0050926 return 'a' // 0100927 } else { // 0150928 return 'b' // 0200929 } // 0250930} // 0300931function b (branch) { // 0350932 if (branch) { // 0400933 if (branch) { // 0450934 return 'c' // 0500935 } // 0550936 } // 0600937} // 0650938function c (branch) { // 0700939 if (branch) { // 0750940 return 'c' // 0800941 } else { // 0850942 return 'd' // 0900943 } // 0950944} // 1000945function d (branch) { // 1050946 if (branch) { // 1100947 if (!branch) { // 1150948 return 'e' // 1200949 } else { // 1250950 return 'f' // 1300951 } // 1350952 } else { // 1400953 // noop // 1450954 } // 1500955} // 1550956a(true); a(false); b(true); b(false) // 1600957c(true); d(true); // 1650958`,959[{"start":0,"end":1699,"count":1},960 {"start":0,"end":301,"count":2},961 {"start":64,"end":253,"count":1},962 {"start":350,"end":651,"count":2},963 {"start":414,"end":603,"count":1},964 {"start":700,"end":1001,"count":1},965 {"start":853,"end":953,"count":0},966 {"start":1050,"end":1551,"count":1},967 {"start":1167,"end":1255,"count":0},968 {"start":1403,"end":1503,"count":0}]969);970TestCoverage(971"https://crbug.com/927464",972`973!function f() { // 0000974 function unused() { nop(); } // 0050975 nop(); // 0100976}(); // 0150977`,978[{"start":0,"end":199,"count":1},979 {"start":1,"end":151,"count":1},980 {"start":52,"end":80,"count":0}]981);982TestCoverage(983"https://crbug.com/v8/8691",984`985function f(shouldThrow) { // 0000986 if (shouldThrow) { // 0050987 throw Error('threw') // 0100988 } // 0150989} // 0200990try { // 0250991 f(true) // 0300992} catch (err) { // 0350993 // 0400994} // 0450995try { // 0500996 f(false) // 0550997} catch (err) {} // 0600998`,999[{"start":0,"end":649,"count":1},1000 {"start":351,"end":352,"count":0},1001 {"start":602,"end":616,"count":0},1002 {"start":0,"end":201,"count":2},1003 {"start":69,"end":153,"count":1}]1004);...

Full Screen

Full Screen

Pie3DPart.js

Source:Pie3DPart.js Github

copy

Full Screen

1/**2 * @class Ext.chart.series.sprite.Pie3DPart3 * @extends Ext.draw.sprite.Path4 * 5 * Pie3D series sprite.6 */7Ext.define('Ext.chart.series.sprite.Pie3DPart', {8 extend: 'Ext.draw.sprite.Path',9 mixins: {10 markerHolder: 'Ext.chart.MarkerHolder'11 },12 alias: 'sprite.pie3dPart',13 type: 'pie3dPart',14 inheritableStatics: {15 def: {16 processors: {17 /**18 * @cfg {Number} [centerX=0] The central point of the series on the x-axis.19 */20 centerX: 'number',21 /**22 * @cfg {Number} [centerY=0] The central point of the series on the x-axis.23 */24 centerY: 'number',25 /**26 * @cfg {Number} [startAngle=0] The starting angle of the polar series.27 */28 startAngle: 'number',29 /**30 * @cfg {Number} [endAngle=Math.PI] The ending angle of the polar series.31 */32 endAngle: 'number',33 /**34 * @cfg {Number} [startRho=0] The starting radius of the polar series.35 */36 startRho: 'number',37 /**38 * @cfg {Number} [endRho=150] The ending radius of the polar series.39 */40 endRho: 'number',41 /**42 * @cfg {Number} [margin=0] Margin from the center of the pie. Used for donut.43 */44 margin: 'number',45 /**46 * @cfg {Number} [thickness=0] The thickness of the 3D pie part.47 */48 thickness: 'number',49 /**50 * @cfg {Number} [distortion=0] The distortion of the 3D pie part.51 */52 distortion: 'number',53 /**54 * @cfg {Object} [baseColor='white'] The color of the 3D pie part before adding the 3D effect.55 */56 baseColor: 'color',57 /**58 * @cfg {Number} [baseRotation=0] The starting rotation of the polar series.59 */60 baseRotation: 'number',61 /**62 * @cfg {String} [part='top'] The part of the 3D Pie represented by the sprite.63 */64 part: 'enums(top,start,end,inner,outer)'65 },66 aliases: {67 rho: 'endRho'68 },69 triggers: {70 centerX: 'path,bbox',71 centerY: 'path,bbox',72 startAngle: 'path,partZIndex',73 endAngle: 'path,partZIndex',74 startRho: 'path',75 endRho: 'path,bbox',76 margin: 'path,bbox',77 thickness: 'path',78 baseRotation: 'path,partZIndex,partColor',79 baseColor: 'partZIndex,partColor',80 part: 'path,partZIndex'81 },82 defaults: {83 centerX: 0,84 centerY: 0,85 startAngle: 0,86 endAngle: 0,87 startRho: 0,88 endRho: 150,89 margin: 0,90 distortion: 1,91 baseRotation: 0,92 baseColor: 'white',93 part: 'top'94 },95 updaters: {96 partColor: function (attr) {97 var color = Ext.draw.Color.fly(attr.baseColor),98 fillStyle;99 switch (attr.part) {100 case 'top':101 fillStyle = color.toString();102 break;103 case 'outer':104 fillStyle = Ext.create('Ext.draw.gradient.Linear', {105 type: 'linear',106 stops: [107 {108 offset: 0,109 color: color.createDarker(0.3).toString()110 },111 {112 offset: 0.3,113 color: color.toString()114 },115 {116 offset: 0.8,117 color: color.createLighter(0.2).toString()118 },119 {120 offset: 1,121 color: color.createDarker(0.4).toString()122 }123 ]124 });125 break;126 case 'start':127 fillStyle = color.createDarker(0.3).toString();128 break;129 case 'end':130 fillStyle = color.createDarker(0.3).toString();131 break;132 case 'inner':133 fillStyle = Ext.create('Ext.draw.gradient.Linear', {134 type: 'linear',135 stops: [136 {137 offset: 0,138 color: color.createDarker(0.4).toString()139 },140 {141 offset: 0.2,142 color: color.createLighter(0.2).toString()143 },144 {145 offset: 0.7,146 color: color.toString()147 },148 {149 offset: 1,150 color: color.createDarker(0.3).toString()151 }152 ]153 });154 break;155 }156 attr.fillStyle = fillStyle;157 attr.canvasAttributes.fillStyle = fillStyle;158 //console.groupCollapsed('partColor:', attr.part);159 //console.trace();160 //console.groupEnd();161 },162 partZIndex: function (attr) {163 var rotation = attr.baseRotation;164 switch (attr.part) {165 case 'top':166 attr.zIndex = 5;167 break;168 case 'outer':169 attr.zIndex = 4;170 break;171 case 'start':172 attr.zIndex = 1 + Math.sin(attr.startAngle + rotation);173 break;174 case 'end':175 attr.zIndex = 1 + Math.sin(attr.endAngle + rotation);176 break;177 case 'inner':178 attr.zIndex = 1;179 break;180 }181 attr.dirtyZIndex = true;182 }183 }184 }185 },186 updatePlainBBox: function (plain) {187 var attr = this.attr,188 rho = attr.part === 'inner' ? attr.startRho : attr.endRho;189 plain.width = rho * 2;190 plain.height = rho * attr.distortion * 2 + attr.thickness;191 plain.x = attr.centerX - rho;192 plain.y = attr.centerY - rho * attr.distortion;193 },194 195 updateTransformedBBox: function (transform) {196 return this.updatePlainBBox(transform);197 },198 199 updatePath: function (path) {200 if (this.attr.endAngle < this.attr.startAngle) {201 return;202 }203 this[this.attr.part + 'Renderer'](path);204 },205 topRenderer: function (path) {206 var attr = this.attr,207 margin = attr.margin,208 distortion = attr.distortion,209 centerX = attr.centerX,210 centerY = attr.centerY,211 baseRotation = attr.baseRotation,212 startAngle = attr.startAngle + baseRotation,213 endAngle = attr.endAngle + baseRotation,214 midAngle = (startAngle + endAngle) * 0.5,215 startRho = attr.startRho,216 endRho = attr.endRho,217 sinEnd = Math.sin(endAngle),218 cosEnd = Math.cos(endAngle);219 centerX += Math.cos(midAngle) * margin;220 centerY += Math.sin(midAngle) * margin * distortion;221 path.ellipse(centerX, centerY, startRho, startRho * distortion, 0, startAngle, endAngle, false);222 path.lineTo(centerX + cosEnd * endRho, centerY + sinEnd * endRho * distortion);223 path.ellipse(centerX, centerY, endRho, endRho * distortion, 0, endAngle, startAngle, true);224 path.closePath();225 },226 startRenderer: function (path) {227 var attr = this.attr,228 margin = attr.margin,229 centerX = attr.centerX,230 centerY = attr.centerY,231 distortion = attr.distortion,232 baseRotation = attr.baseRotation,233 startAngle = attr.startAngle + baseRotation ,234 endAngle = attr.endAngle + baseRotation,235 thickness = attr.thickness,236 startRho = attr.startRho,237 endRho = attr.endRho,238 sinStart = Math.sin(startAngle),239 cosStart = Math.cos(startAngle),240 midAngle;241 if (cosStart < 0) {242 midAngle = (startAngle + endAngle) * 0.5;243 centerX += Math.cos(midAngle) * margin;244 centerY += Math.sin(midAngle) * margin * distortion;245 path.moveTo(centerX + cosStart * startRho, centerY + sinStart * startRho * distortion);246 path.lineTo(centerX + cosStart * endRho, centerY + sinStart * endRho * distortion);247 path.lineTo(centerX + cosStart * endRho, centerY + sinStart * endRho * distortion + thickness);248 path.lineTo(centerX + cosStart * startRho, centerY + sinStart * startRho * distortion + thickness);249 path.closePath();250 }251 },252 endRenderer: function (path) {253 var attr = this.attr,254 margin = attr.margin,255 centerX = attr.centerX,256 centerY = attr.centerY,257 distortion = attr.distortion,258 baseRotation = attr.baseRotation,259 startAngle = attr.startAngle + baseRotation ,260 endAngle = attr.endAngle + baseRotation,261 thickness = attr.thickness,262 startRho = attr.startRho,263 endRho = attr.endRho,264 sin = Math.sin(endAngle),265 cos = Math.cos(endAngle),266 midAngle;267 if (cos > 0) {268 midAngle = (startAngle + endAngle) * 0.5;269 centerX += Math.cos(midAngle) * margin;270 centerY += Math.sin(midAngle) * margin * distortion;271 path.moveTo(centerX + cos * startRho, centerY + sin * startRho * distortion);272 path.lineTo(centerX + cos * endRho, centerY + sin * endRho * distortion);273 path.lineTo(centerX + cos * endRho, centerY + sin * endRho * distortion + thickness);274 path.lineTo(centerX + cos * startRho, centerY + sin * startRho * distortion + thickness);275 path.closePath();276 }277 },278 innerRenderer: function (path) {279 var attr = this.attr,280 margin = attr.margin,281 centerX = attr.centerX,282 centerY = attr.centerY,283 distortion = attr.distortion,284 baseRotation = attr.baseRotation,285 startAngle = attr.startAngle + baseRotation ,286 endAngle = attr.endAngle + baseRotation,287 midAngle = (startAngle + endAngle) * 0.5,288 thickness = attr.thickness,289 startRho = attr.startRho,290 isTranslucent = attr.globalAlpha < 1,291 sinEnd, cosEnd,292 tempStart, tempEnd;293 centerX += Math.cos(midAngle) * margin;294 centerY += Math.sin(midAngle) * margin * distortion;295 if (startAngle >= Math.PI * 2 || isTranslucent) {296 startAngle -= Math.PI * 2;297 endAngle -= Math.PI * 2;298 }299 if (endAngle > Math.PI && endAngle < Math.PI * 3 || isTranslucent) {300 tempStart = startAngle;301 tempEnd = Math.min(endAngle, Math.PI * 2);302 sinEnd = Math.sin(tempEnd);303 cosEnd = Math.cos(tempEnd);304 path.ellipse(centerX, centerY, startRho, startRho * distortion, 0, tempStart, tempEnd, false);305 path.lineTo(centerX + cosEnd * startRho, centerY + sinEnd * startRho * distortion + thickness);306 path.ellipse(centerX, centerY + thickness, startRho, startRho * distortion, 0, tempEnd, tempStart, true);307 path.closePath();308 }309 if (endAngle > Math.PI * 3) {310 tempStart = Math.PI;311 tempEnd = endAngle;312 sinEnd = Math.sin(tempEnd);313 cosEnd = Math.cos(tempEnd);314 path.ellipse(centerX, centerY, startRho, startRho * distortion, 0, tempStart, tempEnd, false);315 path.lineTo(centerX + cosEnd * startRho, centerY + sinEnd * startRho * distortion + thickness);316 path.ellipse(centerX, centerY + thickness, startRho, startRho * distortion, 0, tempEnd, tempStart, true);317 path.closePath();318 }319 },320 outerRenderer: function (path) {321 var attr = this.attr,322 margin = attr.margin,323 centerX = attr.centerX,324 centerY = attr.centerY,325 distortion = attr.distortion,326 baseRotation = attr.baseRotation,327 startAngle = attr.startAngle + baseRotation ,328 endAngle = attr.endAngle + baseRotation,329 midAngle = (startAngle + endAngle) * 0.5,330 thickness = attr.thickness,331 endRho = attr.endRho,332 isTranslucent = attr.globalAlpha < 1,333 sinEnd, cosEnd,334 tempStart, tempEnd;335 centerX += Math.cos(midAngle) * margin;336 centerY += Math.sin(midAngle) * margin * distortion;337 if (startAngle >= Math.PI * 2 || isTranslucent) {338 startAngle -= Math.PI * 4;339 endAngle -= Math.PI * 4;340 }341 if (startAngle < Math.PI || isTranslucent) {342 tempStart = startAngle;343 tempEnd = Math.min(endAngle, Math.PI);344 sinEnd = Math.sin(tempEnd);345 cosEnd = Math.cos(tempEnd);346 path.ellipse(centerX, centerY, endRho, endRho * distortion, 0, tempStart, tempEnd, false);347 path.lineTo(centerX + cosEnd * endRho, centerY + sinEnd * endRho * distortion + thickness);348 path.ellipse(centerX, centerY + thickness, endRho, endRho * distortion, 0, tempEnd, tempStart, true);349 path.closePath();350 }351 if (endAngle > Math.PI * 2) {352 tempStart = Math.max(startAngle, Math.PI * 2);353 tempEnd = endAngle;354 sinEnd = Math.sin(tempEnd);355 cosEnd = Math.cos(tempEnd);356 path.ellipse(centerX, centerY, endRho, endRho * distortion, 0, tempStart, tempEnd, false);357 path.lineTo(centerX + cosEnd * endRho, centerY + sinEnd * endRho * distortion + thickness);358 path.ellipse(centerX, centerY + thickness, endRho, endRho * distortion, 0, tempEnd, tempStart, true);359 path.closePath();360 }361 }...

Full Screen

Full Screen

js.js

Source:js.js Github

copy

Full Screen

1var chess=document.getElementById('chess');2var context=chess.getContext('2d');3var i;4var superBlock=-1;5var block=[];6var startD=[],endD=[];7for(var i=1;i<=10;i++){8 block[i]=[];9 for(j=1;j<=10;j++){10 block[i][j]=0;11 }12}13window.onload=function(){14 drawchessbox();15 clickXY();16}17//¼üÅÌʼþ18document.onkeydown=function(event){19 var e = event || window.event || arguments.callee.caller.arguments[0];20 if(e && e.keyCode==65){ // °´ A21 mvRobot();22 mvSuper(1,0);23 }24 if(e && e.keyCode==68){ // °´ D25 mvRobot();26 mvSuper(-1,0);27 }28 if(e && e.keyCode==83){ // S ¼ü29 mvRobot();30 mvSuper(0,-1);31 }32 if(e && e.keyCode==87){ // W ¼ü33 mvRobot();34 mvSuper(0,1);35 }36};37function mvRobot(){38 for(var i=1;i<=10;i++){39 for(var j=1;j<=10;j++){40 if(block[i][j]==3){41 robot(i,j);42 }43 }44 }45}46function robot(i,j){47 if(i<=startD[1]&&j<=endD[1]){48 if(block[i][j]==2){49 drawBlock(i+1,j,"red");50 drawBlock(i,j,"white");51 block[i+1][j]=3;52 block[i][j]=0;53 }else{54 drawBlock(i,j+1,"red");55 drawBlock(i,j,"white");56 block[i][j+1]=3;57 block[i][j]=0;58 }59 }else if(i>startD[1]&&j<=endD[1]){60 if(block[i][j]==2){61 drawBlock(i,j+1,"red");62 drawBlock(i,j,"white");63 block[i][j+1]=3;64 block[i][j]=0;65 }else{66 drawBlock(i-1,j,"red");67 drawBlock(i,j,"white");68 block[i-1][j]=3;69 block[i][j]=0;70 }71 }else if(i>startD[1]&&j>endD[1]){72 if(block[i][j]==2){73 drawBlock(i-1,j,"red");74 drawBlock(i,j,"white");75 block[i-1][j]=3;76 block[i][j]=0;77 }else{78 drawBlock(i,j-1,"red");79 drawBlock(i,j,"white");80 block[i][j-1]=3;81 block[i][j]=0;82 }83 }else if(i<=startD[1]&&j>endD[1]){84 if(block[i][j]==2){85 drawBlock(i,j-1,"red");86 drawBlock(i,j,"white");87 block[i][j-1]=3;88 block[i][j]=0;89 }else{90 drawBlock(i+1,j,"red");91 drawBlock(i,j,"white");92 block[i+1][j]=3;93 block[i][j]=0;94 }95 }96}97//Òƶ¯»úÆ÷ÈË98//function mvRobot(){99// for(var i=1;i<10;i++){100// for(var j=1;j<10;j++){101// if(block[i][j]==3){102// if(i<=startD[1]){103// if(j<=endD[1]){104// if(block[i][j+1]==2){105// drawBlock(i+1,j,"red");106// drawBlock(i,j,"white");107// block[i+1][j]=3;108// block[i][j]=0;109// }else {110// if(j-endD[1]>=i-startD[1]){111// drawBlock(i,j+1,"red");112// drawBlock(i,j,"white");113// block[i][j+1]=3;114// block[i][j]=0;115// }else if(j-endD[1]<i-startD[1]){116// drawBlock(i+1,j,"red");117// drawBlock(i,j,"white");118// block[i+1][j]=3;119// block[i][j]=0;120// }121// }122// }else{123// if(block[i][j+1]==2){124// drawBlock(i-1,j,"red");125// drawBlock(i,j,"white");126// block[i-1][j]=3;127// block[i][j]=0;128// }else{129// if(j-endD[1]>=i-startD[1]){130// drawBlock(i,j-1,"red");131// drawBlock(i,j,"white");132// block[i][j-1]=3;133// block[i][j]=0;134// }else if(j-endD[1]<i-startD[1]){135// drawBlock(i-1,j,"red");136// drawBlock(i,j,"white");137// block[i-1][j]=3;138// block[i][j]=0;139// }140// }141// }142// }else{143// if(j<=endD[1]){144// if(block[i][j+1]==2){145// drawBlock(i-1,j,"red");146// drawBlock(i,j,"white");147// block[i-1][j]=3;148// block[i][j]=0;149// }else{150// if(j-endD[1]>=i-startD[1]){151// drawBlock(i,j+1,"red");152// drawBlock(i,j,"white");153// block[i][j+1]=3;154// block[i][j]=0;155// }else if(j-endD[1]<i-startD[1]){156// drawBlock(i+1,j,"red");157// drawBlock(i,j,"white");158// block[i+1][j]=3;159// block[i][j]=0;160// }161// }162// }else{163// if(block[i][j+1]==2){164// drawBlock(i+1,j,"red");165// drawBlock(i,j,"white");166// block[i+1][j]=3;167// block[i][j]=0;168// }else{169// if(j-endD[1]>=i-startD[1]){170// drawBlock(i,j-1,"red");171// drawBlock(i,j,"white");172// block[i][j-1]=3;173// block[i][j]=0;174// }else if(j-endD[1]<i-startD[1]){175// drawBlock(i-1,j,"red");176// drawBlock(i,j,"white");177// block[i-1][j]=3;178// block[i][j]=0;179// }180// }181// }182// }183// }184// }185// }186//}187//Òƶ¯hero188function mvSuper(pX,pY){189 if(block[startD[1]-pX][endD[1]-pY]==0){//-1 0190 startD[1] -= pX;191 endD[1]-=pY;192 if(superBlock==-1){193 drawBlock(startD[1],endD[1],"green");194 }else if(superBlock<3){195 drawBlock(startD[1],endD[1],"#6BF65E");196 superBlock+=1;197 if(superBlock==2){198 superBlock=-1;199 }200 }201 drawBlock(startD[1]+pX,endD[1]+pY,"white");//+1 0202 block[startD[1]][endD[1]]=-1;203 block[startD[1]+pX][endD[1]+pY]=0;//+1 0204 }else if(block[startD[1]-pX][endD[1]-pY]==2){//-1 0205 alert("no");206 }else if(block[startD[1]-pX][endD[1]-pY]==1){207 startD[1] -= pX;208 endD[1]-=pY;209 drawBlock(startD[1],endD[1],"#6BF65E");210 drawBlock(startD[1]+pX,endD[1]+pY,"white");211 block[startD[1]][endD[1]]=-1;212 block[startD[1]+pX][endD[1]+pY]=0;213 superBlock=0;214 }else if(block[startD[1]-pX][endD[1]-pY]==3){215 if(superBlock==-1) {216 alert("failed");217 } else if(superBlock!=-1){218 startD[1] -= pX;219 endD[1]-=pY;220 drawBlock(startD[1],endD[1],"#6BF65E");221 drawBlock(startD[1]+pX,endD[1]+pY,"white");222 block[startD[1]][endD[1]]=-1;223 block[startD[1]+1][endD[1]]=0;224 superBlock++;225 }226 }227 var robot=0;228 var suptool=0;229 for(var i=1;i<=10;i++){230 for(var j=1;j<=10;j++){231 if(block[i][j]==3){232 robot++;233 }234 if(block[i][j]==1){235 suptool++;236 }237 }238 }239 if(robot==0){240 alert("win");241 }else if(robot!=0 || (robot!=0&&suptool==0)){242 if(superBlock==-1) alert("failed");243 else{244 return;245 }246 }247}248//²úÉúhero robot super as....249function clickXY(){250 i=1;251 var x,y;252 chess.onclick=function(e){253 x= e.offsetX;254 y= e.offsetY;255 startD[i]= Math.floor(x / 30);256 endD [i]= Math.floor(y / 30);257 if(startD[i]<1 || startD[i]>10 || endD[i]<1 || endD[i]>10) return;258 if(i==1){259 drawBlock(startD[i],endD[i],"green");260 block[startD[i]][endD[i]]=-1;261 //console.log(startD[i],endD[i]);262 i++;263 }else if(i>1){264 if(block[startD[i]][endD[i]]==0){265 var str=window.prompt("1,0,2","");266 if(str==0){267 drawBlock(startD[i],endD[i],"red");268 block[startD[i]][endD[i]]=3;269 i++;270 }else if(str==1){271 drawBlock(startD[i],endD[i],"blue");272 block[startD[i]][endD[i]]=1;273 i++;274 }else if(str==2){275 drawBlock(startD[i],endD[i],"#F6C462");276 block[startD[i]][endD[i]]=2;277 i++;278 }279 }else alert("repeat");280 }281 else return;282 }283}284//»­±í¸ñ285var drawchessbox=function(){286 for(var i=0;i<11;i++)287 {288 context.moveTo(30+i*30,30);289 context.lineTo(30+i*30,360-30);290 context.stroke();291 context.moveTo(30,30+i*30);292 context.lineTo(360-30,30+i*30);293 context.stroke();294 }295}296//»­·½¿é297function drawBlock(startD,endD,color) {298 if(startD>0&&startD<11&&endD>0&&endD<11){299 context.strokeStyle = "block";300 context.fillStyle = color;301 context.fillRect(startD*30,endD*30,30,30);302 context.strokeRect(startD*30,endD*30,30,30);303 }304}305//if(block[startD[1]-1][endD[1]]==0){306// startD[1] -= 1;307// if(superBlock==-1){308// drawBlock(startD[1],endD[1],"green");309// }else if(superBlock<3){310// drawBlock(startD[1],endD[1],"#6BF65E");311// superBlock+=1;312// if(superBlock==2){313// superBlock=-1;314// }315// }316// drawBlock(startD[1]+1,endD[1],"white");317// block[startD[1]][endD[1]]=-1;318// block[startD[1]+1][endD[1]]=0;319//}else if(block[startD[1]-1][endD[1]]==2){320// alert("no");321//}else if(block[startD[1]-1][endD[1]]==1){322// startD[1] -= 1;323// drawBlock(startD[1],endD[1],"#6BF65E");324// drawBlock(startD[1]+1,endD[1],"white");325// block[startD[1]][endD[1]]=-1;326// block[startD[1]+1][endD[1]]=0;327// superBlock=0;328//}else if(block[startD[1]-1][endD[1]]==3){329// if(superBlock==-1) {330// alert("failed");331// } else if(superBlock!=-1){332// startD[1] -= 1;333// drawBlock(startD[1],endD[1],"#6BF65E");334// drawBlock(startD[1]+1,endD[1],"white");335// block[startD[1]][endD[1]]=-1;336// block[startD[1]+1][endD[1]]=0;337// superBlock++;338// }339//}340//startD[1] += 1;341//drawBlock(startD[1],endD[1],"green");342//drawBlock(startD[1]-1,endD[1],"white");343//endD[1] += 1;344//drawBlock(startD[1],endD[1],"green");345//drawBlock(startD[1],endD[1]-1,"white");346//endD[1] -= 1;347//drawBlock(startD[1],endD[1],"green");348//drawBlock(startD[1],endD[1]+1,"white");349//if(i<=startD[1]){350// if(j<=endD[1]){351// if(block[i][j+1]!=2){352// drawBlock(i,j+1,"red");353// drawBlock(i,j-1,"white");354// block[i][j+1]=3;355// block[i][j]=0;356// }else{357// drawBlock(i+1,j,"red");358// drawBlock(i-1,j,"white");359// block[i+1][j]=3;360// block[i][j]=0;361// }362// }else{363// if(block[i][j-1]!=2){364// drawBlock(i,j-1,"red");365// drawBlock(i,j+1,"white");366// block[i][j-1]=3;367// block[i][j]=0;368// }else{369// drawBlock(i-1,j,"red");370// drawBlock(i+1,j,"white");371// block[i-1][j]=3;372// block[i][j]=0;373// }374// }375//}376//if(i>startD[1]){377// if(j<=endD[1]){378// if(block[i][j-1]!=2){379// drawBlock(i,j-1,"red");380// drawBlock(i,j+1,"white");381// block[i][j-1]=3;382// block[i][j]=0;383// }else{384// drawBlock(i-1,j,"red");385// drawBlock(i+1,j,"white");386// block[i-1][j]=3;387// block[i][j]=0;388// }389// }else{390// if(block[i][j+1]!=2){391// drawBlock(i,j+1,"red");392// drawBlock(i,j-1,"white");393// block[i][j+1]=3;394// block[i][j]=0;395// }else{396// drawBlock(i+1,j,"red");397// drawBlock(i-1,j,"white");398// block[i+1][j]=3;399// block[i][j]=0;400// }401// }...

Full Screen

Full Screen

topojson.js

Source:topojson.js Github

copy

Full Screen

1topojson = (function() {2 function merge(topology, arcs) {3 var arcsByEnd = {},4 fragmentByStart = {},5 fragmentByEnd = {};6 arcs.forEach(function(i) {7 var e = ends(i);8 (arcsByEnd[e[0]] || (arcsByEnd[e[0]] = [])).push(i);9 (arcsByEnd[e[1]] || (arcsByEnd[e[1]] = [])).push(~i);10 });11 arcs.forEach(function(i) {12 var e = ends(i),13 start = e[0],14 end = e[1],15 f, g;16 if (f = fragmentByEnd[start]) {17 delete fragmentByEnd[f.end];18 f.push(i);19 f.end = end;20 if (g = fragmentByStart[end]) {21 delete fragmentByStart[g.start];22 var fg = g === f ? f : f.concat(g);23 fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;24 } else if (g = fragmentByEnd[end]) {25 delete fragmentByStart[g.start];26 delete fragmentByEnd[g.end];27 var fg = f.concat(g.map(function(i) { return ~i; }).reverse());28 fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.start] = fg;29 } else {30 fragmentByStart[f.start] = fragmentByEnd[f.end] = f;31 }32 } else if (f = fragmentByStart[end]) {33 delete fragmentByStart[f.start];34 f.unshift(i);35 f.start = start;36 if (g = fragmentByEnd[start]) {37 delete fragmentByEnd[g.end];38 var gf = g === f ? f : g.concat(f);39 fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;40 } else if (g = fragmentByStart[start]) {41 delete fragmentByStart[g.start];42 delete fragmentByEnd[g.end];43 var gf = g.map(function(i) { return ~i; }).reverse().concat(f);44 fragmentByStart[gf.start = g.end] = fragmentByEnd[gf.end = f.end] = gf;45 } else {46 fragmentByStart[f.start] = fragmentByEnd[f.end] = f;47 }48 } else if (f = fragmentByStart[start]) {49 delete fragmentByStart[f.start];50 f.unshift(~i);51 f.start = end;52 if (g = fragmentByEnd[end]) {53 delete fragmentByEnd[g.end];54 var gf = g === f ? f : g.concat(f);55 fragmentByStart[gf.start = g.start] = fragmentByEnd[gf.end = f.end] = gf;56 } else if (g = fragmentByStart[end]) {57 delete fragmentByStart[g.start];58 delete fragmentByEnd[g.end];59 var gf = g.map(function(i) { return ~i; }).reverse().concat(f);60 fragmentByStart[gf.start = g.end] = fragmentByEnd[gf.end = f.end] = gf;61 } else {62 fragmentByStart[f.start] = fragmentByEnd[f.end] = f;63 }64 } else if (f = fragmentByEnd[end]) {65 delete fragmentByEnd[f.end];66 f.push(~i);67 f.end = start;68 if (g = fragmentByEnd[start]) {69 delete fragmentByStart[g.start];70 var fg = g === f ? f : f.concat(g);71 fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.end] = fg;72 } else if (g = fragmentByStart[start]) {73 delete fragmentByStart[g.start];74 delete fragmentByEnd[g.end];75 var fg = f.concat(g.map(function(i) { return ~i; }).reverse());76 fragmentByStart[fg.start = f.start] = fragmentByEnd[fg.end = g.start] = fg;77 } else {78 fragmentByStart[f.start] = fragmentByEnd[f.end] = f;79 }80 } else {81 f = [i];82 fragmentByStart[f.start = start] = fragmentByEnd[f.end = end] = f;83 }84 });85 function ends(i) {86 var arc = topology.arcs[i], p0 = arc[0], p1 = [0, 0];87 arc.forEach(function(dp) { p1[0] += dp[0], p1[1] += dp[1]; });88 return [p0, p1];89 }90 var fragments = [];91 for (var k in fragmentByEnd) fragments.push(fragmentByEnd[k]);92 return fragments;93 }94 function mesh(topology, o, filter) {95 var arcs = [];96 if (arguments.length > 1) {97 var geomsByArc = [],98 geom;99 function arc(i) {100 if (i < 0) i = ~i;101 (geomsByArc[i] || (geomsByArc[i] = [])).push(geom);102 }103 function line(arcs) {104 arcs.forEach(arc);105 }106 function polygon(arcs) {107 arcs.forEach(line);108 }109 function geometry(o) {110 if (o.type === "GeometryCollection") o.geometries.forEach(geometry);111 else if (o.type in geometryType) {112 geom = o;113 geometryType[o.type](o.arcs);114 }115 }116 var geometryType = {117 LineString: line,118 MultiLineString: polygon,119 Polygon: polygon,120 MultiPolygon: function(arcs) { arcs.forEach(polygon); }121 };122 geometry(o);123 geomsByArc.forEach(arguments.length < 3124 ? function(geoms, i) { arcs.push(i); }125 : function(geoms, i) { if (filter(geoms[0], geoms[geoms.length - 1])) arcs.push(i); });126 } else {127 for (var i = 0, n = topology.arcs.length; i < n; ++i) arcs.push(i);128 }129 return object(topology, {type: "MultiLineString", arcs: merge(topology, arcs)});130 }131 function featureOrCollection(topology, o) {132 return o.type === "GeometryCollection" ? {133 type: "FeatureCollection",134 features: o.geometries.map(function(o) { return feature(topology, o); })135 } : feature(topology, o);136 }137 function feature(topology, o) {138 var f = {139 type: "Feature",140 id: o.id,141 properties: o.properties || {},142 geometry: object(topology, o)143 };144 if (o.id == null) delete f.id;145 return f;146 }147 function object(topology, o) {148 var tf = topology.transform,149 kx = tf.scale[0],150 ky = tf.scale[1],151 dx = tf.translate[0],152 dy = tf.translate[1],153 arcs = topology.arcs;154 function arc(i, points) {155 if (points.length) points.pop();156 for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length, x = 0, y = 0, p; k < n; ++k) points.push([157 (x += (p = a[k])[0]) * kx + dx,158 (y += p[1]) * ky + dy159 ]);160 if (i < 0) reverse(points, n);161 }162 function point(coordinates) {163 return [coordinates[0] * kx + dx, coordinates[1] * ky + dy];164 }165 function line(arcs) {166 var points = [];167 for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);168 if (points.length < 2) points.push(points[0]);169 return points;170 }171 function ring(arcs) {172 var points = line(arcs);173 while (points.length < 4) points.push(points[0]);174 return points;175 }176 function polygon(arcs) {177 return arcs.map(ring);178 }179 function geometry(o) {180 var t = o.type;181 return t === "GeometryCollection" ? {type: t, geometries: o.geometries.map(geometry)}182 : t in geometryType ? {type: t, coordinates: geometryType[t](o)}183 : null;184 }185 var geometryType = {186 Point: function(o) { return point(o.coordinates); },187 MultiPoint: function(o) { return o.coordinates.map(point); },188 LineString: function(o) { return line(o.arcs); },189 MultiLineString: function(o) { return o.arcs.map(line); },190 Polygon: function(o) { return polygon(o.arcs); },191 MultiPolygon: function(o) { return o.arcs.map(polygon); }192 };193 return geometry(o);194 }195 function reverse(array, n) {196 var t, j = array.length, i = j - n; while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;197 }198 function bisect(a, x) {199 var lo = 0, hi = a.length;200 while (lo < hi) {201 var mid = lo + hi >>> 1;202 if (a[mid] < x) lo = mid + 1;203 else hi = mid;204 }205 return lo;206 }207 function neighbors(objects) {208 var objectsByArc = [],209 neighbors = objects.map(function() { return []; });210 function line(arcs, i) {211 arcs.forEach(function(a) {212 if (a < 0) a = ~a;213 var o = objectsByArc[a] || (objectsByArc[a] = []);214 if (!o[i]) o.forEach(function(j) {215 var n, k;216 k = bisect(n = neighbors[i], j); if (n[k] !== j) n.splice(k, 0, j);217 k = bisect(n = neighbors[j], i); if (n[k] !== i) n.splice(k, 0, i);218 }), o[i] = i;219 });220 }221 function polygon(arcs, i) {222 arcs.forEach(function(arc) { line(arc, i); });223 }224 function geometry(o, i) {225 if (o.type === "GeometryCollection") o.geometries.forEach(function(o) { geometry(o, i); });226 else if (o.type in geometryType) geometryType[o.type](o.arcs, i);227 }228 var geometryType = {229 LineString: line,230 MultiLineString: polygon,231 Polygon: polygon,232 MultiPolygon: function(arcs, i) { arcs.forEach(function(arc) { polygon(arc, i); }); }233 };234 objects.forEach(geometry);235 return neighbors;236 }237 return {238 version: "1.1.3",239 mesh: mesh,240 feature: featureOrCollection,241 neighbors: neighbors242 };...

Full Screen

Full Screen

plugin.js

Source:plugin.js Github

copy

Full Screen

1/**2 * plugin.js3 *4 * Copyright 2011, Moxiecode Systems AB5 * Released under LGPL License.6 *7 * License: http://www.tinymce.com/license8 * Contributing: http://www.tinymce.com/contributing9 */10/*global tinymce:true */11tinymce.PluginManager.add('autolink', function(editor) {12 var AutoUrlDetectState;13 editor.on("keydown", function(e) {14 if (e.keyCode == 13) {15 return handleEnter(editor);16 }17 });18 // Internet Explorer has built-in automatic linking for most cases19 if (tinymce.Env.ie) {20 editor.on("focus", function() {21 if (!AutoUrlDetectState) {22 AutoUrlDetectState = true;23 try {24 editor.execCommand('AutoUrlDetect', false, true);25 } catch (ex) {26 // Ignore27 }28 }29 });30 return;31 }32 editor.on("keypress", function(e) {33 if (e.keyCode == 41) {34 return handleEclipse(editor);35 }36 });37 editor.on("keyup", function(e) {38 if (e.keyCode == 32) {39 return handleSpacebar(editor);40 }41 });42 function handleEclipse(editor) {43 parseCurrentLine(editor, -1, '(', true);44 }45 function handleSpacebar(editor) {46 parseCurrentLine(editor, 0, '', true);47 }48 function handleEnter(editor) {49 parseCurrentLine(editor, -1, '', false);50 }51 function parseCurrentLine(editor, end_offset, delimiter) {52 var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText;53 function scopeIndex(container, index) {54 if (index < 0) {55 index = 0;56 }57 if (container.nodeType == 3) {58 var len = container.data.length;59 if (index > len) {60 index = len;61 }62 }63 return index;64 }65 function setStart(container, offset) {66 if (container.nodeType != 1 || container.hasChildNodes()) {67 rng.setStart(container, scopeIndex(container, offset));68 } else {69 rng.setStartBefore(container);70 }71 }72 function setEnd(container, offset) {73 if (container.nodeType != 1 || container.hasChildNodes()) {74 rng.setEnd(container, scopeIndex(container, offset));75 } else {76 rng.setEndAfter(container);77 }78 }79 // We need at least five characters to form a URL,80 // hence, at minimum, five characters from the beginning of the line.81 rng = editor.selection.getRng(true).cloneRange();82 if (rng.startOffset < 5) {83 // During testing, the caret is placed inbetween two text nodes.84 // The previous text node contains the URL.85 prev = rng.endContainer.previousSibling;86 if (!prev) {87 if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) {88 return;89 }90 prev = rng.endContainer.firstChild.nextSibling;91 }92 len = prev.length;93 setStart(prev, len);94 setEnd(prev, len);95 if (rng.endOffset < 5) {96 return;97 }98 end = rng.endOffset;99 endContainer = prev;100 } else {101 endContainer = rng.endContainer;102 // Get a text node103 if (endContainer.nodeType != 3 && endContainer.firstChild) {104 while (endContainer.nodeType != 3 && endContainer.firstChild) {105 endContainer = endContainer.firstChild;106 }107 // Move range to text node108 if (endContainer.nodeType == 3) {109 setStart(endContainer, 0);110 setEnd(endContainer, endContainer.nodeValue.length);111 }112 }113 if (rng.endOffset == 1) {114 end = 2;115 } else {116 end = rng.endOffset - 1 - end_offset;117 }118 }119 start = end;120 do {121 // Move the selection one character backwards.122 setStart(endContainer, end >= 2 ? end - 2 : 0);123 setEnd(endContainer, end >= 1 ? end - 1 : 0);124 end -= 1;125 rngText = rng.toString();126 // Loop until one of the following is found: a blank space, &nbsp;, delimiter, (end-2) >= 0127 } while (rngText != ' ' && rngText !== '' && rngText.charCodeAt(0) != 160 && (end - 2) >= 0 && rngText != delimiter);128 if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) {129 setStart(endContainer, end);130 setEnd(endContainer, start);131 end += 1;132 } else if (rng.startOffset === 0) {133 setStart(endContainer, 0);134 setEnd(endContainer, start);135 } else {136 setStart(endContainer, end);137 setEnd(endContainer, start);138 }139 // Exclude last . from word like "www.site.com."140 text = rng.toString();141 if (text.charAt(text.length - 1) == '.') {142 setEnd(endContainer, start - 1);143 }144 text = rng.toString();145 matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i);146 if (matches) {147 if (matches[1] == 'www.') {148 matches[1] = 'http://www.';149 } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {150 matches[1] = 'mailto:' + matches[1];151 }152 bookmark = editor.selection.getBookmark();153 editor.selection.setRng(rng);154 editor.execCommand('createlink', false, matches[1] + matches[2]);155 editor.selection.moveToBookmark(bookmark);156 editor.nodeChanged();157 }158 }...

Full Screen

Full Screen

behavior-time-typeahead.js

Source:behavior-time-typeahead.js Github

copy

Full Screen

1/**2 * @provides javelin-behavior-time-typeahead3 * @requires javelin-behavior4 * javelin-util5 * javelin-dom6 * javelin-stratcom7 * javelin-vector8 * javelin-typeahead-static-source9 */10JX.behavior('time-typeahead', function(config) {11 var start_date_control = JX.$(config.startTimeID);12 var end_date_control = config.endTimeID ? JX.$(config.endTimeID) : null;13 var format = config.format;14 var end_date_tampered = false;15 var datasource = new JX.TypeaheadStaticSource(config.timeValues);16 datasource.setTransformer(function(v) {17 var attributes = {'className' : 'phui-time-typeahead-value'};18 var display = JX.$N('div', attributes, v[1]);19 var object = {20 'id' : v[0],21 'name' : v[1],22 'display' : display,23 'uri' : null24 };25 return object;26 });27 datasource.setSortHandler(function(value, list) {28 list.sort(function(u,v){29 return (u.id > v.id) ? 1 : -1;30 });31 });32 datasource.setMaximumResultCount(24);33 var typeahead = new JX.Typeahead(34 start_date_control,35 JX.DOM.find(start_date_control, 'input', null));36 typeahead.setDatasource(datasource);37 if (!end_date_control) {38 typeahead.start();39 return;40 }41 var start_time_control = JX.DOM.find(42 start_date_control,43 'input',44 'time-input');45 var end_time_control = JX.DOM.find(46 end_date_control,47 'input',48 'time-input');49 JX.DOM.listen(start_time_control, 'input', null, function() {50 if (end_date_tampered) {51 return;52 }53 var time = start_time_control.value;54 var end_value = getNewValue(time);55 if (end_value) {56 end_time_control.value = end_value;57 }58 });59 typeahead.listen('choose', function(e) {60 if (end_date_tampered) {61 return;62 }63 var time = e.name;64 var end_value = getNewValue(time);65 if (end_value) {66 end_time_control.value = end_value;67 }68 });69 JX.DOM.listen(end_date_control, 'input', null, function() {70 end_date_tampered = true;71 });72 function getNewValue(time) {73 var regex = /^([0-2]?\d)(?::([0-5]\d))?\s*((am|pm))?$/i;74 if (!regex.test(time)) {75 return null;76 }77 var results = regex.exec(time);78 var hours = parseInt(results[1], 10);79 var minutes = parseInt(results[2], 10) ? parseInt(results[2], 10) : 0;80 var real_time = 0;81 var end_value = '';82 var end_hours;83 var end_minutes;84 if (format === 'H:i' && hours < 23) {85 end_hours = hours + 1;86 if (end_hours > 9) {87 end_hours = end_hours.toString();88 } else {89 end_hours = '0' + end_hours.toString();90 }91 if (minutes > 9) {92 end_minutes = minutes.toString();93 } else {94 end_minutes = '0' + minutes.toString();95 }96 end_value = end_hours + ':' + end_minutes;97 } else if (format === 'g:i A') {98 if (/pm/i.test(results[3])) {99 real_time = 12*60;100 } else if (/am/i.test(results[3]) && hours == 12) {101 hours = 0;102 }103 real_time = real_time + (hours * 60) + minutes;104 var end_time = real_time + 60;105 var end_meridian = 'AM';106 end_hours = Math.floor(end_time / 60);107 if (end_hours == 12) {108 end_meridian = 'PM';109 } else if (end_hours > 12 && end_hours < 24) {110 end_hours = end_hours - 12;111 end_meridian = 'PM';112 } else if (end_hours == 24) {113 end_hours = end_hours - 12;114 }115 end_minutes = end_time%60;116 if (end_minutes < 9) {117 end_minutes = '0' + end_minutes;118 }119 end_value = end_hours + ':' + end_minutes + ' ' + end_meridian;120 }121 return end_value;122 }123 typeahead.start();...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.runTest('www.google.com', function(err, data) {4 if (err) {5 console.log(err);6 } else {7 wpt.getTestResults(data.data.testId, function(err, data) {8 console.log(data);9 });10 }11});12var wpt = require('webpagetest');13var wpt = new WebPageTest('www.webpagetest.org');14wpt.runTest('www.google.com', function(err, data) {15 if (err) {16 console.log(err);17 } else {18 wpt.getTestResults(data.data.testId, function(err, data) {19 console.log(data);20 });21 }22});23{ statusCode: 200,24 {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3}, function(err, data) {4 if (err) return console.error(err);5 console.log(data);6 wpt.getTestStatus(data.data.testId, function(err, data) {7 console.log(data);8 wpt.getTestResults(data.data.testId, function(err, data) {9 console.log(data);10 });11 });12});13{ statusCode: 400,14 data: 'Test not found' }

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 wpt.endTest(data.data.testId, function(err, data) {4 console.log(data);5 });6});7{ statusCode: 200,8 data: { statusCode: 200, statusText: 'Ok' } }9{ statusCode: 200,10 data: { statusCode: 200, statusText: 'Ok' } }11{ statusCode: 200,12 data: { statusCode: 200, statusText: 'Ok' } }13{ statusCode: 200,14 data: { statusCode: 200, statusText: 'Ok' } }15{ statusCode: 200,16 data: { statusCode: 200, statusText: 'Ok' } }17{ statusCode: 200,18 data: { statusCode: 200, statusText: 'Ok' } }19{ statusCode: 200,20 data: { statusCode: 200, statusText: 'Ok' } }21{ statusCode: 200,22 data: { statusCode: 200, statusText: 'Ok' } }23{ statusCode: 200,24 data: { statusCode: 200, statusText: 'Ok' } }25{ statusCode: 200,26 data: { statusCode: 200, statusText: 'Ok' } }27{ statusCode: 200,28 data: { statusCode: 200, statusText: 'Ok' } }

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt.end(function(err, data) {2 if (err) return console.log(err);3 console.log(data);4});5wpt.end(function(err, data) {6 if (err) return console.log(err);7 console.log(data);8});9wpt.end(function(err, data) {10 if (err) return console.log(err);11 console.log(data);12});13wpt.end(function(err, data) {14 if (err) return console.log(err);15 console.log(data);16});17wpt.end(function(err, data) {18 if (err) return console.log(err);19 console.log(data);20});21wpt.end(function(err, data) {22 if (err) return console.log(err);23 console.log(data);24});25wpt.end(function(err, data) {26 if (err) return console.log(err);27 console.log(data);28});29wpt.end(function(err, data) {30 if (err) return console.log(err);31 console.log(data);32});33wpt.end(function(err, data) {34 if (err) return console.log(err);35 console.log(data);36});37wpt.end(function(err, data) {38 if (err) return console.log(err);39 console.log(data);40});41wpt.end(function(err, data) {42 if (err) return console.log(err);43 console.log(data);44});45wpt.end(function(err, data) {46 if (err) return console.log(err);47 console.log(data);48});

Full Screen

Using AI Code Generation

copy

Full Screen

1const wpt = require('webpagetest');2const webPageTest = new wpt('www.webpagetest.org');3const testId = '190319_0J_4f7a4d4b4e4a3a3a3a3a3a3a3a3a3a3a';4webPageTest.endTest(testId, (err, data) => {5 if (err) {6 console.log(err);7 } else {8 console.log(data);9 }10});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful