98920d57f8f2947d209dd6494cc3ce35.js 140 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193
  1. ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var lang = require("../lib/lang");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  6. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  7. var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
  8. var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
  9. var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
  10. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
  11. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  12. var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
  13. var CssHighlightRules = function () {
  14. var keywordMapper = this.createKeywordMapper({
  15. "support.function": supportFunction,
  16. "support.constant": supportConstant,
  17. "support.type": supportType,
  18. "support.constant.color": supportConstantColor,
  19. "support.constant.fonts": supportConstantFonts
  20. }, "text", true);
  21. this.$rules = {
  22. "start": [{
  23. include: ["strings", "url", "comments"]
  24. }, {
  25. token: "paren.lparen",
  26. regex: "\\{",
  27. next: "ruleset"
  28. }, {
  29. token: "paren.rparen",
  30. regex: "\\}"
  31. }, {
  32. token: "string",
  33. regex: "@(?!viewport)",
  34. next: "media"
  35. }, {
  36. token: "keyword",
  37. regex: "#[a-z0-9-_]+"
  38. }, {
  39. token: "keyword",
  40. regex: "%"
  41. }, {
  42. token: "variable",
  43. regex: "\\.[a-z0-9-_]+"
  44. }, {
  45. token: "string",
  46. regex: ":[a-z0-9-_]+"
  47. }, {
  48. token: "constant.numeric",
  49. regex: numRe
  50. }, {
  51. token: "constant",
  52. regex: "[a-z0-9-_]+"
  53. }, {
  54. caseInsensitive: true
  55. }],
  56. "media": [{
  57. include: ["strings", "url", "comments"]
  58. }, {
  59. token: "paren.lparen",
  60. regex: "\\{",
  61. next: "start"
  62. }, {
  63. token: "paren.rparen",
  64. regex: "\\}",
  65. next: "start"
  66. }, {
  67. token: "string",
  68. regex: ";",
  69. next: "start"
  70. }, {
  71. token: "keyword",
  72. regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
  73. + "|page|font|keyframes|viewport|counter-style|font-feature-values"
  74. + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
  75. }],
  76. "comments": [{
  77. token: "comment",
  78. regex: "\\/\\*",
  79. push: [{
  80. token: "comment",
  81. regex: "\\*\\/",
  82. next: "pop"
  83. }, {
  84. defaultToken: "comment"
  85. }]
  86. }],
  87. "ruleset": [{
  88. regex: "-(webkit|ms|moz|o)-",
  89. token: "text"
  90. }, {
  91. token: "punctuation.operator",
  92. regex: "[:;]"
  93. }, {
  94. token: "paren.rparen",
  95. regex: "\\}",
  96. next: "start"
  97. }, {
  98. include: ["strings", "url", "comments"]
  99. }, {
  100. token: ["constant.numeric", "keyword"],
  101. regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
  102. }, {
  103. token: "constant.numeric",
  104. regex: numRe
  105. }, {
  106. token: "constant.numeric",
  107. regex: "#[a-f0-9]{6}"
  108. }, {
  109. token: "constant.numeric",
  110. regex: "#[a-f0-9]{3}"
  111. }, {
  112. token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  113. regex: pseudoElements
  114. }, {
  115. token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  116. regex: pseudoClasses
  117. }, {
  118. include: "url"
  119. }, {
  120. token: keywordMapper,
  121. regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  122. }, {
  123. caseInsensitive: true
  124. }],
  125. url: [{
  126. token: "support.function",
  127. regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
  128. push: [{
  129. token: "support.function",
  130. regex: "\\)",
  131. next: "pop"
  132. }, {
  133. defaultToken: "string"
  134. }]
  135. }],
  136. strings: [{
  137. token: "string.start",
  138. regex: "'",
  139. push: [{
  140. token: "string.end",
  141. regex: "'|$",
  142. next: "pop"
  143. }, {
  144. include: "escapes"
  145. }, {
  146. token: "constant.language.escape",
  147. regex: /\\$/,
  148. consumeLineEnd: true
  149. }, {
  150. defaultToken: "string"
  151. }]
  152. }, {
  153. token: "string.start",
  154. regex: '"',
  155. push: [{
  156. token: "string.end",
  157. regex: '"|$',
  158. next: "pop"
  159. }, {
  160. include: "escapes"
  161. }, {
  162. token: "constant.language.escape",
  163. regex: /\\$/,
  164. consumeLineEnd: true
  165. }, {
  166. defaultToken: "string"
  167. }]
  168. }],
  169. escapes: [{
  170. token: "constant.language.escape",
  171. regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
  172. }]
  173. };
  174. this.normalizeRules();
  175. };
  176. oop.inherits(CssHighlightRules, TextHighlightRules);
  177. exports.CssHighlightRules = CssHighlightRules;
  178. });
  179. ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  180. var oop = require("../lib/oop");
  181. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  182. var DocCommentHighlightRules = function () {
  183. this.$rules = {
  184. "start": [{
  185. token: "comment.doc.tag",
  186. regex: "@[\\w\\d_]+" // TODO: fix email addresses
  187. },
  188. DocCommentHighlightRules.getTagRule(),
  189. {
  190. defaultToken: "comment.doc",
  191. caseInsensitive: true
  192. }]
  193. };
  194. };
  195. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  196. DocCommentHighlightRules.getTagRule = function (start) {
  197. return {
  198. token: "comment.doc.tag.storage.type",
  199. regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  200. };
  201. };
  202. DocCommentHighlightRules.getStartRule = function (start) {
  203. return {
  204. token: "comment.doc",
  205. regex: "\\/\\*(?=\\*)",
  206. next: start
  207. };
  208. };
  209. DocCommentHighlightRules.getEndRule = function (start) {
  210. return {
  211. token: "comment.doc",
  212. regex: "\\*\\/",
  213. next: start
  214. };
  215. };
  216. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  217. });
  218. ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  219. var oop = require("../lib/oop");
  220. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  221. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  222. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  223. var JavaScriptHighlightRules = function (options) {
  224. var keywordMapper = this.createKeywordMapper({
  225. "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  226. "Namespace|QName|XML|XMLList|" + // E4X
  227. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  228. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  229. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  230. "SyntaxError|TypeError|URIError|" +
  231. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  232. "isNaN|parseFloat|parseInt|" +
  233. "JSON|Math|" + // Other
  234. "this|arguments|prototype|window|document",
  235. "keyword": "const|yield|import|get|set|async|await|" +
  236. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  237. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  238. "__parent__|__count__|escape|unescape|with|__proto__|" +
  239. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  240. "storage.type": "const|let|var|function",
  241. "constant.language": "null|Infinity|NaN|undefined",
  242. "support.function": "alert",
  243. "constant.language.boolean": "true|false"
  244. }, "identifier");
  245. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  246. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  247. "u[0-9a-fA-F]{4}|" + // unicode
  248. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  249. "[0-2][0-7]{0,2}|" + // oct
  250. "3[0-7][0-7]?|" + // oct
  251. "[4-7][0-7]?|" + //oct
  252. ".)";
  253. this.$rules = {
  254. "no_regex": [
  255. DocCommentHighlightRules.getStartRule("doc-start"),
  256. comments("no_regex"),
  257. {
  258. token: "string",
  259. regex: "'(?=.)",
  260. next: "qstring"
  261. }, {
  262. token: "string",
  263. regex: '"(?=.)',
  264. next: "qqstring"
  265. }, {
  266. token: "constant.numeric",
  267. regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  268. }, {
  269. token: "constant.numeric",
  270. regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  271. }, {
  272. token: [
  273. "storage.type", "punctuation.operator", "support.function",
  274. "punctuation.operator", "entity.name.function", "text", "keyword.operator"
  275. ],
  276. regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
  277. next: "function_arguments"
  278. }, {
  279. token: [
  280. "storage.type", "punctuation.operator", "entity.name.function", "text",
  281. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  282. ],
  283. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  284. next: "function_arguments"
  285. }, {
  286. token: [
  287. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  288. "text", "paren.lparen"
  289. ],
  290. regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  291. next: "function_arguments"
  292. }, {
  293. token: [
  294. "storage.type", "punctuation.operator", "entity.name.function", "text",
  295. "keyword.operator", "text",
  296. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  297. ],
  298. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  299. next: "function_arguments"
  300. }, {
  301. token: [
  302. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  303. ],
  304. regex: "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  305. next: "function_arguments"
  306. }, {
  307. token: [
  308. "entity.name.function", "text", "punctuation.operator",
  309. "text", "storage.type", "text", "paren.lparen"
  310. ],
  311. regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  312. next: "function_arguments"
  313. }, {
  314. token: [
  315. "text", "text", "storage.type", "text", "paren.lparen"
  316. ],
  317. regex: "(:)(\\s*)(function)(\\s*)(\\()",
  318. next: "function_arguments"
  319. }, {
  320. token: "keyword",
  321. regex: "from(?=\\s*('|\"))"
  322. }, {
  323. token: "keyword",
  324. regex: "(?:" + kwBeforeRe + ")\\b",
  325. next: "start"
  326. }, {
  327. token: ["support.constant"],
  328. regex: /that\b/
  329. }, {
  330. token: ["storage.type", "punctuation.operator", "support.function.firebug"],
  331. regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  332. }, {
  333. token: keywordMapper,
  334. regex: identifierRe
  335. }, {
  336. token: "punctuation.operator",
  337. regex: /[.](?![.])/,
  338. next: "property"
  339. }, {
  340. token: "storage.type",
  341. regex: /=>/,
  342. next: "start"
  343. }, {
  344. token: "keyword.operator",
  345. regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  346. next: "start"
  347. }, {
  348. token: "punctuation.operator",
  349. regex: /[?:,;.]/,
  350. next: "start"
  351. }, {
  352. token: "paren.lparen",
  353. regex: /[\[({]/,
  354. next: "start"
  355. }, {
  356. token: "paren.rparen",
  357. regex: /[\])}]/
  358. }, {
  359. token: "comment",
  360. regex: /^#!.*$/
  361. }
  362. ],
  363. property: [{
  364. token: "text",
  365. regex: "\\s+"
  366. }, {
  367. token: [
  368. "storage.type", "punctuation.operator", "entity.name.function", "text",
  369. "keyword.operator", "text",
  370. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  371. ],
  372. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  373. next: "function_arguments"
  374. }, {
  375. token: "punctuation.operator",
  376. regex: /[.](?![.])/
  377. }, {
  378. token: "support.function",
  379. regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  380. }, {
  381. token: "support.function.dom",
  382. regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  383. }, {
  384. token: "support.constant",
  385. regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  386. }, {
  387. token: "identifier",
  388. regex: identifierRe
  389. }, {
  390. regex: "",
  391. token: "empty",
  392. next: "no_regex"
  393. }
  394. ],
  395. "start": [
  396. DocCommentHighlightRules.getStartRule("doc-start"),
  397. comments("start"),
  398. {
  399. token: "string.regexp",
  400. regex: "\\/",
  401. next: "regex"
  402. }, {
  403. token: "text",
  404. regex: "\\s+|^$",
  405. next: "start"
  406. }, {
  407. token: "empty",
  408. regex: "",
  409. next: "no_regex"
  410. }
  411. ],
  412. "regex": [
  413. {
  414. token: "regexp.keyword.operator",
  415. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  416. }, {
  417. token: "string.regexp",
  418. regex: "/[sxngimy]*",
  419. next: "no_regex"
  420. }, {
  421. token: "invalid",
  422. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  423. }, {
  424. token: "constant.language.escape",
  425. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  426. }, {
  427. token: "constant.language.delimiter",
  428. regex: /\|/
  429. }, {
  430. token: "constant.language.escape",
  431. regex: /\[\^?/,
  432. next: "regex_character_class"
  433. }, {
  434. token: "empty",
  435. regex: "$",
  436. next: "no_regex"
  437. }, {
  438. defaultToken: "string.regexp"
  439. }
  440. ],
  441. "regex_character_class": [
  442. {
  443. token: "regexp.charclass.keyword.operator",
  444. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  445. }, {
  446. token: "constant.language.escape",
  447. regex: "]",
  448. next: "regex"
  449. }, {
  450. token: "constant.language.escape",
  451. regex: "-"
  452. }, {
  453. token: "empty",
  454. regex: "$",
  455. next: "no_regex"
  456. }, {
  457. defaultToken: "string.regexp.charachterclass"
  458. }
  459. ],
  460. "function_arguments": [
  461. {
  462. token: "variable.parameter",
  463. regex: identifierRe
  464. }, {
  465. token: "punctuation.operator",
  466. regex: "[, ]+"
  467. }, {
  468. token: "punctuation.operator",
  469. regex: "$"
  470. }, {
  471. token: "empty",
  472. regex: "",
  473. next: "no_regex"
  474. }
  475. ],
  476. "qqstring": [
  477. {
  478. token: "constant.language.escape",
  479. regex: escapedRe
  480. }, {
  481. token: "string",
  482. regex: "\\\\$",
  483. consumeLineEnd: true
  484. }, {
  485. token: "string",
  486. regex: '"|$',
  487. next: "no_regex"
  488. }, {
  489. defaultToken: "string"
  490. }
  491. ],
  492. "qstring": [
  493. {
  494. token: "constant.language.escape",
  495. regex: escapedRe
  496. }, {
  497. token: "string",
  498. regex: "\\\\$",
  499. consumeLineEnd: true
  500. }, {
  501. token: "string",
  502. regex: "'|$",
  503. next: "no_regex"
  504. }, {
  505. defaultToken: "string"
  506. }
  507. ]
  508. };
  509. if (!options || !options.noES6) {
  510. this.$rules.no_regex.unshift({
  511. regex: "[{}]", onMatch: function (val, state, stack) {
  512. this.next = val == "{" ? this.nextState : "";
  513. if (val == "{" && stack.length) {
  514. stack.unshift("start", state);
  515. }
  516. else if (val == "}" && stack.length) {
  517. stack.shift();
  518. this.next = stack.shift();
  519. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  520. return "paren.quasi.end";
  521. }
  522. return val == "{" ? "paren.lparen" : "paren.rparen";
  523. },
  524. nextState: "start"
  525. }, {
  526. token: "string.quasi.start",
  527. regex: /`/,
  528. push: [{
  529. token: "constant.language.escape",
  530. regex: escapedRe
  531. }, {
  532. token: "paren.quasi.start",
  533. regex: /\${/,
  534. push: "start"
  535. }, {
  536. token: "string.quasi.end",
  537. regex: /`/,
  538. next: "pop"
  539. }, {
  540. defaultToken: "string.quasi"
  541. }]
  542. });
  543. if (!options || options.jsx != false)
  544. JSX.call(this);
  545. }
  546. this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
  547. this.normalizeRules();
  548. };
  549. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  550. function JSX() {
  551. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  552. var jsxTag = {
  553. onMatch: function (val, state, stack) {
  554. var offset = val.charAt(1) == "/" ? 2 : 1;
  555. if (offset == 1) {
  556. if (state != this.nextState)
  557. stack.unshift(this.next, this.nextState, 0);
  558. else
  559. stack.unshift(this.next);
  560. stack[2]++;
  561. }
  562. else if (offset == 2) {
  563. if (state == this.nextState) {
  564. stack[1]--;
  565. if (!stack[1] || stack[1] < 0) {
  566. stack.shift();
  567. stack.shift();
  568. }
  569. }
  570. }
  571. return [{
  572. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  573. value: val.slice(0, offset)
  574. }, {
  575. type: "meta.tag.tag-name.xml",
  576. value: val.substr(offset)
  577. }];
  578. },
  579. regex: "</?" + tagRegex + "",
  580. next: "jsxAttributes",
  581. nextState: "jsx"
  582. };
  583. this.$rules.start.unshift(jsxTag);
  584. var jsxJsRule = {
  585. regex: "{",
  586. token: "paren.quasi.start",
  587. push: "start"
  588. };
  589. this.$rules.jsx = [
  590. jsxJsRule,
  591. jsxTag,
  592. { include: "reference" },
  593. { defaultToken: "string" }
  594. ];
  595. this.$rules.jsxAttributes = [{
  596. token: "meta.tag.punctuation.tag-close.xml",
  597. regex: "/?>",
  598. onMatch: function (value, currentState, stack) {
  599. if (currentState == stack[0])
  600. stack.shift();
  601. if (value.length == 2) {
  602. if (stack[0] == this.nextState)
  603. stack[1]--;
  604. if (!stack[1] || stack[1] < 0) {
  605. stack.splice(0, 2);
  606. }
  607. }
  608. this.next = stack[0] || "start";
  609. return [{ type: this.token, value: value }];
  610. },
  611. nextState: "jsx"
  612. },
  613. jsxJsRule,
  614. comments("jsxAttributes"),
  615. {
  616. token: "entity.other.attribute-name.xml",
  617. regex: tagRegex
  618. }, {
  619. token: "keyword.operator.attribute-equals.xml",
  620. regex: "="
  621. }, {
  622. token: "text.tag-whitespace.xml",
  623. regex: "\\s+"
  624. }, {
  625. token: "string.attribute-value.xml",
  626. regex: "'",
  627. stateName: "jsx_attr_q",
  628. push: [
  629. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  630. { include: "reference" },
  631. { defaultToken: "string.attribute-value.xml" }
  632. ]
  633. }, {
  634. token: "string.attribute-value.xml",
  635. regex: '"',
  636. stateName: "jsx_attr_qq",
  637. push: [
  638. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  639. { include: "reference" },
  640. { defaultToken: "string.attribute-value.xml" }
  641. ]
  642. },
  643. jsxTag
  644. ];
  645. this.$rules.reference = [{
  646. token: "constant.language.escape.reference.xml",
  647. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  648. }];
  649. }
  650. function comments(next) {
  651. return [
  652. {
  653. token: "comment",
  654. regex: /\/\*/,
  655. next: [
  656. DocCommentHighlightRules.getTagRule(),
  657. { token: "comment", regex: "\\*\\/", next: next || "pop" },
  658. { defaultToken: "comment", caseInsensitive: true }
  659. ]
  660. }, {
  661. token: "comment",
  662. regex: "\\/\\/",
  663. next: [
  664. DocCommentHighlightRules.getTagRule(),
  665. { token: "comment", regex: "$|^", next: next || "pop" },
  666. { defaultToken: "comment", caseInsensitive: true }
  667. ]
  668. }
  669. ];
  670. }
  671. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  672. });
  673. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  674. var oop = require("../lib/oop");
  675. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  676. var XmlHighlightRules = function (normalize) {
  677. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  678. this.$rules = {
  679. start: [
  680. { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
  681. {
  682. token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
  683. regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
  684. },
  685. { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
  686. {
  687. token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  688. regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
  689. },
  690. { include: "tag" },
  691. { token: "text.end-tag-open.xml", regex: "</" },
  692. { token: "text.tag-open.xml", regex: "<" },
  693. { include: "reference" },
  694. { defaultToken: "text.xml" }
  695. ],
  696. processing_instruction: [{
  697. token: "entity.other.attribute-name.decl-attribute-name.xml",
  698. regex: tagRegex
  699. }, {
  700. token: "keyword.operator.decl-attribute-equals.xml",
  701. regex: "="
  702. }, {
  703. include: "whitespace"
  704. }, {
  705. include: "string"
  706. }, {
  707. token: "punctuation.xml-decl.xml",
  708. regex: "\\?>",
  709. next: "start"
  710. }],
  711. doctype: [
  712. { include: "whitespace" },
  713. { include: "string" },
  714. { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
  715. { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
  716. { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
  717. ],
  718. int_subset: [{
  719. token: "text.xml",
  720. regex: "\\s+"
  721. }, {
  722. token: "punctuation.int-subset.xml",
  723. regex: "]",
  724. next: "pop"
  725. }, {
  726. token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  727. regex: "(<\\!)(" + tagRegex + ")",
  728. push: [{
  729. token: "text",
  730. regex: "\\s+"
  731. },
  732. {
  733. token: "punctuation.markup-decl.xml",
  734. regex: ">",
  735. next: "pop"
  736. },
  737. { include: "string" }]
  738. }],
  739. cdata: [
  740. { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
  741. { token: "text.xml", regex: "\\s+" },
  742. { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
  743. ],
  744. comment: [
  745. { token: "comment.end.xml", regex: "-->", next: "start" },
  746. { defaultToken: "comment.xml" }
  747. ],
  748. reference: [{
  749. token: "constant.language.escape.reference.xml",
  750. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  751. }],
  752. attr_reference: [{
  753. token: "constant.language.escape.reference.attribute-value.xml",
  754. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  755. }],
  756. tag: [{
  757. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  758. regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  759. next: [
  760. { include: "attributes" },
  761. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  762. ]
  763. }],
  764. tag_whitespace: [
  765. { token: "text.tag-whitespace.xml", regex: "\\s+" }
  766. ],
  767. whitespace: [
  768. { token: "text.whitespace.xml", regex: "\\s+" }
  769. ],
  770. string: [{
  771. token: "string.xml",
  772. regex: "'",
  773. push: [
  774. { token: "string.xml", regex: "'", next: "pop" },
  775. { defaultToken: "string.xml" }
  776. ]
  777. }, {
  778. token: "string.xml",
  779. regex: '"',
  780. push: [
  781. { token: "string.xml", regex: '"', next: "pop" },
  782. { defaultToken: "string.xml" }
  783. ]
  784. }],
  785. attributes: [{
  786. token: "entity.other.attribute-name.xml",
  787. regex: tagRegex
  788. }, {
  789. token: "keyword.operator.attribute-equals.xml",
  790. regex: "="
  791. }, {
  792. include: "tag_whitespace"
  793. }, {
  794. include: "attribute_value"
  795. }],
  796. attribute_value: [{
  797. token: "string.attribute-value.xml",
  798. regex: "'",
  799. push: [
  800. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  801. { include: "attr_reference" },
  802. { defaultToken: "string.attribute-value.xml" }
  803. ]
  804. }, {
  805. token: "string.attribute-value.xml",
  806. regex: '"',
  807. push: [
  808. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  809. { include: "attr_reference" },
  810. { defaultToken: "string.attribute-value.xml" }
  811. ]
  812. }]
  813. };
  814. if (this.constructor === XmlHighlightRules)
  815. this.normalizeRules();
  816. };
  817. (function () {
  818. this.embedTagRules = function (HighlightRules, prefix, tag) {
  819. this.$rules.tag.unshift({
  820. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  821. regex: "(<)(" + tag + "(?=\\s|>|$))",
  822. next: [
  823. { include: "attributes" },
  824. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
  825. ]
  826. });
  827. this.$rules[tag + "-end"] = [
  828. { include: "attributes" },
  829. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
  830. onMatch: function (value, currentState, stack) {
  831. stack.splice(0);
  832. return this.token;
  833. } }
  834. ];
  835. this.embedRules(HighlightRules, prefix, [{
  836. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  837. regex: "(</)(" + tag + "(?=\\s|>|$))",
  838. next: tag + "-end"
  839. }, {
  840. token: "string.cdata.xml",
  841. regex: "<\\!\\[CDATA\\["
  842. }, {
  843. token: "string.cdata.xml",
  844. regex: "\\]\\]>"
  845. }]);
  846. };
  847. }).call(TextHighlightRules.prototype);
  848. oop.inherits(XmlHighlightRules, TextHighlightRules);
  849. exports.XmlHighlightRules = XmlHighlightRules;
  850. });
  851. ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module){"use strict";
  852. var oop = require("../lib/oop");
  853. var lang = require("../lib/lang");
  854. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  855. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  856. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  857. var tagMap = lang.createMap({
  858. a: 'anchor',
  859. button: 'form',
  860. form: 'form',
  861. img: 'image',
  862. input: 'form',
  863. label: 'form',
  864. option: 'form',
  865. script: 'script',
  866. select: 'form',
  867. textarea: 'form',
  868. style: 'style',
  869. table: 'table',
  870. tbody: 'table',
  871. td: 'table',
  872. tfoot: 'table',
  873. th: 'table',
  874. tr: 'table'
  875. });
  876. var HtmlHighlightRules = function () {
  877. XmlHighlightRules.call(this);
  878. this.addRules({
  879. attributes: [{
  880. include: "tag_whitespace"
  881. }, {
  882. token: "entity.other.attribute-name.xml",
  883. regex: "[-_a-zA-Z0-9:.]+"
  884. }, {
  885. token: "keyword.operator.attribute-equals.xml",
  886. regex: "=",
  887. push: [{
  888. include: "tag_whitespace"
  889. }, {
  890. token: "string.unquoted.attribute-value.html",
  891. regex: "[^<>='\"`\\s]+",
  892. next: "pop"
  893. }, {
  894. token: "empty",
  895. regex: "",
  896. next: "pop"
  897. }]
  898. }, {
  899. include: "attribute_value"
  900. }],
  901. tag: [{
  902. token: function (start, tag) {
  903. var group = tagMap[tag];
  904. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  905. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  906. },
  907. regex: "(</?)([-_a-zA-Z0-9:.]+)",
  908. next: "tag_stuff"
  909. }],
  910. tag_stuff: [
  911. { include: "attributes" },
  912. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  913. ]
  914. });
  915. this.embedTagRules(CssHighlightRules, "css-", "style");
  916. this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
  917. if (this.constructor === HtmlHighlightRules)
  918. this.normalizeRules();
  919. };
  920. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  921. exports.HtmlHighlightRules = HtmlHighlightRules;
  922. });
  923. ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  924. var oop = require("../lib/oop");
  925. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  926. var constantOtherSymbol = exports.constantOtherSymbol = {
  927. token: "constant.other.symbol.ruby",
  928. regex: "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
  929. };
  930. exports.qString = {
  931. token: "string",
  932. regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  933. };
  934. exports.qqString = {
  935. token: "string",
  936. regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  937. };
  938. exports.tString = {
  939. token: "string",
  940. regex: "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
  941. };
  942. var constantNumericHex = exports.constantNumericHex = {
  943. token: "constant.numeric",
  944. regex: "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
  945. };
  946. var constantNumericBinary = exports.constantNumericBinary = {
  947. token: "constant.numeric",
  948. regex: /\b(0[bB][01](?:[01]|_(?=[01]))*)\b/
  949. };
  950. var constantNumericDecimal = exports.constantNumericDecimal = {
  951. token: "constant.numeric",
  952. regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
  953. };
  954. var constantNumericOctal = exports.constantNumericDecimal = {
  955. token: "constant.numeric",
  956. regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
  957. };
  958. var constantNumericRational = exports.constantNumericRational = {
  959. token: "constant.numeric",
  960. regex: /\b([\d]+(?:[./][\d]+)?ri?)\b/
  961. };
  962. var constantNumericComplex = exports.constantNumericComplex = {
  963. token: "constant.numeric",
  964. regex: /\b([\d]i)\b/
  965. };
  966. var constantNumericFloat = exports.constantNumericFloat = {
  967. token: "constant.numeric",
  968. regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"
  969. };
  970. var instanceVariable = exports.instanceVariable = {
  971. token: "variable.instance",
  972. regex: "@{1,2}[a-zA-Z_\\d]+"
  973. };
  974. var RubyHighlightRules = function () {
  975. var builtinFunctions = ("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
  976. "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
  977. "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
  978. "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
  979. "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
  980. "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
  981. "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
  982. "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
  983. "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
  984. "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" +
  985. "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
  986. "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
  987. "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
  988. "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
  989. "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
  990. "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
  991. "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
  992. "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
  993. "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
  994. "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
  995. "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
  996. "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
  997. "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
  998. "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
  999. "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
  1000. "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
  1001. "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
  1002. "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" +
  1003. "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
  1004. "has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|" +
  1005. "private_class_method|remove_method|undef_method");
  1006. var keywords = ("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
  1007. "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
  1008. "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend");
  1009. var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
  1010. "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION");
  1011. var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
  1012. "$!|root_url|flash|session|cookies|params|request|response|logger|self");
  1013. var keywordMapper = this.$keywords = this.createKeywordMapper({
  1014. "keyword": keywords,
  1015. "constant.language": buildinConstants,
  1016. "variable.language": builtinVariables,
  1017. "support.function": builtinFunctions,
  1018. "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
  1019. }, "identifier");
  1020. var escapedChars = "\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'\"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})";
  1021. var closeParen = {
  1022. "(": ")",
  1023. "[": "]",
  1024. "{": "}",
  1025. "<": ">",
  1026. "^": "^",
  1027. "|": "|",
  1028. "%": "%"
  1029. };
  1030. this.$rules = {
  1031. "start": [
  1032. {
  1033. token: "comment",
  1034. regex: "#.*$"
  1035. }, {
  1036. token: "comment.multiline",
  1037. regex: "^=begin(?=$|\\s.*$)",
  1038. next: "comment"
  1039. }, {
  1040. token: "string.regexp",
  1041. regex: /[/](?=.*\/)/,
  1042. next: "regex"
  1043. },
  1044. [{
  1045. token: ["constant.other.symbol.ruby", "string.start"],
  1046. regex: /(:)?(")/,
  1047. push: [{
  1048. token: "constant.language.escape",
  1049. regex: escapedChars
  1050. }, {
  1051. token: "paren.start",
  1052. regex: /#{/,
  1053. push: "start"
  1054. }, {
  1055. token: "string.end",
  1056. regex: /"/,
  1057. next: "pop"
  1058. }, {
  1059. defaultToken: "string"
  1060. }]
  1061. }, {
  1062. token: "string.start",
  1063. regex: /`/,
  1064. push: [{
  1065. token: "constant.language.escape",
  1066. regex: escapedChars
  1067. }, {
  1068. token: "paren.start",
  1069. regex: /#{/,
  1070. push: "start"
  1071. }, {
  1072. token: "string.end",
  1073. regex: /`/,
  1074. next: "pop"
  1075. }, {
  1076. defaultToken: "string"
  1077. }]
  1078. }, {
  1079. token: ["constant.other.symbol.ruby", "string.start"],
  1080. regex: /(:)?(')/,
  1081. push: [{
  1082. token: "constant.language.escape",
  1083. regex: /\\['\\]/
  1084. }, {
  1085. token: "string.end",
  1086. regex: /'/,
  1087. next: "pop"
  1088. }, {
  1089. defaultToken: "string"
  1090. }]
  1091. }, {
  1092. token: "string.start",
  1093. regex: /%[qwx]([(\[<{^|%])/, onMatch: function (val, state, stack) {
  1094. if (stack.length)
  1095. stack = [];
  1096. var paren = val[val.length - 1];
  1097. stack.unshift(paren, state);
  1098. this.next = "qStateWithoutInterpolation";
  1099. return this.token;
  1100. }
  1101. }, {
  1102. token: "string.start",
  1103. regex: /%[QWX]?([(\[<{^|%])/, onMatch: function (val, state, stack) {
  1104. if (stack.length)
  1105. stack = [];
  1106. var paren = val[val.length - 1];
  1107. stack.unshift(paren, state);
  1108. this.next = "qStateWithInterpolation";
  1109. return this.token;
  1110. }
  1111. }, {
  1112. token: "constant.other.symbol.ruby",
  1113. regex: /%[si]([(\[<{^|%])/, onMatch: function (val, state, stack) {
  1114. if (stack.length)
  1115. stack = [];
  1116. var paren = val[val.length - 1];
  1117. stack.unshift(paren, state);
  1118. this.next = "sStateWithoutInterpolation";
  1119. return this.token;
  1120. }
  1121. }, {
  1122. token: "constant.other.symbol.ruby",
  1123. regex: /%[SI]([(\[<{^|%])/, onMatch: function (val, state, stack) {
  1124. if (stack.length)
  1125. stack = [];
  1126. var paren = val[val.length - 1];
  1127. stack.unshift(paren, state);
  1128. this.next = "sStateWithInterpolation";
  1129. return this.token;
  1130. }
  1131. }, {
  1132. token: "string.regexp",
  1133. regex: /%[r]([(\[<{^|%])/, onMatch: function (val, state, stack) {
  1134. if (stack.length)
  1135. stack = [];
  1136. var paren = val[val.length - 1];
  1137. stack.unshift(paren, state);
  1138. this.next = "rState";
  1139. return this.token;
  1140. }
  1141. }],
  1142. {
  1143. token: "punctuation",
  1144. regex: "::"
  1145. },
  1146. instanceVariable,
  1147. {
  1148. token: "variable.global",
  1149. regex: "[$][a-zA-Z_\\d]+"
  1150. }, {
  1151. token: "support.class",
  1152. regex: "[A-Z][a-zA-Z_\\d]*"
  1153. }, {
  1154. token: ["punctuation.operator", "support.function"],
  1155. regex: /(\.)([a-zA-Z_\d]+)(?=\()/
  1156. }, {
  1157. token: ["punctuation.operator", "identifier"],
  1158. regex: /(\.)([a-zA-Z_][a-zA-Z_\d]*)/
  1159. }, {
  1160. token: "string.character",
  1161. regex: "\\B\\?(?:" + escapedChars + "|\\S)"
  1162. }, {
  1163. token: "punctuation.operator",
  1164. regex: /\?(?=.+:)/
  1165. },
  1166. constantNumericRational,
  1167. constantNumericComplex,
  1168. constantOtherSymbol,
  1169. constantNumericHex,
  1170. constantNumericFloat,
  1171. constantNumericBinary,
  1172. constantNumericDecimal,
  1173. constantNumericOctal,
  1174. {
  1175. token: "constant.language.boolean",
  1176. regex: "(?:true|false)\\b"
  1177. }, {
  1178. token: keywordMapper,
  1179. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  1180. }, {
  1181. token: "punctuation.separator.key-value",
  1182. regex: "=>"
  1183. }, {
  1184. stateName: "heredoc",
  1185. onMatch: function (value, currentState, stack) {
  1186. var next = (value[2] == '-' || value[2] == '~') ? "indentedHeredoc" : "heredoc";
  1187. var tokens = value.split(this.splitRegex);
  1188. stack.push(next, tokens[3]);
  1189. return [
  1190. { type: "constant", value: tokens[1] },
  1191. { type: "string", value: tokens[2] },
  1192. { type: "support.class", value: tokens[3] },
  1193. { type: "string", value: tokens[4] }
  1194. ];
  1195. },
  1196. regex: "(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",
  1197. rules: {
  1198. heredoc: [{
  1199. onMatch: function (value, currentState, stack) {
  1200. if (value === stack[1]) {
  1201. stack.shift();
  1202. stack.shift();
  1203. this.next = stack[0] || "start";
  1204. return "support.class";
  1205. }
  1206. this.next = "";
  1207. return "string";
  1208. },
  1209. regex: ".*$",
  1210. next: "start"
  1211. }],
  1212. indentedHeredoc: [{
  1213. token: "string",
  1214. regex: "^ +"
  1215. }, {
  1216. onMatch: function (value, currentState, stack) {
  1217. if (value === stack[1]) {
  1218. stack.shift();
  1219. stack.shift();
  1220. this.next = stack[0] || "start";
  1221. return "support.class";
  1222. }
  1223. this.next = "";
  1224. return "string";
  1225. },
  1226. regex: ".*$",
  1227. next: "start"
  1228. }]
  1229. }
  1230. }, {
  1231. regex: "$",
  1232. token: "empty",
  1233. next: function (currentState, stack) {
  1234. if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
  1235. return stack[0];
  1236. return currentState;
  1237. }
  1238. }, {
  1239. token: "keyword.operator",
  1240. regex: "!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"
  1241. }, {
  1242. token: "paren.lparen",
  1243. regex: "[[({]"
  1244. }, {
  1245. token: "paren.rparen",
  1246. regex: "[\\])}]",
  1247. onMatch: function (value, currentState, stack) {
  1248. this.next = '';
  1249. if (value == "}" && stack.length > 1 && stack[1] != "start") {
  1250. stack.shift();
  1251. this.next = stack.shift();
  1252. }
  1253. return this.token;
  1254. }
  1255. }, {
  1256. token: "text",
  1257. regex: "\\s+"
  1258. }, {
  1259. token: "punctuation.operator",
  1260. regex: /[?:,;.]/
  1261. }
  1262. ],
  1263. "comment": [
  1264. {
  1265. token: "comment.multiline",
  1266. regex: "^=end(?=$|\\s.*$)",
  1267. next: "start"
  1268. }, {
  1269. token: "comment",
  1270. regex: ".+"
  1271. }
  1272. ],
  1273. "qStateWithInterpolation": [{
  1274. token: "string.start",
  1275. regex: /[(\[<{]/, onMatch: function (val, state, stack) {
  1276. if (stack.length && val === stack[0]) {
  1277. stack.unshift(val, state);
  1278. return this.token;
  1279. }
  1280. return "string";
  1281. }
  1282. }, {
  1283. token: "constant.language.escape",
  1284. regex: escapedChars
  1285. }, {
  1286. token: "constant.language.escape",
  1287. regex: /\\./
  1288. }, {
  1289. token: "paren.start",
  1290. regex: /#{/,
  1291. push: "start"
  1292. }, {
  1293. token: "string.end",
  1294. regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
  1295. if (stack.length && val === closeParen[stack[0]]) {
  1296. stack.shift();
  1297. this.next = stack.shift();
  1298. return this.token;
  1299. }
  1300. this.next = '';
  1301. return "string";
  1302. }
  1303. }, {
  1304. defaultToken: "string"
  1305. }],
  1306. "qStateWithoutInterpolation": [{
  1307. token: "string.start",
  1308. regex: /[(\[<{]/, onMatch: function (val, state, stack) {
  1309. if (stack.length && val === stack[0]) {
  1310. stack.unshift(val, state);
  1311. return this.token;
  1312. }
  1313. return "string";
  1314. }
  1315. }, {
  1316. token: "constant.language.escape",
  1317. regex: /\\['\\]/
  1318. }, {
  1319. token: "constant.language.escape",
  1320. regex: /\\./
  1321. }, {
  1322. token: "string.end",
  1323. regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
  1324. if (stack.length && val === closeParen[stack[0]]) {
  1325. stack.shift();
  1326. this.next = stack.shift();
  1327. return this.token;
  1328. }
  1329. this.next = '';
  1330. return "string";
  1331. }
  1332. }, {
  1333. defaultToken: "string"
  1334. }],
  1335. "sStateWithoutInterpolation": [{
  1336. token: "constant.other.symbol.ruby",
  1337. regex: /[(\[<{]/, onMatch: function (val, state, stack) {
  1338. if (stack.length && val === stack[0]) {
  1339. stack.unshift(val, state);
  1340. return this.token;
  1341. }
  1342. return "constant.other.symbol.ruby";
  1343. }
  1344. }, {
  1345. token: "constant.other.symbol.ruby",
  1346. regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
  1347. if (stack.length && val === closeParen[stack[0]]) {
  1348. stack.shift();
  1349. this.next = stack.shift();
  1350. return this.token;
  1351. }
  1352. this.next = '';
  1353. return "constant.other.symbol.ruby";
  1354. }
  1355. }, {
  1356. defaultToken: "constant.other.symbol.ruby"
  1357. }],
  1358. "sStateWithInterpolation": [{
  1359. token: "constant.other.symbol.ruby",
  1360. regex: /[(\[<{]/, onMatch: function (val, state, stack) {
  1361. if (stack.length && val === stack[0]) {
  1362. stack.unshift(val, state);
  1363. return this.token;
  1364. }
  1365. return "constant.other.symbol.ruby";
  1366. }
  1367. }, {
  1368. token: "constant.language.escape",
  1369. regex: escapedChars
  1370. }, {
  1371. token: "constant.language.escape",
  1372. regex: /\\./
  1373. }, {
  1374. token: "paren.start",
  1375. regex: /#{/,
  1376. push: "start"
  1377. }, {
  1378. token: "constant.other.symbol.ruby",
  1379. regex: /[)\]>}^|%]/, onMatch: function (val, state, stack) {
  1380. if (stack.length && val === closeParen[stack[0]]) {
  1381. stack.shift();
  1382. this.next = stack.shift();
  1383. return this.token;
  1384. }
  1385. this.next = '';
  1386. return "constant.other.symbol.ruby";
  1387. }
  1388. }, {
  1389. defaultToken: "constant.other.symbol.ruby"
  1390. }],
  1391. "rState": [{
  1392. token: "string.regexp",
  1393. regex: /[(\[<{]/, onMatch: function (val, state, stack) {
  1394. if (stack.length && val === stack[0]) {
  1395. stack.unshift(val, state);
  1396. return this.token;
  1397. }
  1398. return "constant.language.escape";
  1399. }
  1400. }, {
  1401. token: "paren.start",
  1402. regex: /#{/,
  1403. push: "start"
  1404. }, {
  1405. token: "string.regexp",
  1406. regex: /\//
  1407. }, {
  1408. token: "string.regexp",
  1409. regex: /[)\]>}^|%][imxouesn]*/, onMatch: function (val, state, stack) {
  1410. if (stack.length && val[0] === closeParen[stack[0]]) {
  1411. stack.shift();
  1412. this.next = stack.shift();
  1413. return this.token;
  1414. }
  1415. this.next = '';
  1416. return "constant.language.escape";
  1417. }
  1418. },
  1419. { include: "regex" },
  1420. {
  1421. defaultToken: "string.regexp"
  1422. }],
  1423. "regex": [
  1424. {
  1425. token: "regexp.keyword",
  1426. regex: /\\[wWdDhHsS]/
  1427. }, {
  1428. token: "constant.language.escape",
  1429. regex: /\\[AGbBzZ]/
  1430. }, {
  1431. token: "constant.language.escape",
  1432. regex: /\\g<[a-zA-Z0-9]*>/
  1433. }, {
  1434. token: ["constant.language.escape", "regexp.keyword", "constant.language.escape"],
  1435. regex: /(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/
  1436. }, {
  1437. token: ["constant.language.escape", "invalid", "constant.language.escape"],
  1438. regex: /(\\p{\^?)([^/]*)(})/
  1439. }, {
  1440. token: "regexp.keyword.operator",
  1441. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  1442. }, {
  1443. token: "string.regexp",
  1444. regex: /[/][imxouesn]*/,
  1445. next: "start"
  1446. }, {
  1447. token: "invalid",
  1448. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  1449. }, {
  1450. token: "constant.language.escape",
  1451. regex: /\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  1452. }, {
  1453. token: "constant.language.delimiter",
  1454. regex: /\|/
  1455. }, {
  1456. token: "regexp.keyword",
  1457. regex: /\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/
  1458. }, {
  1459. token: "constant.language.escape",
  1460. regex: /\[\^?/,
  1461. push: "regex_character_class"
  1462. }, {
  1463. defaultToken: "string.regexp"
  1464. }
  1465. ],
  1466. "regex_character_class": [
  1467. {
  1468. token: "regexp.keyword",
  1469. regex: /\\[wWdDhHsS]/
  1470. }, {
  1471. token: "regexp.charclass.keyword.operator",
  1472. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  1473. }, {
  1474. token: "constant.language.escape",
  1475. regex: /&?&?\[\^?/,
  1476. push: "regex_character_class"
  1477. }, {
  1478. token: "constant.language.escape",
  1479. regex: "]",
  1480. next: "pop"
  1481. }, {
  1482. token: "constant.language.escape",
  1483. regex: "-"
  1484. }, {
  1485. defaultToken: "string.regexp.characterclass"
  1486. }
  1487. ]
  1488. };
  1489. this.normalizeRules();
  1490. };
  1491. oop.inherits(RubyHighlightRules, TextHighlightRules);
  1492. exports.RubyHighlightRules = RubyHighlightRules;
  1493. });
  1494. ace.define("ace/mode/html_ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/ruby_highlight_rules"], function(require, exports, module){"use strict";
  1495. var oop = require("../lib/oop");
  1496. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  1497. var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
  1498. var HtmlRubyHighlightRules = function () {
  1499. HtmlHighlightRules.call(this);
  1500. var startRules = [
  1501. {
  1502. regex: "<%%|%%>",
  1503. token: "constant.language.escape"
  1504. }, {
  1505. token: "comment.start.erb",
  1506. regex: "<%#",
  1507. push: [{
  1508. token: "comment.end.erb",
  1509. regex: "%>",
  1510. next: "pop",
  1511. defaultToken: "comment"
  1512. }]
  1513. }, {
  1514. token: "support.ruby_tag",
  1515. regex: "<%+(?!>)[-=]?",
  1516. push: "ruby-start"
  1517. }
  1518. ];
  1519. var endRules = [
  1520. {
  1521. token: "support.ruby_tag",
  1522. regex: "%>",
  1523. next: "pop"
  1524. }, {
  1525. token: "comment",
  1526. regex: "#(?:[^%]|%[^>])*"
  1527. }
  1528. ];
  1529. for (var key in this.$rules)
  1530. this.$rules[key].unshift.apply(this.$rules[key], startRules);
  1531. this.embedRules(RubyHighlightRules, "ruby-", endRules, ["start"]);
  1532. this.normalizeRules();
  1533. };
  1534. oop.inherits(HtmlRubyHighlightRules, HtmlHighlightRules);
  1535. exports.HtmlRubyHighlightRules = HtmlRubyHighlightRules;
  1536. });
  1537. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
  1538. var Range = require("../range").Range;
  1539. var MatchingBraceOutdent = function () { };
  1540. (function () {
  1541. this.checkOutdent = function (line, input) {
  1542. if (!/^\s+$/.test(line))
  1543. return false;
  1544. return /^\s*\}/.test(input);
  1545. };
  1546. this.autoOutdent = function (doc, row) {
  1547. var line = doc.getLine(row);
  1548. var match = line.match(/^(\s*\})/);
  1549. if (!match)
  1550. return 0;
  1551. var column = match[1].length;
  1552. var openBracePos = doc.findMatchingBracket({ row: row, column: column });
  1553. if (!openBracePos || openBracePos.row == row)
  1554. return 0;
  1555. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  1556. doc.replace(new Range(row, 0, row, column - 1), indent);
  1557. };
  1558. this.$getIndent = function (line) {
  1559. return line.match(/^\s*/)[0];
  1560. };
  1561. }).call(MatchingBraceOutdent.prototype);
  1562. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  1563. });
  1564. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  1565. var oop = require("../../lib/oop");
  1566. var Range = require("../../range").Range;
  1567. var BaseFoldMode = require("./fold_mode").FoldMode;
  1568. var FoldMode = exports.FoldMode = function (commentRegex) {
  1569. if (commentRegex) {
  1570. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  1571. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  1572. }
  1573. };
  1574. oop.inherits(FoldMode, BaseFoldMode);
  1575. (function () {
  1576. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  1577. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  1578. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  1579. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  1580. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  1581. this._getFoldWidgetBase = this.getFoldWidget;
  1582. this.getFoldWidget = function (session, foldStyle, row) {
  1583. var line = session.getLine(row);
  1584. if (this.singleLineBlockCommentRe.test(line)) {
  1585. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  1586. return "";
  1587. }
  1588. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  1589. if (!fw && this.startRegionRe.test(line))
  1590. return "start"; // lineCommentRegionStart
  1591. return fw;
  1592. };
  1593. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  1594. var line = session.getLine(row);
  1595. if (this.startRegionRe.test(line))
  1596. return this.getCommentRegionBlock(session, line, row);
  1597. var match = line.match(this.foldingStartMarker);
  1598. if (match) {
  1599. var i = match.index;
  1600. if (match[1])
  1601. return this.openingBracketBlock(session, match[1], row, i);
  1602. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  1603. if (range && !range.isMultiLine()) {
  1604. if (forceMultiline) {
  1605. range = this.getSectionRange(session, row);
  1606. }
  1607. else if (foldStyle != "all")
  1608. range = null;
  1609. }
  1610. return range;
  1611. }
  1612. if (foldStyle === "markbegin")
  1613. return;
  1614. var match = line.match(this.foldingStopMarker);
  1615. if (match) {
  1616. var i = match.index + match[0].length;
  1617. if (match[1])
  1618. return this.closingBracketBlock(session, match[1], row, i);
  1619. return session.getCommentFoldRange(row, i, -1);
  1620. }
  1621. };
  1622. this.getSectionRange = function (session, row) {
  1623. var line = session.getLine(row);
  1624. var startIndent = line.search(/\S/);
  1625. var startRow = row;
  1626. var startColumn = line.length;
  1627. row = row + 1;
  1628. var endRow = row;
  1629. var maxRow = session.getLength();
  1630. while (++row < maxRow) {
  1631. line = session.getLine(row);
  1632. var indent = line.search(/\S/);
  1633. if (indent === -1)
  1634. continue;
  1635. if (startIndent > indent)
  1636. break;
  1637. var subRange = this.getFoldWidgetRange(session, "all", row);
  1638. if (subRange) {
  1639. if (subRange.start.row <= startRow) {
  1640. break;
  1641. }
  1642. else if (subRange.isMultiLine()) {
  1643. row = subRange.end.row;
  1644. }
  1645. else if (startIndent == indent) {
  1646. break;
  1647. }
  1648. }
  1649. endRow = row;
  1650. }
  1651. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1652. };
  1653. this.getCommentRegionBlock = function (session, line, row) {
  1654. var startColumn = line.search(/\s*$/);
  1655. var maxRow = session.getLength();
  1656. var startRow = row;
  1657. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1658. var depth = 1;
  1659. while (++row < maxRow) {
  1660. line = session.getLine(row);
  1661. var m = re.exec(line);
  1662. if (!m)
  1663. continue;
  1664. if (m[1])
  1665. depth--;
  1666. else
  1667. depth++;
  1668. if (!depth)
  1669. break;
  1670. }
  1671. var endRow = row;
  1672. if (endRow > startRow) {
  1673. return new Range(startRow, startColumn, endRow, line.length);
  1674. }
  1675. };
  1676. }).call(FoldMode.prototype);
  1677. });
  1678. ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  1679. var oop = require("../lib/oop");
  1680. var TextMode = require("./text").Mode;
  1681. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1682. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1683. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1684. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  1685. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1686. var Mode = function () {
  1687. this.HighlightRules = JavaScriptHighlightRules;
  1688. this.$outdent = new MatchingBraceOutdent();
  1689. this.$behaviour = new CstyleBehaviour();
  1690. this.foldingRules = new CStyleFoldMode();
  1691. };
  1692. oop.inherits(Mode, TextMode);
  1693. (function () {
  1694. this.lineCommentStart = "//";
  1695. this.blockComment = { start: "/*", end: "*/" };
  1696. this.$quotes = { '"': '"', "'": "'", "`": "`" };
  1697. this.getNextLineIndent = function (state, line, tab) {
  1698. var indent = this.$getIndent(line);
  1699. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  1700. var tokens = tokenizedLine.tokens;
  1701. var endState = tokenizedLine.state;
  1702. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  1703. return indent;
  1704. }
  1705. if (state == "start" || state == "no_regex") {
  1706. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  1707. if (match) {
  1708. indent += tab;
  1709. }
  1710. }
  1711. else if (state == "doc-start") {
  1712. if (endState == "start" || endState == "no_regex") {
  1713. return "";
  1714. }
  1715. var match = line.match(/^\s*(\/?)\*/);
  1716. if (match) {
  1717. if (match[1]) {
  1718. indent += " ";
  1719. }
  1720. indent += "* ";
  1721. }
  1722. }
  1723. return indent;
  1724. };
  1725. this.checkOutdent = function (state, line, input) {
  1726. return this.$outdent.checkOutdent(line, input);
  1727. };
  1728. this.autoOutdent = function (state, doc, row) {
  1729. this.$outdent.autoOutdent(doc, row);
  1730. };
  1731. this.createWorker = function (session) {
  1732. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  1733. worker.attachToDocument(session.getDocument());
  1734. worker.on("annotate", function (results) {
  1735. session.setAnnotations(results.data);
  1736. });
  1737. worker.on("terminate", function () {
  1738. session.clearAnnotations();
  1739. });
  1740. return worker;
  1741. };
  1742. this.$id = "ace/mode/javascript";
  1743. this.snippetFileId = "ace/snippets/javascript";
  1744. }).call(Mode.prototype);
  1745. exports.Mode = Mode;
  1746. });
  1747. ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
  1748. var propertyMap = {
  1749. "background": { "#$0": 1 },
  1750. "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
  1751. "background-image": { "url('/$0')": 1 },
  1752. "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
  1753. "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
  1754. "background-attachment": { "scroll": 1, "fixed": 1 },
  1755. "background-size": { "cover": 1, "contain": 1 },
  1756. "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
  1757. "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
  1758. "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
  1759. "border-color": { "#$0": 1 },
  1760. "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
  1761. "border-collapse": { "collapse": 1, "separate": 1 },
  1762. "bottom": { "px": 1, "em": 1, "%": 1 },
  1763. "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
  1764. "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
  1765. "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
  1766. "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
  1767. "empty-cells": { "show": 1, "hide": 1 },
  1768. "float": { "left": 1, "right": 1, "none": 1 },
  1769. "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
  1770. "font-size": { "px": 1, "em": 1, "%": 1 },
  1771. "font-weight": { "bold": 1, "normal": 1 },
  1772. "font-style": { "italic": 1, "normal": 1 },
  1773. "font-variant": { "normal": 1, "small-caps": 1 },
  1774. "height": { "px": 1, "em": 1, "%": 1 },
  1775. "left": { "px": 1, "em": 1, "%": 1 },
  1776. "letter-spacing": { "normal": 1 },
  1777. "line-height": { "normal": 1 },
  1778. "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
  1779. "margin": { "px": 1, "em": 1, "%": 1 },
  1780. "margin-right": { "px": 1, "em": 1, "%": 1 },
  1781. "margin-left": { "px": 1, "em": 1, "%": 1 },
  1782. "margin-top": { "px": 1, "em": 1, "%": 1 },
  1783. "margin-bottom": { "px": 1, "em": 1, "%": 1 },
  1784. "max-height": { "px": 1, "em": 1, "%": 1 },
  1785. "max-width": { "px": 1, "em": 1, "%": 1 },
  1786. "min-height": { "px": 1, "em": 1, "%": 1 },
  1787. "min-width": { "px": 1, "em": 1, "%": 1 },
  1788. "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1789. "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1790. "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
  1791. "padding": { "px": 1, "em": 1, "%": 1 },
  1792. "padding-top": { "px": 1, "em": 1, "%": 1 },
  1793. "padding-right": { "px": 1, "em": 1, "%": 1 },
  1794. "padding-bottom": { "px": 1, "em": 1, "%": 1 },
  1795. "padding-left": { "px": 1, "em": 1, "%": 1 },
  1796. "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
  1797. "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
  1798. "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
  1799. "right": { "px": 1, "em": 1, "%": 1 },
  1800. "table-layout": { "fixed": 1, "auto": 1 },
  1801. "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
  1802. "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
  1803. "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
  1804. "top": { "px": 1, "em": 1, "%": 1 },
  1805. "vertical-align": { "top": 1, "bottom": 1 },
  1806. "visibility": { "hidden": 1, "visible": 1 },
  1807. "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
  1808. "width": { "px": 1, "em": 1, "%": 1 },
  1809. "word-spacing": { "normal": 1 },
  1810. "filter": { "alpha(opacity=$0100)": 1 },
  1811. "text-shadow": { "$02px 2px 2px #777": 1 },
  1812. "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
  1813. "-moz-border-radius": 1,
  1814. "-moz-border-radius-topright": 1,
  1815. "-moz-border-radius-bottomright": 1,
  1816. "-moz-border-radius-topleft": 1,
  1817. "-moz-border-radius-bottomleft": 1,
  1818. "-webkit-border-radius": 1,
  1819. "-webkit-border-top-right-radius": 1,
  1820. "-webkit-border-top-left-radius": 1,
  1821. "-webkit-border-bottom-right-radius": 1,
  1822. "-webkit-border-bottom-left-radius": 1,
  1823. "-moz-box-shadow": 1,
  1824. "-webkit-box-shadow": 1,
  1825. "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
  1826. "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
  1827. "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
  1828. };
  1829. var CssCompletions = function () {
  1830. };
  1831. (function () {
  1832. this.completionsDefined = false;
  1833. this.defineCompletions = function () {
  1834. if (document) {
  1835. var style = document.createElement('c').style;
  1836. for (var i in style) {
  1837. if (typeof style[i] !== 'string')
  1838. continue;
  1839. var name = i.replace(/[A-Z]/g, function (x) {
  1840. return '-' + x.toLowerCase();
  1841. });
  1842. if (!propertyMap.hasOwnProperty(name))
  1843. propertyMap[name] = 1;
  1844. }
  1845. }
  1846. this.completionsDefined = true;
  1847. };
  1848. this.getCompletions = function (state, session, pos, prefix) {
  1849. if (!this.completionsDefined) {
  1850. this.defineCompletions();
  1851. }
  1852. if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
  1853. var line = session.getLine(pos.row).substr(0, pos.column);
  1854. var inParens = /\([^)]*$/.test(line);
  1855. if (inParens) {
  1856. line = line.substr(line.lastIndexOf('(') + 1);
  1857. }
  1858. if (/:[^;]+$/.test(line)) {
  1859. /([\w\-]+):[^:]*$/.test(line);
  1860. return this.getPropertyValueCompletions(state, session, pos, prefix);
  1861. }
  1862. else {
  1863. return this.getPropertyCompletions(state, session, pos, prefix, inParens);
  1864. }
  1865. }
  1866. return [];
  1867. };
  1868. this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
  1869. skipSemicolon = skipSemicolon || false;
  1870. var properties = Object.keys(propertyMap);
  1871. return properties.map(function (property) {
  1872. return {
  1873. caption: property,
  1874. snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
  1875. meta: "property",
  1876. score: 1000000
  1877. };
  1878. });
  1879. };
  1880. this.getPropertyValueCompletions = function (state, session, pos, prefix) {
  1881. var line = session.getLine(pos.row).substr(0, pos.column);
  1882. var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
  1883. if (!property)
  1884. return [];
  1885. var values = [];
  1886. if (property in propertyMap && typeof propertyMap[property] === "object") {
  1887. values = Object.keys(propertyMap[property]);
  1888. }
  1889. return values.map(function (value) {
  1890. return {
  1891. caption: value,
  1892. snippet: value,
  1893. meta: "property value",
  1894. score: 1000000
  1895. };
  1896. });
  1897. };
  1898. }).call(CssCompletions.prototype);
  1899. exports.CssCompletions = CssCompletions;
  1900. });
  1901. ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
  1902. var oop = require("../../lib/oop");
  1903. var Behaviour = require("../behaviour").Behaviour;
  1904. var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
  1905. var TokenIterator = require("../../token_iterator").TokenIterator;
  1906. var CssBehaviour = function () {
  1907. this.inherit(CstyleBehaviour);
  1908. this.add("colon", "insertion", function (state, action, editor, session, text) {
  1909. if (text === ':' && editor.selection.isEmpty()) {
  1910. var cursor = editor.getCursorPosition();
  1911. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1912. var token = iterator.getCurrentToken();
  1913. if (token && token.value.match(/\s+/)) {
  1914. token = iterator.stepBackward();
  1915. }
  1916. if (token && token.type === 'support.type') {
  1917. var line = session.doc.getLine(cursor.row);
  1918. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1919. if (rightChar === ':') {
  1920. return {
  1921. text: '',
  1922. selection: [1, 1]
  1923. };
  1924. }
  1925. if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
  1926. return {
  1927. text: ':;',
  1928. selection: [1, 1]
  1929. };
  1930. }
  1931. }
  1932. }
  1933. });
  1934. this.add("colon", "deletion", function (state, action, editor, session, range) {
  1935. var selected = session.doc.getTextRange(range);
  1936. if (!range.isMultiLine() && selected === ':') {
  1937. var cursor = editor.getCursorPosition();
  1938. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1939. var token = iterator.getCurrentToken();
  1940. if (token && token.value.match(/\s+/)) {
  1941. token = iterator.stepBackward();
  1942. }
  1943. if (token && token.type === 'support.type') {
  1944. var line = session.doc.getLine(range.start.row);
  1945. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1946. if (rightChar === ';') {
  1947. range.end.column++;
  1948. return range;
  1949. }
  1950. }
  1951. }
  1952. });
  1953. this.add("semicolon", "insertion", function (state, action, editor, session, text) {
  1954. if (text === ';' && editor.selection.isEmpty()) {
  1955. var cursor = editor.getCursorPosition();
  1956. var line = session.doc.getLine(cursor.row);
  1957. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1958. if (rightChar === ';') {
  1959. return {
  1960. text: '',
  1961. selection: [1, 1]
  1962. };
  1963. }
  1964. }
  1965. });
  1966. this.add("!important", "insertion", function (state, action, editor, session, text) {
  1967. if (text === '!' && editor.selection.isEmpty()) {
  1968. var cursor = editor.getCursorPosition();
  1969. var line = session.doc.getLine(cursor.row);
  1970. if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
  1971. return {
  1972. text: '!important',
  1973. selection: [10, 10]
  1974. };
  1975. }
  1976. }
  1977. });
  1978. };
  1979. oop.inherits(CssBehaviour, CstyleBehaviour);
  1980. exports.CssBehaviour = CssBehaviour;
  1981. });
  1982. ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  1983. var oop = require("../lib/oop");
  1984. var TextMode = require("./text").Mode;
  1985. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1986. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1987. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1988. var CssCompletions = require("./css_completions").CssCompletions;
  1989. var CssBehaviour = require("./behaviour/css").CssBehaviour;
  1990. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1991. var Mode = function () {
  1992. this.HighlightRules = CssHighlightRules;
  1993. this.$outdent = new MatchingBraceOutdent();
  1994. this.$behaviour = new CssBehaviour();
  1995. this.$completer = new CssCompletions();
  1996. this.foldingRules = new CStyleFoldMode();
  1997. };
  1998. oop.inherits(Mode, TextMode);
  1999. (function () {
  2000. this.foldingRules = "cStyle";
  2001. this.blockComment = { start: "/*", end: "*/" };
  2002. this.getNextLineIndent = function (state, line, tab) {
  2003. var indent = this.$getIndent(line);
  2004. var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
  2005. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  2006. return indent;
  2007. }
  2008. var match = line.match(/^.*\{\s*$/);
  2009. if (match) {
  2010. indent += tab;
  2011. }
  2012. return indent;
  2013. };
  2014. this.checkOutdent = function (state, line, input) {
  2015. return this.$outdent.checkOutdent(line, input);
  2016. };
  2017. this.autoOutdent = function (state, doc, row) {
  2018. this.$outdent.autoOutdent(doc, row);
  2019. };
  2020. this.getCompletions = function (state, session, pos, prefix) {
  2021. return this.$completer.getCompletions(state, session, pos, prefix);
  2022. };
  2023. this.createWorker = function (session) {
  2024. var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
  2025. worker.attachToDocument(session.getDocument());
  2026. worker.on("annotate", function (e) {
  2027. session.setAnnotations(e.data);
  2028. });
  2029. worker.on("terminate", function () {
  2030. session.clearAnnotations();
  2031. });
  2032. return worker;
  2033. };
  2034. this.$id = "ace/mode/css";
  2035. this.snippetFileId = "ace/snippets/css";
  2036. }).call(Mode.prototype);
  2037. exports.Mode = Mode;
  2038. });
  2039. ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
  2040. var oop = require("../../lib/oop");
  2041. var Behaviour = require("../behaviour").Behaviour;
  2042. var TokenIterator = require("../../token_iterator").TokenIterator;
  2043. var lang = require("../../lib/lang");
  2044. function is(token, type) {
  2045. return token && token.type.lastIndexOf(type + ".xml") > -1;
  2046. }
  2047. var XmlBehaviour = function () {
  2048. this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
  2049. if (text == '"' || text == "'") {
  2050. var quote = text;
  2051. var selected = session.doc.getTextRange(editor.getSelectionRange());
  2052. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  2053. return {
  2054. text: quote + selected + quote,
  2055. selection: false
  2056. };
  2057. }
  2058. var cursor = editor.getCursorPosition();
  2059. var line = session.doc.getLine(cursor.row);
  2060. var rightChar = line.substring(cursor.column, cursor.column + 1);
  2061. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  2062. var token = iterator.getCurrentToken();
  2063. if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
  2064. return {
  2065. text: "",
  2066. selection: [1, 1]
  2067. };
  2068. }
  2069. if (!token)
  2070. token = iterator.stepBackward();
  2071. if (!token)
  2072. return;
  2073. while (is(token, "tag-whitespace") || is(token, "whitespace")) {
  2074. token = iterator.stepBackward();
  2075. }
  2076. var rightSpace = !rightChar || rightChar.match(/\s/);
  2077. if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
  2078. return {
  2079. text: quote + quote,
  2080. selection: [1, 1]
  2081. };
  2082. }
  2083. }
  2084. });
  2085. this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
  2086. var selected = session.doc.getTextRange(range);
  2087. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  2088. var line = session.doc.getLine(range.start.row);
  2089. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  2090. if (rightChar == selected) {
  2091. range.end.column++;
  2092. return range;
  2093. }
  2094. }
  2095. });
  2096. this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
  2097. if (text == '>') {
  2098. var position = editor.getSelectionRange().start;
  2099. var iterator = new TokenIterator(session, position.row, position.column);
  2100. var token = iterator.getCurrentToken() || iterator.stepBackward();
  2101. if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
  2102. return;
  2103. if (is(token, "reference.attribute-value"))
  2104. return;
  2105. if (is(token, "attribute-value")) {
  2106. var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
  2107. if (position.column < tokenEndColumn)
  2108. return;
  2109. if (position.column == tokenEndColumn) {
  2110. var nextToken = iterator.stepForward();
  2111. if (nextToken && is(nextToken, "attribute-value"))
  2112. return;
  2113. iterator.stepBackward();
  2114. }
  2115. }
  2116. if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
  2117. return;
  2118. while (!is(token, "tag-name")) {
  2119. token = iterator.stepBackward();
  2120. if (token.value == "<") {
  2121. token = iterator.stepForward();
  2122. break;
  2123. }
  2124. }
  2125. var tokenRow = iterator.getCurrentTokenRow();
  2126. var tokenColumn = iterator.getCurrentTokenColumn();
  2127. if (is(iterator.stepBackward(), "end-tag-open"))
  2128. return;
  2129. var element = token.value;
  2130. if (tokenRow == position.row)
  2131. element = element.substring(0, position.column - tokenColumn);
  2132. if (this.voidElements.hasOwnProperty(element.toLowerCase()))
  2133. return;
  2134. return {
  2135. text: ">" + "</" + element + ">",
  2136. selection: [1, 1]
  2137. };
  2138. }
  2139. });
  2140. this.add("autoindent", "insertion", function (state, action, editor, session, text) {
  2141. if (text == "\n") {
  2142. var cursor = editor.getCursorPosition();
  2143. var line = session.getLine(cursor.row);
  2144. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  2145. var token = iterator.getCurrentToken();
  2146. if (token && token.type.indexOf("tag-close") !== -1) {
  2147. if (token.value == "/>")
  2148. return;
  2149. while (token && token.type.indexOf("tag-name") === -1) {
  2150. token = iterator.stepBackward();
  2151. }
  2152. if (!token) {
  2153. return;
  2154. }
  2155. var tag = token.value;
  2156. var row = iterator.getCurrentTokenRow();
  2157. token = iterator.stepBackward();
  2158. if (!token || token.type.indexOf("end-tag") !== -1) {
  2159. return;
  2160. }
  2161. if (this.voidElements && !this.voidElements[tag]) {
  2162. var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
  2163. var line = session.getLine(row);
  2164. var nextIndent = this.$getIndent(line);
  2165. var indent = nextIndent + session.getTabString();
  2166. if (nextToken && nextToken.value === "</") {
  2167. return {
  2168. text: "\n" + indent + "\n" + nextIndent,
  2169. selection: [1, indent.length, 1, indent.length]
  2170. };
  2171. }
  2172. else {
  2173. return {
  2174. text: "\n" + indent
  2175. };
  2176. }
  2177. }
  2178. }
  2179. }
  2180. });
  2181. };
  2182. oop.inherits(XmlBehaviour, Behaviour);
  2183. exports.XmlBehaviour = XmlBehaviour;
  2184. });
  2185. ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  2186. var oop = require("../../lib/oop");
  2187. var BaseFoldMode = require("./fold_mode").FoldMode;
  2188. var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
  2189. this.defaultMode = defaultMode;
  2190. this.subModes = subModes;
  2191. };
  2192. oop.inherits(FoldMode, BaseFoldMode);
  2193. (function () {
  2194. this.$getMode = function (state) {
  2195. if (typeof state != "string")
  2196. state = state[0];
  2197. for (var key in this.subModes) {
  2198. if (state.indexOf(key) === 0)
  2199. return this.subModes[key];
  2200. }
  2201. return null;
  2202. };
  2203. this.$tryMode = function (state, session, foldStyle, row) {
  2204. var mode = this.$getMode(state);
  2205. return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
  2206. };
  2207. this.getFoldWidget = function (session, foldStyle, row) {
  2208. return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
  2209. this.$tryMode(session.getState(row), session, foldStyle, row) ||
  2210. this.defaultMode.getFoldWidget(session, foldStyle, row));
  2211. };
  2212. this.getFoldWidgetRange = function (session, foldStyle, row) {
  2213. var mode = this.$getMode(session.getState(row - 1));
  2214. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  2215. mode = this.$getMode(session.getState(row));
  2216. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  2217. mode = this.defaultMode;
  2218. return mode.getFoldWidgetRange(session, foldStyle, row);
  2219. };
  2220. }).call(FoldMode.prototype);
  2221. });
  2222. ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module){"use strict";
  2223. var oop = require("../../lib/oop");
  2224. var lang = require("../../lib/lang");
  2225. var Range = require("../../range").Range;
  2226. var BaseFoldMode = require("./fold_mode").FoldMode;
  2227. var TokenIterator = require("../../token_iterator").TokenIterator;
  2228. var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
  2229. BaseFoldMode.call(this);
  2230. this.voidElements = voidElements || {};
  2231. this.optionalEndTags = oop.mixin({}, this.voidElements);
  2232. if (optionalEndTags)
  2233. oop.mixin(this.optionalEndTags, optionalEndTags);
  2234. };
  2235. oop.inherits(FoldMode, BaseFoldMode);
  2236. var Tag = function () {
  2237. this.tagName = "";
  2238. this.closing = false;
  2239. this.selfClosing = false;
  2240. this.start = { row: 0, column: 0 };
  2241. this.end = { row: 0, column: 0 };
  2242. };
  2243. function is(token, type) {
  2244. return token.type.lastIndexOf(type + ".xml") > -1;
  2245. }
  2246. (function () {
  2247. this.getFoldWidget = function (session, foldStyle, row) {
  2248. var tag = this._getFirstTagInLine(session, row);
  2249. if (!tag)
  2250. return this.getCommentFoldWidget(session, row);
  2251. if (tag.closing || (!tag.tagName && tag.selfClosing))
  2252. return foldStyle == "markbeginend" ? "end" : "";
  2253. if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
  2254. return "";
  2255. if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
  2256. return "";
  2257. return "start";
  2258. };
  2259. this.getCommentFoldWidget = function (session, row) {
  2260. if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
  2261. return "start";
  2262. return "";
  2263. };
  2264. this._getFirstTagInLine = function (session, row) {
  2265. var tokens = session.getTokens(row);
  2266. var tag = new Tag();
  2267. for (var i = 0; i < tokens.length; i++) {
  2268. var token = tokens[i];
  2269. if (is(token, "tag-open")) {
  2270. tag.end.column = tag.start.column + token.value.length;
  2271. tag.closing = is(token, "end-tag-open");
  2272. token = tokens[++i];
  2273. if (!token)
  2274. return null;
  2275. tag.tagName = token.value;
  2276. tag.end.column += token.value.length;
  2277. for (i++; i < tokens.length; i++) {
  2278. token = tokens[i];
  2279. tag.end.column += token.value.length;
  2280. if (is(token, "tag-close")) {
  2281. tag.selfClosing = token.value == '/>';
  2282. break;
  2283. }
  2284. }
  2285. return tag;
  2286. }
  2287. else if (is(token, "tag-close")) {
  2288. tag.selfClosing = token.value == '/>';
  2289. return tag;
  2290. }
  2291. tag.start.column += token.value.length;
  2292. }
  2293. return null;
  2294. };
  2295. this._findEndTagInLine = function (session, row, tagName, startColumn) {
  2296. var tokens = session.getTokens(row);
  2297. var column = 0;
  2298. for (var i = 0; i < tokens.length; i++) {
  2299. var token = tokens[i];
  2300. column += token.value.length;
  2301. if (column < startColumn)
  2302. continue;
  2303. if (is(token, "end-tag-open")) {
  2304. token = tokens[i + 1];
  2305. if (token && token.value == tagName)
  2306. return true;
  2307. }
  2308. }
  2309. return false;
  2310. };
  2311. this._readTagForward = function (iterator) {
  2312. var token = iterator.getCurrentToken();
  2313. if (!token)
  2314. return null;
  2315. var tag = new Tag();
  2316. do {
  2317. if (is(token, "tag-open")) {
  2318. tag.closing = is(token, "end-tag-open");
  2319. tag.start.row = iterator.getCurrentTokenRow();
  2320. tag.start.column = iterator.getCurrentTokenColumn();
  2321. }
  2322. else if (is(token, "tag-name")) {
  2323. tag.tagName = token.value;
  2324. }
  2325. else if (is(token, "tag-close")) {
  2326. tag.selfClosing = token.value == "/>";
  2327. tag.end.row = iterator.getCurrentTokenRow();
  2328. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  2329. iterator.stepForward();
  2330. return tag;
  2331. }
  2332. } while (token = iterator.stepForward());
  2333. return null;
  2334. };
  2335. this._readTagBackward = function (iterator) {
  2336. var token = iterator.getCurrentToken();
  2337. if (!token)
  2338. return null;
  2339. var tag = new Tag();
  2340. do {
  2341. if (is(token, "tag-open")) {
  2342. tag.closing = is(token, "end-tag-open");
  2343. tag.start.row = iterator.getCurrentTokenRow();
  2344. tag.start.column = iterator.getCurrentTokenColumn();
  2345. iterator.stepBackward();
  2346. return tag;
  2347. }
  2348. else if (is(token, "tag-name")) {
  2349. tag.tagName = token.value;
  2350. }
  2351. else if (is(token, "tag-close")) {
  2352. tag.selfClosing = token.value == "/>";
  2353. tag.end.row = iterator.getCurrentTokenRow();
  2354. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  2355. }
  2356. } while (token = iterator.stepBackward());
  2357. return null;
  2358. };
  2359. this._pop = function (stack, tag) {
  2360. while (stack.length) {
  2361. var top = stack[stack.length - 1];
  2362. if (!tag || top.tagName == tag.tagName) {
  2363. return stack.pop();
  2364. }
  2365. else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
  2366. stack.pop();
  2367. continue;
  2368. }
  2369. else {
  2370. return null;
  2371. }
  2372. }
  2373. };
  2374. this.getFoldWidgetRange = function (session, foldStyle, row) {
  2375. var firstTag = this._getFirstTagInLine(session, row);
  2376. if (!firstTag) {
  2377. return this.getCommentFoldWidget(session, row)
  2378. && session.getCommentFoldRange(row, session.getLine(row).length);
  2379. }
  2380. var isBackward = firstTag.closing || firstTag.selfClosing;
  2381. var stack = [];
  2382. var tag;
  2383. if (!isBackward) {
  2384. var iterator = new TokenIterator(session, row, firstTag.start.column);
  2385. var start = {
  2386. row: row,
  2387. column: firstTag.start.column + firstTag.tagName.length + 2
  2388. };
  2389. if (firstTag.start.row == firstTag.end.row)
  2390. start.column = firstTag.end.column;
  2391. while (tag = this._readTagForward(iterator)) {
  2392. if (tag.selfClosing) {
  2393. if (!stack.length) {
  2394. tag.start.column += tag.tagName.length + 2;
  2395. tag.end.column -= 2;
  2396. return Range.fromPoints(tag.start, tag.end);
  2397. }
  2398. else
  2399. continue;
  2400. }
  2401. if (tag.closing) {
  2402. this._pop(stack, tag);
  2403. if (stack.length == 0)
  2404. return Range.fromPoints(start, tag.start);
  2405. }
  2406. else {
  2407. stack.push(tag);
  2408. }
  2409. }
  2410. }
  2411. else {
  2412. var iterator = new TokenIterator(session, row, firstTag.end.column);
  2413. var end = {
  2414. row: row,
  2415. column: firstTag.start.column
  2416. };
  2417. while (tag = this._readTagBackward(iterator)) {
  2418. if (tag.selfClosing) {
  2419. if (!stack.length) {
  2420. tag.start.column += tag.tagName.length + 2;
  2421. tag.end.column -= 2;
  2422. return Range.fromPoints(tag.start, tag.end);
  2423. }
  2424. else
  2425. continue;
  2426. }
  2427. if (!tag.closing) {
  2428. this._pop(stack, tag);
  2429. if (stack.length == 0) {
  2430. tag.start.column += tag.tagName.length + 2;
  2431. if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
  2432. tag.start.column = tag.end.column;
  2433. return Range.fromPoints(tag.start, end);
  2434. }
  2435. }
  2436. else {
  2437. stack.push(tag);
  2438. }
  2439. }
  2440. }
  2441. };
  2442. }).call(FoldMode.prototype);
  2443. });
  2444. ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  2445. var oop = require("../../lib/oop");
  2446. var MixedFoldMode = require("./mixed").FoldMode;
  2447. var XmlFoldMode = require("./xml").FoldMode;
  2448. var CStyleFoldMode = require("./cstyle").FoldMode;
  2449. var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
  2450. MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
  2451. "js-": new CStyleFoldMode(),
  2452. "css-": new CStyleFoldMode()
  2453. });
  2454. };
  2455. oop.inherits(FoldMode, MixedFoldMode);
  2456. });
  2457. ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module){"use strict";
  2458. var TokenIterator = require("../token_iterator").TokenIterator;
  2459. var commonAttributes = [
  2460. "accesskey",
  2461. "class",
  2462. "contenteditable",
  2463. "contextmenu",
  2464. "dir",
  2465. "draggable",
  2466. "dropzone",
  2467. "hidden",
  2468. "id",
  2469. "inert",
  2470. "itemid",
  2471. "itemprop",
  2472. "itemref",
  2473. "itemscope",
  2474. "itemtype",
  2475. "lang",
  2476. "spellcheck",
  2477. "style",
  2478. "tabindex",
  2479. "title",
  2480. "translate"
  2481. ];
  2482. var eventAttributes = [
  2483. "onabort",
  2484. "onblur",
  2485. "oncancel",
  2486. "oncanplay",
  2487. "oncanplaythrough",
  2488. "onchange",
  2489. "onclick",
  2490. "onclose",
  2491. "oncontextmenu",
  2492. "oncuechange",
  2493. "ondblclick",
  2494. "ondrag",
  2495. "ondragend",
  2496. "ondragenter",
  2497. "ondragleave",
  2498. "ondragover",
  2499. "ondragstart",
  2500. "ondrop",
  2501. "ondurationchange",
  2502. "onemptied",
  2503. "onended",
  2504. "onerror",
  2505. "onfocus",
  2506. "oninput",
  2507. "oninvalid",
  2508. "onkeydown",
  2509. "onkeypress",
  2510. "onkeyup",
  2511. "onload",
  2512. "onloadeddata",
  2513. "onloadedmetadata",
  2514. "onloadstart",
  2515. "onmousedown",
  2516. "onmousemove",
  2517. "onmouseout",
  2518. "onmouseover",
  2519. "onmouseup",
  2520. "onmousewheel",
  2521. "onpause",
  2522. "onplay",
  2523. "onplaying",
  2524. "onprogress",
  2525. "onratechange",
  2526. "onreset",
  2527. "onscroll",
  2528. "onseeked",
  2529. "onseeking",
  2530. "onselect",
  2531. "onshow",
  2532. "onstalled",
  2533. "onsubmit",
  2534. "onsuspend",
  2535. "ontimeupdate",
  2536. "onvolumechange",
  2537. "onwaiting"
  2538. ];
  2539. var globalAttributes = commonAttributes.concat(eventAttributes);
  2540. var attributeMap = {
  2541. "a": { "href": 1, "target": { "_blank": 1, "top": 1 }, "ping": 1, "rel": { "nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1 }, "media": 1, "hreflang": 1, "type": 1 },
  2542. "abbr": {},
  2543. "address": {},
  2544. "area": { "shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1 },
  2545. "article": { "pubdate": 1 },
  2546. "aside": {},
  2547. "audio": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
  2548. "b": {},
  2549. "base": { "href": 1, "target": 1 },
  2550. "bdi": {},
  2551. "bdo": {},
  2552. "blockquote": { "cite": 1 },
  2553. "body": { "onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1 },
  2554. "br": {},
  2555. "button": { "autofocus": 1, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": { "button": 1, "submit": 1 } },
  2556. "canvas": { "width": 1, "height": 1 },
  2557. "caption": {},
  2558. "cite": {},
  2559. "code": {},
  2560. "col": { "span": 1 },
  2561. "colgroup": { "span": 1 },
  2562. "command": { "type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1 },
  2563. "data": {},
  2564. "datalist": {},
  2565. "dd": {},
  2566. "del": { "cite": 1, "datetime": 1 },
  2567. "details": { "open": 1 },
  2568. "dfn": {},
  2569. "dialog": { "open": 1 },
  2570. "div": {},
  2571. "dl": {},
  2572. "dt": {},
  2573. "em": {},
  2574. "embed": { "src": 1, "height": 1, "width": 1, "type": 1 },
  2575. "fieldset": { "disabled": 1, "form": 1, "name": 1 },
  2576. "figcaption": {},
  2577. "figure": {},
  2578. "footer": {},
  2579. "form": { "accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": { "multipart/form-data": 1, "application/x-www-form-urlencoded": 1 }, "method": { "get": 1, "post": 1 }, "name": 1, "novalidate": 1, "target": { "_blank": 1, "top": 1 } },
  2580. "h1": {},
  2581. "h2": {},
  2582. "h3": {},
  2583. "h4": {},
  2584. "h5": {},
  2585. "h6": {},
  2586. "head": {},
  2587. "header": {},
  2588. "hr": {},
  2589. "html": { "manifest": 1 },
  2590. "i": {},
  2591. "iframe": { "name": 1, "src": 1, "height": 1, "width": 1, "sandbox": { "allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1 }, "seamless": { "seamless": 1 } },
  2592. "img": { "alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1 },
  2593. "input": {
  2594. "type": { "text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1 },
  2595. "accept": 1, "alt": 1, "autocomplete": { "on": 1, "off": 1 }, "autofocus": { "autofocus": 1 }, "checked": { "checked": 1 }, "disabled": { "disabled": 1 }, "form": 1, "formaction": 1, "formenctype": { "application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1 }, "formmethod": { "get": 1, "post": 1 }, "formnovalidate": { "formnovalidate": 1 }, "formtarget": { "_blank": 1, "_self": 1, "_parent": 1, "_top": 1 }, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": { "multiple": 1 }, "name": 1, "pattern": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1
  2596. },
  2597. "ins": { "cite": 1, "datetime": 1 },
  2598. "kbd": {},
  2599. "keygen": { "autofocus": 1, "challenge": { "challenge": 1 }, "disabled": { "disabled": 1 }, "form": 1, "keytype": { "rsa": 1, "dsa": 1, "ec": 1 }, "name": 1 },
  2600. "label": { "form": 1, "for": 1 },
  2601. "legend": {},
  2602. "li": { "value": 1 },
  2603. "link": { "href": 1, "hreflang": 1, "rel": { "stylesheet": 1, "icon": 1 }, "media": { "all": 1, "screen": 1, "print": 1 }, "type": { "text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1 }, "sizes": 1 },
  2604. "main": {},
  2605. "map": { "name": 1 },
  2606. "mark": {},
  2607. "math": {},
  2608. "menu": { "type": 1, "label": 1 },
  2609. "meta": { "http-equiv": { "content-type": 1 }, "name": { "description": 1, "keywords": 1 }, "content": { "text/html; charset=UTF-8": 1 }, "charset": 1 },
  2610. "meter": { "value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1 },
  2611. "nav": {},
  2612. "noscript": { "href": 1 },
  2613. "object": { "param": 1, "data": 1, "type": 1, "height": 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1 },
  2614. "ol": { "start": 1, "reversed": 1 },
  2615. "optgroup": { "disabled": 1, "label": 1 },
  2616. "option": { "disabled": 1, "selected": 1, "label": 1, "value": 1 },
  2617. "output": { "for": 1, "form": 1, "name": 1 },
  2618. "p": {},
  2619. "param": { "name": 1, "value": 1 },
  2620. "pre": {},
  2621. "progress": { "value": 1, "max": 1 },
  2622. "q": { "cite": 1 },
  2623. "rp": {},
  2624. "rt": {},
  2625. "ruby": {},
  2626. "s": {},
  2627. "samp": {},
  2628. "script": { "charset": 1, "type": { "text/javascript": 1 }, "src": 1, "defer": 1, "async": 1 },
  2629. "select": { "autofocus": 1, "disabled": 1, "form": 1, "multiple": { "multiple": 1 }, "name": 1, "size": 1, "readonly": { "readonly": 1 } },
  2630. "small": {},
  2631. "source": { "src": 1, "type": 1, "media": 1 },
  2632. "span": {},
  2633. "strong": {},
  2634. "style": { "type": 1, "media": { "all": 1, "screen": 1, "print": 1 }, "scoped": 1 },
  2635. "sub": {},
  2636. "sup": {},
  2637. "svg": {},
  2638. "table": { "summary": 1 },
  2639. "tbody": {},
  2640. "td": { "headers": 1, "rowspan": 1, "colspan": 1 },
  2641. "textarea": { "autofocus": { "autofocus": 1 }, "disabled": { "disabled": 1 }, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": { "readonly": 1 }, "required": { "required": 1 }, "rows": 1, "cols": 1, "wrap": { "on": 1, "off": 1, "hard": 1, "soft": 1 } },
  2642. "tfoot": {},
  2643. "th": { "headers": 1, "rowspan": 1, "colspan": 1, "scope": 1 },
  2644. "thead": {},
  2645. "time": { "datetime": 1 },
  2646. "title": {},
  2647. "tr": {},
  2648. "track": { "kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1 },
  2649. "section": {},
  2650. "summary": {},
  2651. "u": {},
  2652. "ul": {},
  2653. "var": {},
  2654. "video": { "src": 1, "autobuffer": 1, "autoplay": { "autoplay": 1 }, "loop": { "loop": 1 }, "controls": { "controls": 1 }, "width": 1, "height": 1, "poster": 1, "muted": { "muted": 1 }, "preload": { "auto": 1, "metadata": 1, "none": 1 } },
  2655. "wbr": {}
  2656. };
  2657. var elements = Object.keys(attributeMap);
  2658. function is(token, type) {
  2659. return token.type.lastIndexOf(type + ".xml") > -1;
  2660. }
  2661. function findTagName(session, pos) {
  2662. var iterator = new TokenIterator(session, pos.row, pos.column);
  2663. var token = iterator.getCurrentToken();
  2664. while (token && !is(token, "tag-name")) {
  2665. token = iterator.stepBackward();
  2666. }
  2667. if (token)
  2668. return token.value;
  2669. }
  2670. function findAttributeName(session, pos) {
  2671. var iterator = new TokenIterator(session, pos.row, pos.column);
  2672. var token = iterator.getCurrentToken();
  2673. while (token && !is(token, "attribute-name")) {
  2674. token = iterator.stepBackward();
  2675. }
  2676. if (token)
  2677. return token.value;
  2678. }
  2679. var HtmlCompletions = function () {
  2680. };
  2681. (function () {
  2682. this.getCompletions = function (state, session, pos, prefix) {
  2683. var token = session.getTokenAt(pos.row, pos.column);
  2684. if (!token)
  2685. return [];
  2686. if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
  2687. return this.getTagCompletions(state, session, pos, prefix);
  2688. if (is(token, "tag-whitespace") || is(token, "attribute-name"))
  2689. return this.getAttributeCompletions(state, session, pos, prefix);
  2690. if (is(token, "attribute-value"))
  2691. return this.getAttributeValueCompletions(state, session, pos, prefix);
  2692. var line = session.getLine(pos.row).substr(0, pos.column);
  2693. if (/&[a-z]*$/i.test(line))
  2694. return this.getHTMLEntityCompletions(state, session, pos, prefix);
  2695. return [];
  2696. };
  2697. this.getTagCompletions = function (state, session, pos, prefix) {
  2698. return elements.map(function (element) {
  2699. return {
  2700. value: element,
  2701. meta: "tag",
  2702. score: 1000000
  2703. };
  2704. });
  2705. };
  2706. this.getAttributeCompletions = function (state, session, pos, prefix) {
  2707. var tagName = findTagName(session, pos);
  2708. if (!tagName)
  2709. return [];
  2710. var attributes = globalAttributes;
  2711. if (tagName in attributeMap) {
  2712. attributes = attributes.concat(Object.keys(attributeMap[tagName]));
  2713. }
  2714. return attributes.map(function (attribute) {
  2715. return {
  2716. caption: attribute,
  2717. snippet: attribute + '="$0"',
  2718. meta: "attribute",
  2719. score: 1000000
  2720. };
  2721. });
  2722. };
  2723. this.getAttributeValueCompletions = function (state, session, pos, prefix) {
  2724. var tagName = findTagName(session, pos);
  2725. var attributeName = findAttributeName(session, pos);
  2726. if (!tagName)
  2727. return [];
  2728. var values = [];
  2729. if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
  2730. values = Object.keys(attributeMap[tagName][attributeName]);
  2731. }
  2732. return values.map(function (value) {
  2733. return {
  2734. caption: value,
  2735. snippet: value,
  2736. meta: "attribute value",
  2737. score: 1000000
  2738. };
  2739. });
  2740. };
  2741. this.getHTMLEntityCompletions = function (state, session, pos, prefix) {
  2742. var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
  2743. return values.map(function (value) {
  2744. return {
  2745. caption: value,
  2746. snippet: value,
  2747. meta: "html entity",
  2748. score: 1000000
  2749. };
  2750. });
  2751. };
  2752. }).call(HtmlCompletions.prototype);
  2753. exports.HtmlCompletions = HtmlCompletions;
  2754. });
  2755. ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module){"use strict";
  2756. var oop = require("../lib/oop");
  2757. var lang = require("../lib/lang");
  2758. var TextMode = require("./text").Mode;
  2759. var JavaScriptMode = require("./javascript").Mode;
  2760. var CssMode = require("./css").Mode;
  2761. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2762. var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
  2763. var HtmlFoldMode = require("./folding/html").FoldMode;
  2764. var HtmlCompletions = require("./html_completions").HtmlCompletions;
  2765. var WorkerClient = require("../worker/worker_client").WorkerClient;
  2766. var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
  2767. var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
  2768. var Mode = function (options) {
  2769. this.fragmentContext = options && options.fragmentContext;
  2770. this.HighlightRules = HtmlHighlightRules;
  2771. this.$behaviour = new XmlBehaviour();
  2772. this.$completer = new HtmlCompletions();
  2773. this.createModeDelegates({
  2774. "js-": JavaScriptMode,
  2775. "css-": CssMode
  2776. });
  2777. this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
  2778. };
  2779. oop.inherits(Mode, TextMode);
  2780. (function () {
  2781. this.blockComment = { start: "<!--", end: "-->" };
  2782. this.voidElements = lang.arrayToMap(voidElements);
  2783. this.getNextLineIndent = function (state, line, tab) {
  2784. return this.$getIndent(line);
  2785. };
  2786. this.checkOutdent = function (state, line, input) {
  2787. return false;
  2788. };
  2789. this.getCompletions = function (state, session, pos, prefix) {
  2790. return this.$completer.getCompletions(state, session, pos, prefix);
  2791. };
  2792. this.createWorker = function (session) {
  2793. if (this.constructor != Mode)
  2794. return;
  2795. var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
  2796. worker.attachToDocument(session.getDocument());
  2797. if (this.fragmentContext)
  2798. worker.call("setOptions", [{ context: this.fragmentContext }]);
  2799. worker.on("error", function (e) {
  2800. session.setAnnotations(e.data);
  2801. });
  2802. worker.on("terminate", function () {
  2803. session.clearAnnotations();
  2804. });
  2805. return worker;
  2806. };
  2807. this.$id = "ace/mode/html";
  2808. this.snippetFileId = "ace/snippets/html";
  2809. }).call(Mode.prototype);
  2810. exports.Mode = Mode;
  2811. });
  2812. ace.define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
  2813. var oop = require("../../lib/oop");
  2814. var BaseFoldMode = require("./fold_mode").FoldMode;
  2815. var Range = require("../../range").Range;
  2816. var TokenIterator = require("../../token_iterator").TokenIterator;
  2817. var FoldMode = exports.FoldMode = function () {
  2818. };
  2819. oop.inherits(FoldMode, BaseFoldMode);
  2820. (function () {
  2821. this.indentKeywords = {
  2822. "class": 1,
  2823. "def": 1,
  2824. "module": 1,
  2825. "do": 1,
  2826. "unless": 1,
  2827. "if": 1,
  2828. "while": 1,
  2829. "for": 1,
  2830. "until": 1,
  2831. "begin": 1,
  2832. "else": 0,
  2833. "elsif": 0,
  2834. "rescue": 0,
  2835. "ensure": 0,
  2836. "when": 0,
  2837. "end": -1,
  2838. "case": 1,
  2839. "=begin": 1,
  2840. "=end": -1
  2841. };
  2842. this.foldingStartMarker = /(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/;
  2843. this.foldingStopMarker = /(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/;
  2844. this.getFoldWidget = function (session, foldStyle, row) {
  2845. var line = session.getLine(row);
  2846. var isStart = this.foldingStartMarker.test(line);
  2847. var isEnd = this.foldingStopMarker.test(line);
  2848. if (isStart && !isEnd) {
  2849. var match = line.match(this.foldingStartMarker);
  2850. if (match[1]) {
  2851. if (match[1] == "if" || match[1] == "else" || match[1] == "while" || match[1] == "until" || match[1] == "unless") {
  2852. if (match[1] == "else" && /^\s*else\s*$/.test(line) === false) {
  2853. return;
  2854. }
  2855. if (/^\s*(?:if|else|while|until|unless)\s*/.test(line) === false) {
  2856. return;
  2857. }
  2858. }
  2859. if (match[1] == "when") {
  2860. if (/\sthen\s/.test(line) === true) {
  2861. return;
  2862. }
  2863. }
  2864. if (session.getTokenAt(row, match.index + 2).type === "keyword")
  2865. return "start";
  2866. }
  2867. else if (match[3]) {
  2868. if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
  2869. return "start";
  2870. }
  2871. else {
  2872. return "start";
  2873. }
  2874. }
  2875. if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
  2876. return "";
  2877. var match = line.match(this.foldingStopMarker);
  2878. if (match[3] === "end") {
  2879. if (session.getTokenAt(row, match.index + 1).type === "keyword")
  2880. return "end";
  2881. }
  2882. else if (match[1]) {
  2883. if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
  2884. return "end";
  2885. }
  2886. else
  2887. return "end";
  2888. };
  2889. this.getFoldWidgetRange = function (session, foldStyle, row) {
  2890. var line = session.doc.getLine(row);
  2891. var match = this.foldingStartMarker.exec(line);
  2892. if (match) {
  2893. if (match[1] || match[3])
  2894. return this.rubyBlock(session, row, match.index + 2);
  2895. return this.openingBracketBlock(session, "{", row, match.index);
  2896. }
  2897. var match = this.foldingStopMarker.exec(line);
  2898. if (match) {
  2899. if (match[3] === "end") {
  2900. if (session.getTokenAt(row, match.index + 1).type === "keyword")
  2901. return this.rubyBlock(session, row, match.index + 1);
  2902. }
  2903. if (match[1] === "=end") {
  2904. if (session.getTokenAt(row, match.index + 1).type === "comment.multiline")
  2905. return this.rubyBlock(session, row, match.index + 1);
  2906. }
  2907. return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
  2908. }
  2909. };
  2910. this.rubyBlock = function (session, row, column, tokenRange) {
  2911. var stream = new TokenIterator(session, row, column);
  2912. var token = stream.getCurrentToken();
  2913. if (!token || (token.type != "keyword" && token.type != "comment.multiline"))
  2914. return;
  2915. var val = token.value;
  2916. var line = session.getLine(row);
  2917. switch (token.value) {
  2918. case "if":
  2919. case "unless":
  2920. case "while":
  2921. case "until":
  2922. var checkToken = new RegExp("^\\s*" + token.value);
  2923. if (!checkToken.test(line)) {
  2924. return;
  2925. }
  2926. var dir = this.indentKeywords[val];
  2927. break;
  2928. case "when":
  2929. if (/\sthen\s/.test(line)) {
  2930. return;
  2931. }
  2932. case "elsif":
  2933. case "rescue":
  2934. case "ensure":
  2935. var dir = 1;
  2936. break;
  2937. case "else":
  2938. var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
  2939. if (!checkToken.test(line)) {
  2940. return;
  2941. }
  2942. var dir = 1;
  2943. break;
  2944. default:
  2945. var dir = this.indentKeywords[val];
  2946. break;
  2947. }
  2948. var stack = [val];
  2949. if (!dir)
  2950. return;
  2951. var startColumn = dir === -1 ? session.getLine(row - 1).length : session.getLine(row).length;
  2952. var startRow = row;
  2953. var ranges = [];
  2954. ranges.push(stream.getCurrentTokenRange());
  2955. stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
  2956. if (token.type == "comment.multiline") {
  2957. while (token = stream.step()) {
  2958. if (token.type !== "comment.multiline")
  2959. continue;
  2960. if (dir == 1) {
  2961. startColumn = 6;
  2962. if (token.value == "=end") {
  2963. break;
  2964. }
  2965. }
  2966. else {
  2967. if (token.value == "=begin") {
  2968. break;
  2969. }
  2970. }
  2971. }
  2972. }
  2973. else {
  2974. while (token = stream.step()) {
  2975. var ignore = false;
  2976. if (token.type !== "keyword")
  2977. continue;
  2978. var level = dir * this.indentKeywords[token.value];
  2979. line = session.getLine(stream.getCurrentTokenRow());
  2980. switch (token.value) {
  2981. case "do":
  2982. for (var i = stream.$tokenIndex - 1; i >= 0; i--) {
  2983. var prevToken = stream.$rowTokens[i];
  2984. if (prevToken && (prevToken.value == "while" || prevToken.value == "until" || prevToken.value == "for")) {
  2985. level = 0;
  2986. break;
  2987. }
  2988. }
  2989. break;
  2990. case "else":
  2991. var checkToken = new RegExp("^\\s*" + token.value + "\\s*$");
  2992. if (!checkToken.test(line) || val == "case") {
  2993. level = 0;
  2994. ignore = true;
  2995. }
  2996. break;
  2997. case "if":
  2998. case "unless":
  2999. case "while":
  3000. case "until":
  3001. var checkToken = new RegExp("^\\s*" + token.value);
  3002. if (!checkToken.test(line)) {
  3003. level = 0;
  3004. ignore = true;
  3005. }
  3006. break;
  3007. case "when":
  3008. if (/\sthen\s/.test(line) || val == "case") {
  3009. level = 0;
  3010. ignore = true;
  3011. }
  3012. break;
  3013. }
  3014. if (level > 0) {
  3015. stack.unshift(token.value);
  3016. }
  3017. else if (level <= 0 && ignore === false) {
  3018. stack.shift();
  3019. if (!stack.length) {
  3020. if ((val == "while" || val == "until" || val == "for") && token.value != "do") {
  3021. break;
  3022. }
  3023. if (token.value == "do" && dir == -1 && level != 0)
  3024. break;
  3025. if (token.value != "do")
  3026. break;
  3027. }
  3028. if (level === 0) {
  3029. stack.unshift(token.value);
  3030. }
  3031. }
  3032. }
  3033. }
  3034. if (!token)
  3035. return null;
  3036. if (tokenRange) {
  3037. ranges.push(stream.getCurrentTokenRange());
  3038. return ranges;
  3039. }
  3040. var row = stream.getCurrentTokenRow();
  3041. if (dir === -1) {
  3042. if (token.type === "comment.multiline") {
  3043. var endColumn = 6;
  3044. }
  3045. else {
  3046. var endColumn = session.getLine(row).length;
  3047. }
  3048. return new Range(row, endColumn, startRow - 1, startColumn);
  3049. }
  3050. else
  3051. return new Range(startRow, startColumn, row - 1, session.getLine(row - 1).length);
  3052. };
  3053. }).call(FoldMode.prototype);
  3054. });
  3055. ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/ruby"], function(require, exports, module){"use strict";
  3056. var oop = require("../lib/oop");
  3057. var TextMode = require("./text").Mode;
  3058. var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
  3059. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  3060. var Range = require("../range").Range;
  3061. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  3062. var FoldMode = require("./folding/ruby").FoldMode;
  3063. var Mode = function () {
  3064. this.HighlightRules = RubyHighlightRules;
  3065. this.$outdent = new MatchingBraceOutdent();
  3066. this.$behaviour = new CstyleBehaviour();
  3067. this.foldingRules = new FoldMode();
  3068. this.indentKeywords = this.foldingRules.indentKeywords;
  3069. };
  3070. oop.inherits(Mode, TextMode);
  3071. (function () {
  3072. this.lineCommentStart = "#";
  3073. this.getNextLineIndent = function (state, line, tab) {
  3074. var indent = this.$getIndent(line);
  3075. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  3076. var tokens = tokenizedLine.tokens;
  3077. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  3078. return indent;
  3079. }
  3080. if (state == "start") {
  3081. var match = line.match(/^.*[\{\(\[]\s*$/);
  3082. var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
  3083. var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
  3084. var startingConditional = line.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);
  3085. if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
  3086. indent += tab;
  3087. }
  3088. }
  3089. return indent;
  3090. };
  3091. this.checkOutdent = function (state, line, input) {
  3092. return /^\s+(end|else|rescue|ensure)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
  3093. };
  3094. this.autoOutdent = function (state, session, row) {
  3095. var line = session.getLine(row);
  3096. if (/}/.test(line))
  3097. return this.$outdent.autoOutdent(session, row);
  3098. var indent = this.$getIndent(line);
  3099. var prevLine = session.getLine(row - 1);
  3100. var prevIndent = this.$getIndent(prevLine);
  3101. var tab = session.getTabString();
  3102. if (prevIndent.length <= indent.length) {
  3103. if (indent.slice(-tab.length) == tab)
  3104. session.remove(new Range(row, indent.length - tab.length, row, indent.length));
  3105. }
  3106. };
  3107. this.getMatching = function (session, row, column) {
  3108. if (row == undefined) {
  3109. var pos = session.selection.lead;
  3110. column = pos.column;
  3111. row = pos.row;
  3112. }
  3113. var startToken = session.getTokenAt(row, column);
  3114. if (startToken && startToken.value in this.indentKeywords)
  3115. return this.foldingRules.rubyBlock(session, row, column, true);
  3116. };
  3117. this.$id = "ace/mode/ruby";
  3118. this.snippetFileId = "ace/snippets/ruby";
  3119. }).call(Mode.prototype);
  3120. exports.Mode = Mode;
  3121. });
  3122. ace.define("ace/mode/html_ruby",["require","exports","module","ace/lib/oop","ace/mode/html_ruby_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/ruby"], function(require, exports, module){"use strict";
  3123. var oop = require("../lib/oop");
  3124. var HtmlRubyHighlightRules = require("./html_ruby_highlight_rules").HtmlRubyHighlightRules;
  3125. var HtmlMode = require("./html").Mode;
  3126. var JavaScriptMode = require("./javascript").Mode;
  3127. var CssMode = require("./css").Mode;
  3128. var RubyMode = require("./ruby").Mode;
  3129. var Mode = function () {
  3130. HtmlMode.call(this);
  3131. this.HighlightRules = HtmlRubyHighlightRules;
  3132. this.createModeDelegates({
  3133. "js-": JavaScriptMode,
  3134. "css-": CssMode,
  3135. "ruby-": RubyMode
  3136. });
  3137. };
  3138. oop.inherits(Mode, HtmlMode);
  3139. (function () {
  3140. this.$id = "ace/mode/html_ruby";
  3141. }).call(Mode.prototype);
  3142. exports.Mode = Mode;
  3143. }); (function() {
  3144. ace.require(["ace/mode/html_ruby"], function(m) {
  3145. if (typeof module == "object" && typeof exports == "object" && module) {
  3146. module.exports = m;
  3147. }
  3148. });
  3149. })();