From 0d2ed3f1e0a80d20182bea8b530c7dfd3ad01696 Mon Sep 17 00:00:00 2001 From: Dmitry Prokashev Date: Sat, 28 May 2016 21:59:28 +0200 Subject: refactored for minification --- microlight.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/microlight.js b/microlight.js index 9ea99bc..010b6a1 100644 --- a/microlight.js +++ b/microlight.js @@ -1,6 +1,6 @@ /** * @fileoverview microlight - syntax highlightning library - * @version 0.0.1 + * @version 0.0.2 * * @license MIT, see http://github.com/asvd/microlight * @copyright 2016 asvd @@ -120,13 +120,13 @@ ).setAttribute('style', [ // 0: not formatted '', - // 1: punctuation + // 1: keywords + textShadow + _0px_0px+9+pxColor + alpha * .7 + '),' + + _0px_0px+2+pxColor + alpha * .4 + brace, + // 2: punctuation opacity + 6 + textShadow + _0px_0px+7+pxColor + alpha / 4 + '),' + _0px_0px+3+pxColor + alpha / 4 + brace, - // 2: keywords - textShadow + _0px_0px+9+pxColor + alpha * .7 + '),' + - _0px_0px+2+pxColor + alpha * .4 + brace, // 3: strings and regexps opacity + 7 + textShadow + _3px_0px_5+pxColor + alpha / 5 + '),-' + @@ -140,14 +140,14 @@ // not formatted !tokenType ? 0 : // punctuation - tokenType < 3 ? 1 : + tokenType < 3 ? 2 : // comments tokenType > 6 ? 4 : // regex and strings tokenType > 3 ? 3 : // otherwise tokenType == 3, (key)word - // (2 if regexp matches, 0 otherwise) - 2 * /^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/[test](token) + // (1 if regexp matches, 0 otherwise) + + /^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/[test](token) ]); node[appendChild](_document.createTextNode(token)); -- cgit v1.2.3