From 006b15b467a5cd835a6eab1b49023100bdc8f2e6 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 13 Oct 2023 19:32:56 +0200 Subject: refactor(components): rewrite Code component and usePrism hook * move Prism styles to Sass placeholders to avoid repeats * let usePrism consumer define its plugins (remove default ones) * remove `plugins` prop from Code component * add new props to Code component to let consumer configure plugins (and handle plugin list from the given options) However there are some problems with Prism plugins: line-highlight and treeview does not seems to be loaded. I don't want to use Babel instead of SWC so I have no solution for now. --- .cspell/project-words.txt | 4 + public/prism/prism-abap.js | 2 +- public/prism/prism-abap.min.js | 2 +- public/prism/prism-abnf.min.js | 4 +- public/prism/prism-ada.js | 7 +- public/prism/prism-ada.min.js | 4 +- public/prism/prism-agda.min.js | 22 +- public/prism/prism-armasm.js | 52 +++ public/prism/prism-armasm.min.js | 31 ++ public/prism/prism-arturo.js | 110 ++++++ public/prism/prism-arturo.min.js | 56 +++ public/prism/prism-asciidoc.js | 9 +- public/prism/prism-asciidoc.min.js | 32 +- public/prism/prism-asmatmel.js | 2 +- public/prism/prism-asmatmel.min.js | 2 +- public/prism/prism-autohotkey.js | 13 +- public/prism/prism-autohotkey.min.js | 10 +- public/prism/prism-autoit.js | 2 +- public/prism/prism-autoit.min.js | 2 +- public/prism/prism-avisynth.min.js | 6 +- public/prism/prism-awk.js | 33 ++ public/prism/prism-awk.min.js | 22 ++ public/prism/prism-bash.js | 12 +- public/prism/prism-bash.min.js | 32 +- public/prism/prism-batch.min.js | 4 +- public/prism/prism-bbj.js | 20 ++ public/prism/prism-bbj.min.js | 13 + public/prism/prism-bqn.js | 64 ++++ public/prism/prism-bqn.min.js | 41 +++ public/prism/prism-cfscript.js | 2 +- public/prism/prism-cfscript.min.js | 2 +- public/prism/prism-cilkc.js | 8 + public/prism/prism-cilkc.min.js | 7 + public/prism/prism-cilkcpp.js | 9 + public/prism/prism-cilkcpp.min.js | 8 + public/prism/prism-cmake.js | 4 +- public/prism/prism-cmake.min.js | 4 +- public/prism/prism-cooklang.js | 140 ++++++++ public/prism/prism-cooklang.min.js | 88 +++++ public/prism/prism-csharp.min.js | 180 +++++----- public/prism/prism-cshtml.js | 93 +++-- public/prism/prism-cshtml.min.js | 186 +++++----- public/prism/prism-csp.min.js | 4 +- public/prism/prism-css-extras.js | 2 +- public/prism/prism-css-extras.min.js | 2 +- public/prism/prism-css.js | 9 +- public/prism/prism-css.min.js | 4 +- public/prism/prism-cue.js | 93 +++++ public/prism/prism-cue.min.js | 56 +++ public/prism/prism-dataweave.min.js | 50 +-- public/prism/prism-diff.min.js | 26 +- public/prism/prism-docker.min.js | 14 +- public/prism/prism-dot.min.js | 18 +- public/prism/prism-editorconfig.js | 2 +- public/prism/prism-editorconfig.min.js | 2 +- public/prism/prism-ejs.min.js | 18 +- public/prism/prism-erb.min.js | 16 +- public/prism/prism-erlang.js | 2 +- public/prism/prism-erlang.min.js | 2 +- public/prism/prism-etlua.min.js | 16 +- public/prism/prism-excel-formula.js | 6 +- public/prism/prism-excel-formula.min.js | 6 +- public/prism/prism-factor.min.js | 432 +++++++++++------------ public/prism/prism-false.min.js | 24 +- public/prism/prism-flow.js | 4 +- public/prism/prism-flow.min.js | 4 +- public/prism/prism-ftl.min.js | 42 +-- public/prism/prism-gedcom.js | 4 +- public/prism/prism-gedcom.min.js | 4 +- public/prism/prism-gettext.js | 43 +++ public/prism/prism-gettext.min.js | 15 + public/prism/prism-gherkin.min.js | 4 +- public/prism/prism-gradle.js | 64 ++++ public/prism/prism-gradle.min.js | 49 +++ public/prism/prism-graphql.min.js | 56 +-- public/prism/prism-groovy.js | 117 +++--- public/prism/prism-groovy.min.js | 92 +++-- public/prism/prism-handlebars.js | 1 + public/prism/prism-handlebars.min.js | 17 +- public/prism/prism-hoon.js | 2 +- public/prism/prism-hoon.min.js | 2 +- public/prism/prism-http.min.js | 42 ++- public/prism/prism-icu-message-format.min.js | 16 +- public/prism/prism-ini.js | 2 +- public/prism/prism-ini.min.js | 2 +- public/prism/prism-java.js | 63 +++- public/prism/prism-java.min.js | 64 +++- public/prism/prism-javadoclike.min.js | 56 ++- public/prism/prism-javascript.js | 23 +- public/prism/prism-javascript.min.js | 5 +- public/prism/prism-js-extras.min.js | 2 +- public/prism/prism-js-templates.min.js | 183 +++++----- public/prism/prism-jsx.min.js | 108 +++--- public/prism/prism-keyman.js | 3 +- public/prism/prism-keyman.min.js | 3 +- public/prism/prism-latte.min.js | 29 +- public/prism/prism-linker-script.js | 30 ++ public/prism/prism-linker-script.min.js | 15 + public/prism/prism-liquid.min.js | 14 +- public/prism/prism-lisp.min.js | 55 ++- public/prism/prism-llvm.min.js | 34 +- public/prism/prism-markdown.js | 14 +- public/prism/prism-markdown.min.js | 149 ++++---- public/prism/prism-markup-templating.min.js | 90 ++--- public/prism/prism-markup.js | 5 +- public/prism/prism-markup.min.js | 5 +- public/prism/prism-mata.js | 54 +++ public/prism/prism-mata.min.js | 43 +++ public/prism/prism-maxscript.min.js | 4 +- public/prism/prism-mel.js | 43 +-- public/prism/prism-mel.min.js | 28 +- public/prism/prism-metafont.js | 92 +++++ public/prism/prism-metafont.min.js | 58 +++ public/prism/prism-mongodb.js | 11 + public/prism/prism-mongodb.min.js | 11 + public/prism/prism-neon.js | 2 +- public/prism/prism-neon.min.js | 2 +- public/prism/prism-nginx.min.js | 4 +- public/prism/prism-nsis.js | 2 +- public/prism/prism-nsis.min.js | 2 +- public/prism/prism-odin.js | 103 ++++++ public/prism/prism-odin.min.js | 41 +++ public/prism/prism-perl.min.js | 4 +- public/prism/prism-php.js | 6 +- public/prism/prism-php.min.js | 33 +- public/prism/prism-plant-uml.js | 124 +++++++ public/prism/prism-plant-uml.min.js | 68 ++++ public/prism/prism-powershell.min.js | 4 +- public/prism/prism-properties.js | 8 +- public/prism/prism-properties.min.js | 8 +- public/prism/prism-pure.min.js | 50 +-- public/prism/prism-purebasic.js | 6 +- public/prism/prism-purebasic.min.js | 6 +- public/prism/prism-qsharp.min.js | 38 +- public/prism/prism-rescript.js | 65 ++++ public/prism/prism-rescript.min.js | 43 +++ public/prism/prism-robotframework.min.js | 46 +-- public/prism/prism-scala.js | 36 +- public/prism/prism-scala.min.js | 25 +- public/prism/prism-scheme.min.js | 153 ++++---- public/prism/prism-smarty.min.js | 38 +- public/prism/prism-soy.min.js | 32 +- public/prism/prism-stata.js | 78 ++++ public/prism/prism-stata.min.js | 59 ++++ public/prism/prism-supercollider.js | 39 ++ public/prism/prism-supercollider.min.js | 28 ++ public/prism/prism-systemd.js | 2 +- public/prism/prism-systemd.min.js | 6 +- public/prism/prism-t4-templating.min.js | 20 +- public/prism/prism-tt2.min.js | 22 +- public/prism/prism-twig.min.js | 3 +- public/prism/prism-uorazor.js | 53 +++ public/prism/prism-uorazor.min.js | 36 ++ public/prism/prism-vhdl.js | 7 +- public/prism/prism-vhdl.min.js | 4 +- public/prism/prism-wgsl.js | 74 ++++ public/prism/prism-wgsl.min.js | 59 ++++ public/prism/prism-wolfram.js | 2 +- public/prism/prism-wolfram.min.js | 2 +- public/prism/prism-xml-doc.min.js | 16 +- public/prism/prism-xquery.min.js | 108 +++--- public/prism/prism-zig.min.js | 22 +- src/components/atoms/figure/figure.module.scss | 4 +- src/components/molecules/code/code.module.scss | 13 + src/components/molecules/code/code.stories.tsx | 192 ++++++++++ src/components/molecules/code/code.test.tsx | 14 + src/components/molecules/code/code.tsx | 183 ++++++++++ src/components/molecules/code/index.ts | 1 + src/components/molecules/index.ts | 1 + src/components/molecules/layout/code.module.scss | 305 ---------------- src/components/molecules/layout/code.stories.tsx | 121 ------- src/components/molecules/layout/code.test.tsx | 17 - src/components/molecules/layout/code.tsx | 69 ---- src/components/molecules/layout/index.ts | 1 - src/content | 2 +- src/pages/article/[slug].tsx | 28 +- src/styles/abstracts/_placeholders.scss | 1 + src/styles/abstracts/placeholders/_prism.scss | 309 ++++++++++++++++ src/styles/pages/article.module.scss | 3 +- src/styles/pages/partials/_article-prism.scss | 302 ---------------- src/utils/hooks/use-prism.tsx | 183 ---------- src/utils/hooks/use-prism/index.ts | 1 + src/utils/hooks/use-prism/use-prism.test.tsx | 91 +++++ src/utils/hooks/use-prism/use-prism.ts | 217 ++++++++++++ src/utils/plugins/prism-color-scheme.cjs | 246 +++++++++++++ src/utils/plugins/prism-color-scheme.js | 246 ------------- 186 files changed, 5326 insertions(+), 2837 deletions(-) create mode 100644 public/prism/prism-armasm.js create mode 100644 public/prism/prism-armasm.min.js create mode 100644 public/prism/prism-arturo.js create mode 100644 public/prism/prism-arturo.min.js create mode 100644 public/prism/prism-awk.js create mode 100644 public/prism/prism-awk.min.js create mode 100644 public/prism/prism-bbj.js create mode 100644 public/prism/prism-bbj.min.js create mode 100644 public/prism/prism-bqn.js create mode 100644 public/prism/prism-bqn.min.js create mode 100644 public/prism/prism-cilkc.js create mode 100644 public/prism/prism-cilkc.min.js create mode 100644 public/prism/prism-cilkcpp.js create mode 100644 public/prism/prism-cilkcpp.min.js create mode 100644 public/prism/prism-cooklang.js create mode 100644 public/prism/prism-cooklang.min.js create mode 100644 public/prism/prism-cue.js create mode 100644 public/prism/prism-cue.min.js create mode 100644 public/prism/prism-gettext.js create mode 100644 public/prism/prism-gettext.min.js create mode 100644 public/prism/prism-gradle.js create mode 100644 public/prism/prism-gradle.min.js create mode 100644 public/prism/prism-linker-script.js create mode 100644 public/prism/prism-linker-script.min.js create mode 100644 public/prism/prism-mata.js create mode 100644 public/prism/prism-mata.min.js create mode 100644 public/prism/prism-metafont.js create mode 100644 public/prism/prism-metafont.min.js create mode 100644 public/prism/prism-odin.js create mode 100644 public/prism/prism-odin.min.js create mode 100644 public/prism/prism-plant-uml.js create mode 100644 public/prism/prism-plant-uml.min.js create mode 100644 public/prism/prism-rescript.js create mode 100644 public/prism/prism-rescript.min.js create mode 100644 public/prism/prism-stata.js create mode 100644 public/prism/prism-stata.min.js create mode 100644 public/prism/prism-supercollider.js create mode 100644 public/prism/prism-supercollider.min.js create mode 100644 public/prism/prism-uorazor.js create mode 100644 public/prism/prism-uorazor.min.js create mode 100644 public/prism/prism-wgsl.js create mode 100644 public/prism/prism-wgsl.min.js create mode 100644 src/components/molecules/code/code.module.scss create mode 100644 src/components/molecules/code/code.stories.tsx create mode 100644 src/components/molecules/code/code.test.tsx create mode 100644 src/components/molecules/code/code.tsx create mode 100644 src/components/molecules/code/index.ts delete mode 100644 src/components/molecules/layout/code.module.scss delete mode 100644 src/components/molecules/layout/code.stories.tsx delete mode 100644 src/components/molecules/layout/code.test.tsx delete mode 100644 src/components/molecules/layout/code.tsx create mode 100644 src/styles/abstracts/placeholders/_prism.scss delete mode 100644 src/styles/pages/partials/_article-prism.scss delete mode 100644 src/utils/hooks/use-prism.tsx create mode 100644 src/utils/hooks/use-prism/index.ts create mode 100644 src/utils/hooks/use-prism/use-prism.test.tsx create mode 100644 src/utils/hooks/use-prism/use-prism.ts create mode 100644 src/utils/plugins/prism-color-scheme.cjs delete mode 100644 src/utils/plugins/prism-color-scheme.js diff --git a/.cspell/project-words.txt b/.cspell/project-words.txt index e2b983c..7bae5e1 100644 --- a/.cspell/project-words.txt +++ b/.cspell/project-words.txt @@ -1,7 +1,10 @@ ackee +apacheconf apcom autodocs +autoloader changefreq +classname coldark commitlint creativecommons @@ -9,6 +12,7 @@ Eckles formatjs gitlab Gitlab +hexcode Jamstack LINKEDIN nextjs diff --git a/public/prism/prism-abap.js b/public/prism/prism-abap.js index 60e9318..1c5088d 100644 --- a/public/prism/prism-abap.js +++ b/public/prism/prism-abap.js @@ -17,7 +17,7 @@ Prism.languages.abap = { }, keyword: { pattern: - /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i, + /(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i, lookbehind: true, }, /* Numbers can be only integers. Decimal or Hex appear only as strings */ diff --git a/public/prism/prism-abap.min.js b/public/prism/prism-abap.min.js index debfa41..8896ed8 100644 --- a/public/prism/prism-abap.min.js +++ b/public/prism/prism-abap.min.js @@ -9,7 +9,7 @@ Prism.languages.abap = { 'eol-comment': { pattern: /(^|\s)".*/m, lookbehind: !0, alias: 'comment' }, keyword: { pattern: - /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i, + /(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i, lookbehind: !0, }, number: /\b\d+\b/, diff --git a/public/prism/prism-abnf.min.js b/public/prism/prism-abnf.min.js index 49316c0..fc0df3d 100644 --- a/public/prism/prism-abnf.min.js +++ b/public/prism/prism-abnf.min.js @@ -1,7 +1,7 @@ !(function (n) { var i = '(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'; - Prism.languages.abnf = { + n.languages.abnf = { comment: /;.*/, string: { pattern: /(?:%[is])?"[^"\n\r]*"/, @@ -42,4 +42,4 @@ operator: /=\/?|\//, punctuation: /[()\[\]]/, }; -})(); +})(Prism); diff --git a/public/prism/prism-ada.js b/public/prism/prism-ada.js index 78ccd40..1eec0d2 100644 --- a/public/prism/prism-ada.js +++ b/public/prism/prism-ada.js @@ -10,9 +10,12 @@ Prism.languages.ada = { pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i, }, ], - 'attr-name': /\b'\w+/, + attribute: { + pattern: /\b'\w+/, + alias: 'attr-name', + }, keyword: - /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, + /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, boolean: /\b(?:false|true)\b/i, operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, punctuation: /\.\.?|[,;():]/, diff --git a/public/prism/prism-ada.min.js b/public/prism/prism-ada.min.js index 89bd41f..f89fae7 100644 --- a/public/prism/prism-ada.min.js +++ b/public/prism/prism-ada.min.js @@ -8,9 +8,9 @@ Prism.languages.ada = { }, { pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i }, ], - 'attr-name': /\b'\w+/, + attribute: { pattern: /\b'\w+/, alias: 'attr-name' }, keyword: - /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, + /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, boolean: /\b(?:false|true)\b/i, operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, punctuation: /\.\.?|[,;():]/, diff --git a/public/prism/prism-agda.min.js b/public/prism/prism-agda.min.js index 6b5f87a..f0bb6b6 100644 --- a/public/prism/prism-agda.min.js +++ b/public/prism/prism-agda.min.js @@ -1,10 +1,12 @@ -Prism.languages.agda = { - comment: /\{-[\s\S]*?(?:-\}|$)|--.*/, - string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, greedy: !0 }, - punctuation: /[(){}⦃⦄.;@]/, - 'class-name': { pattern: /((?:data|record) +)\S+/, lookbehind: !0 }, - function: { pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m, lookbehind: !0 }, - operator: { pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, lookbehind: !0 }, - keyword: - /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/, -}; +!(function (t) { + t.languages.agda = { + comment: /\{-[\s\S]*?(?:-\}|$)|--.*/, + string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, greedy: !0 }, + punctuation: /[(){}⦃⦄.;@]/, + 'class-name': { pattern: /((?:data|record) +)\S+/, lookbehind: !0 }, + function: { pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m, lookbehind: !0 }, + operator: { pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, lookbehind: !0 }, + keyword: + /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/, + }; +})(Prism); diff --git a/public/prism/prism-armasm.js b/public/prism/prism-armasm.js new file mode 100644 index 0000000..6d52d0d --- /dev/null +++ b/public/prism/prism-armasm.js @@ -0,0 +1,52 @@ +Prism.languages.armasm = { + comment: { + pattern: /;.*/, + greedy: true, + }, + string: { + pattern: /"(?:[^"\r\n]|"")*"/, + greedy: true, + inside: { + variable: { + pattern: /((?:^|[^$])(?:\${2})*)\$\w+/, + lookbehind: true, + }, + }, + }, + char: { + pattern: /'(?:[^'\r\n]{0,4}|'')'/, + greedy: true, + }, + 'version-symbol': { + pattern: /\|[\w@]+\|/, + greedy: true, + alias: 'property', + }, + + boolean: /\b(?:FALSE|TRUE)\b/, + directive: { + pattern: + /\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/, + alias: 'property', + }, + instruction: { + pattern: + /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/, + lookbehind: true, + alias: 'keyword', + }, + variable: /\$\w+/, + + number: + /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i, + + register: { + pattern: /\b(?:r\d|lr)\b/, + alias: 'symbol', + }, + + operator: /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/, + punctuation: /[()[\],]/, +}; + +Prism.languages['arm-asm'] = Prism.languages.armasm; diff --git a/public/prism/prism-armasm.min.js b/public/prism/prism-armasm.min.js new file mode 100644 index 0000000..8e6f2cc --- /dev/null +++ b/public/prism/prism-armasm.min.js @@ -0,0 +1,31 @@ +(Prism.languages.armasm = { + comment: { pattern: /;.*/, greedy: !0 }, + string: { + pattern: /"(?:[^"\r\n]|"")*"/, + greedy: !0, + inside: { + variable: { pattern: /((?:^|[^$])(?:\${2})*)\$\w+/, lookbehind: !0 }, + }, + }, + char: { pattern: /'(?:[^'\r\n]{0,4}|'')'/, greedy: !0 }, + 'version-symbol': { pattern: /\|[\w@]+\|/, greedy: !0, alias: 'property' }, + boolean: /\b(?:FALSE|TRUE)\b/, + directive: { + pattern: + /\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/, + alias: 'property', + }, + instruction: { + pattern: + /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/, + lookbehind: !0, + alias: 'keyword', + }, + variable: /\$\w+/, + number: + /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i, + register: { pattern: /\b(?:r\d|lr)\b/, alias: 'symbol' }, + operator: /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/, + punctuation: /[()[\],]/, +}), + (Prism.languages['arm-asm'] = Prism.languages.armasm); diff --git a/public/prism/prism-arturo.js b/public/prism/prism-arturo.js new file mode 100644 index 0000000..819b797 --- /dev/null +++ b/public/prism/prism-arturo.js @@ -0,0 +1,110 @@ +(function (Prism) { + /** + * @param {string} lang + * @param {string} pattern + */ + var createLanguageString = function (lang, pattern) { + return { + pattern: RegExp( + /\{!/.source + '(?:' + (pattern || lang) + ')' + /$[\s\S]*\}/.source, + 'm' + ), + greedy: true, + inside: { + embedded: { + pattern: /(^\{!\w+\b)[\s\S]+(?=\}$)/, + lookbehind: true, + alias: 'language-' + lang, + inside: Prism.languages[lang], + }, + string: /[\s\S]+/, + }, + }; + }; + + Prism.languages.arturo = { + comment: { + pattern: /;.*/, + greedy: true, + }, + + character: { + pattern: /`.`/, + alias: 'char', + greedy: true, + }, + + number: { + pattern: /\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/, + }, + + string: { + pattern: /"(?:[^"\\\r\n]|\\.)*"/, + greedy: true, + }, + + regex: { + pattern: /\{\/.*?\/\}/, + greedy: true, + }, + + 'html-string': createLanguageString('html'), + 'css-string': createLanguageString('css'), + 'js-string': createLanguageString('js'), + 'md-string': createLanguageString('md'), + 'sql-string': createLanguageString('sql'), + 'sh-string': createLanguageString('shell', 'sh'), + + multistring: { + pattern: /».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m, + alias: 'string', + greedy: true, + }, + + label: { + pattern: /\w+\b\??:/, + alias: 'property', + }, + + literal: { + pattern: /'(?:\w+\b\??:?)/, + alias: 'constant', + }, + + type: { + pattern: /:(?:\w+\b\??:?)/, + alias: 'class-name', + }, + + color: /#\w+/, + + predicate: { + pattern: + /\b(?:all|and|any|ascii|attr|attribute|attributeLabel|binary|block|char|contains|database|date|dictionary|empty|equal|even|every|exists|false|floating|function|greater|greaterOrEqual|if|in|inline|integer|is|key|label|leap|less|lessOrEqual|literal|logical|lower|nand|negative|nor|not|notEqual|null|numeric|odd|or|path|pathLabel|positive|prefix|prime|regex|same|set|some|sorted|standalone|string|subset|suffix|superset|symbol|symbolLiteral|true|try|type|unless|upper|when|whitespace|word|xnor|xor|zero)\?/, + alias: 'keyword', + }, + + 'builtin-function': { + pattern: + /\b(?:abs|acos|acosh|acsec|acsech|actan|actanh|add|after|alert|alias|and|angle|append|arg|args|arity|array|as|asec|asech|asin|asinh|atan|atan2|atanh|attr|attrs|average|before|benchmark|blend|break|call|capitalize|case|ceil|chop|clear|clip|close|color|combine|conj|continue|copy|cos|cosh|crc|csec|csech|ctan|ctanh|cursor|darken|dec|decode|define|delete|desaturate|deviation|dialog|dictionary|difference|digest|digits|div|do|download|drop|dup|e|else|empty|encode|ensure|env|escape|execute|exit|exp|extend|extract|factors|fdiv|filter|first|flatten|floor|fold|from|function|gamma|gcd|get|goto|hash|hypot|if|inc|indent|index|infinity|info|input|insert|inspect|intersection|invert|jaro|join|keys|kurtosis|last|let|levenshtein|lighten|list|ln|log|loop|lower|mail|map|match|max|median|min|mod|module|mul|nand|neg|new|nor|normalize|not|now|null|open|or|outdent|pad|palette|panic|path|pause|permissions|permutate|pi|pop|popup|pow|powerset|powmod|prefix|print|prints|process|product|query|random|range|read|relative|remove|rename|render|repeat|replace|request|return|reverse|round|sample|saturate|script|sec|sech|select|serve|set|shl|shr|shuffle|sin|sinh|size|skewness|slice|sort|spin|split|sqrt|squeeze|stack|strip|sub|suffix|sum|switch|symbols|symlink|sys|take|tan|tanh|terminal|terminate|to|truncate|try|type|unclip|union|unique|unless|until|unzip|upper|values|var|variance|volume|webview|while|with|wordwrap|write|xnor|xor|zip)\b/, + alias: 'keyword', + }, + + sugar: { + pattern: /->|=>|\||::/, + alias: 'operator', + }, + + punctuation: /[()[\],]/, + + symbol: { + pattern: /<:|-:|ø|@|#|\+|\||\*|\$|---|-|%|\/|\.\.|\^|~|=|<|>|\\/, + }, + + boolean: { + pattern: /\b(?:false|maybe|true)\b/, + }, + }; + + Prism.languages.art = Prism.languages['arturo']; +})(Prism); diff --git a/public/prism/prism-arturo.min.js b/public/prism/prism-arturo.min.js new file mode 100644 index 0000000..fe208f3 --- /dev/null +++ b/public/prism/prism-arturo.min.js @@ -0,0 +1,56 @@ +!(function (e) { + var a = function (a, t) { + return { + pattern: RegExp('\\{!(?:' + (t || a) + ')$[^]*\\}', 'm'), + greedy: !0, + inside: { + embedded: { + pattern: /(^\{!\w+\b)[\s\S]+(?=\}$)/, + lookbehind: !0, + alias: 'language-' + a, + inside: e.languages[a], + }, + string: /[\s\S]+/, + }, + }; + }; + (e.languages.arturo = { + comment: { pattern: /;.*/, greedy: !0 }, + character: { pattern: /`.`/, alias: 'char', greedy: !0 }, + number: { pattern: /\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/ }, + string: { pattern: /"(?:[^"\\\r\n]|\\.)*"/, greedy: !0 }, + regex: { pattern: /\{\/.*?\/\}/, greedy: !0 }, + 'html-string': a('html'), + 'css-string': a('css'), + 'js-string': a('js'), + 'md-string': a('md'), + 'sql-string': a('sql'), + 'sh-string': a('shell', 'sh'), + multistring: { + pattern: /».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m, + alias: 'string', + greedy: !0, + }, + label: { pattern: /\w+\b\??:/, alias: 'property' }, + literal: { pattern: /'(?:\w+\b\??:?)/, alias: 'constant' }, + type: { pattern: /:(?:\w+\b\??:?)/, alias: 'class-name' }, + color: /#\w+/, + predicate: { + pattern: + /\b(?:all|and|any|ascii|attr|attribute|attributeLabel|binary|block|char|contains|database|date|dictionary|empty|equal|even|every|exists|false|floating|function|greater|greaterOrEqual|if|in|inline|integer|is|key|label|leap|less|lessOrEqual|literal|logical|lower|nand|negative|nor|not|notEqual|null|numeric|odd|or|path|pathLabel|positive|prefix|prime|regex|same|set|some|sorted|standalone|string|subset|suffix|superset|symbol|symbolLiteral|true|try|type|unless|upper|when|whitespace|word|xnor|xor|zero)\?/, + alias: 'keyword', + }, + 'builtin-function': { + pattern: + /\b(?:abs|acos|acosh|acsec|acsech|actan|actanh|add|after|alert|alias|and|angle|append|arg|args|arity|array|as|asec|asech|asin|asinh|atan|atan2|atanh|attr|attrs|average|before|benchmark|blend|break|call|capitalize|case|ceil|chop|clear|clip|close|color|combine|conj|continue|copy|cos|cosh|crc|csec|csech|ctan|ctanh|cursor|darken|dec|decode|define|delete|desaturate|deviation|dialog|dictionary|difference|digest|digits|div|do|download|drop|dup|e|else|empty|encode|ensure|env|escape|execute|exit|exp|extend|extract|factors|fdiv|filter|first|flatten|floor|fold|from|function|gamma|gcd|get|goto|hash|hypot|if|inc|indent|index|infinity|info|input|insert|inspect|intersection|invert|jaro|join|keys|kurtosis|last|let|levenshtein|lighten|list|ln|log|loop|lower|mail|map|match|max|median|min|mod|module|mul|nand|neg|new|nor|normalize|not|now|null|open|or|outdent|pad|palette|panic|path|pause|permissions|permutate|pi|pop|popup|pow|powerset|powmod|prefix|print|prints|process|product|query|random|range|read|relative|remove|rename|render|repeat|replace|request|return|reverse|round|sample|saturate|script|sec|sech|select|serve|set|shl|shr|shuffle|sin|sinh|size|skewness|slice|sort|spin|split|sqrt|squeeze|stack|strip|sub|suffix|sum|switch|symbols|symlink|sys|take|tan|tanh|terminal|terminate|to|truncate|try|type|unclip|union|unique|unless|until|unzip|upper|values|var|variance|volume|webview|while|with|wordwrap|write|xnor|xor|zip)\b/, + alias: 'keyword', + }, + sugar: { pattern: /->|=>|\||::/, alias: 'operator' }, + punctuation: /[()[\],]/, + symbol: { + pattern: /<:|-:|ø|@|#|\+|\||\*|\$|---|-|%|\/|\.\.|\^|~|=|<|>|\\/, + }, + boolean: { pattern: /\b(?:false|maybe|true)\b/ }, + }), + (e.languages.art = e.languages.arturo); +})(Prism); diff --git a/public/prism/prism-asciidoc.js b/public/prism/prism-asciidoc.js index a2092d9..03c32bd 100644 --- a/public/prism/prism-asciidoc.js +++ b/public/prism/prism-asciidoc.js @@ -28,7 +28,7 @@ var asciidoc = (Prism.languages.asciidoc = { 'comment-block': { - pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, + pattern: /^(\/{4,})$[\s\S]*?^\1/m, alias: 'comment', }, table: { @@ -48,7 +48,7 @@ }, 'passthrough-block': { - pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(\+{4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^\++|\++$/, // See rest below @@ -56,7 +56,7 @@ }, // Literal blocks and listing blocks 'literal-block': { - pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/, // See rest below @@ -64,8 +64,7 @@ }, // Sidebar blocks, quote blocks, example blocks and open blocks 'other-block': { - pattern: - /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/, // See rest below diff --git a/public/prism/prism-asciidoc.min.js b/public/prism/prism-asciidoc.min.js index 19af164..8aaee24 100644 --- a/public/prism/prism-asciidoc.min.js +++ b/public/prism/prism-asciidoc.min.js @@ -19,11 +19,8 @@ 'attr-value': /(?!^\s+$).+/, }, }, - a = (t.languages.asciidoc = { - 'comment-block': { - pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, - alias: 'comment', - }, + i = (t.languages.asciidoc = { + 'comment-block': { pattern: /^(\/{4,})$[\s\S]*?^\1/m, alias: 'comment' }, table: { pattern: /^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m, inside: { @@ -36,16 +33,15 @@ }, }, 'passthrough-block': { - pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(\+{4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^\++|\++$/ }, }, 'literal-block': { - pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/ }, }, 'other-block': { - pattern: - /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m, inside: { punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ }, }, 'list-punctuation': { @@ -135,21 +131,21 @@ alias: 'punctuation', }, }); - function i(t) { - for (var n = {}, i = 0, e = (t = t.split(' ')).length; i < e; i++) - n[t[i]] = a[t[i]]; + function e(t) { + for (var n = {}, e = 0, a = (t = t.split(' ')).length; e < a; e++) + n[t[e]] = i[t[e]]; return n; } - (n.inside.interpreted.inside.rest = i('macro inline replacement entity')), - (a['passthrough-block'].inside.rest = i('macro')), - (a['literal-block'].inside.rest = i('callout')), - (a.table.inside.rest = i( + (n.inside.interpreted.inside.rest = e('macro inline replacement entity')), + (i['passthrough-block'].inside.rest = e('macro')), + (i['literal-block'].inside.rest = e('callout')), + (i.table.inside.rest = e( 'comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation' )), - (a['other-block'].inside.rest = i( + (i['other-block'].inside.rest = e( 'table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation' )), - (a.title.inside.rest = i('macro inline replacement entity')), + (i.title.inside.rest = e('macro inline replacement entity')), t.hooks.add('wrap', function (t) { 'entity' === t.type && (t.attributes.title = t.content.replace(/&/, '&')); diff --git a/public/prism/prism-asmatmel.js b/public/prism/prism-asmatmel.js index 19d9cf0..bb77bff 100644 --- a/public/prism/prism-asmatmel.js +++ b/public/prism/prism-asmatmel.js @@ -39,6 +39,6 @@ Prism.languages.asmatmel = { pattern: /\b[acznvshtixy]\b/i, alias: 'variable', }, - operator: />>=?|<<=?|&&?|\|\|?|[-+*/%&|^!=<>?]=?/, + operator: />>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/, punctuation: /[(),:]/, }; diff --git a/public/prism/prism-asmatmel.min.js b/public/prism/prism-asmatmel.min.js index efb9e45..69e38c5 100644 --- a/public/prism/prism-asmatmel.min.js +++ b/public/prism/prism-asmatmel.min.js @@ -13,6 +13,6 @@ Prism.languages.asmatmel = { 'binary-number': { pattern: /#?%[01]+\b/, alias: 'number' }, 'decimal-number': { pattern: /#?\b\d+\b/, alias: 'number' }, register: { pattern: /\b[acznvshtixy]\b/i, alias: 'variable' }, - operator: />>=?|<<=?|&&?|\|\|?|[-+*/%&|^!=<>?]=?/, + operator: />>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/, punctuation: /[(),:]/, }; diff --git a/public/prism/prism-autohotkey.js b/public/prism/prism-autohotkey.js index e258e83..31dc453 100644 --- a/public/prism/prism-autohotkey.js +++ b/public/prism/prism-autohotkey.js @@ -24,8 +24,11 @@ Prism.languages.autohotkey = { /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, boolean: /\b(?:false|true)\b/, - selector: - /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + command: { + pattern: + /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + alias: 'selector', + }, constant: /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i, @@ -36,8 +39,10 @@ Prism.languages.autohotkey = { symbol: /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, - important: - /#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i, + directive: { + pattern: /#[a-z]+\b/i, + alias: 'important', + }, keyword: /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Catch|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|Finally|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i, diff --git a/public/prism/prism-autohotkey.min.js b/public/prism/prism-autohotkey.min.js index 33e8435..892cad2 100644 --- a/public/prism/prism-autohotkey.min.js +++ b/public/prism/prism-autohotkey.min.js @@ -15,16 +15,18 @@ Prism.languages.autohotkey = { operator: /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, boolean: /\b(?:false|true)\b/, - selector: - /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + command: { + pattern: + /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + alias: 'selector', + }, constant: /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i, builtin: /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i, symbol: /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, - important: - /#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i, + directive: { pattern: /#[a-z]+\b/i, alias: 'important' }, keyword: /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Catch|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|Finally|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i, function: /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/, diff --git a/public/prism/prism-autoit.js b/public/prism/prism-autoit.js index c538197..592f5f2 100644 --- a/public/prism/prism-autoit.js +++ b/public/prism/prism-autoit.js @@ -20,7 +20,7 @@ Prism.languages.autoit = { }, }, directive: { - pattern: /(^[\t ]*)#\w+/m, + pattern: /(^[\t ]*)#[\w-]+/m, lookbehind: true, alias: 'keyword', }, diff --git a/public/prism/prism-autoit.min.js b/public/prism/prism-autoit.min.js index 2456b4d..d4b2438 100644 --- a/public/prism/prism-autoit.min.js +++ b/public/prism/prism-autoit.min.js @@ -16,7 +16,7 @@ Prism.languages.autoit = { greedy: !0, inside: { variable: /([%$@])\w+\1/ }, }, - directive: { pattern: /(^[\t ]*)#\w+/m, lookbehind: !0, alias: 'keyword' }, + directive: { pattern: /(^[\t ]*)#[\w-]+/m, lookbehind: !0, alias: 'keyword' }, function: /\b\w+(?=\()/, variable: /[$@]\w+/, keyword: diff --git a/public/prism/prism-avisynth.min.js b/public/prism/prism-avisynth.min.js index eba7cf9..ed6a5a9 100644 --- a/public/prism/prism-avisynth.min.js +++ b/public/prism/prism-avisynth.min.js @@ -1,9 +1,9 @@ !(function (e) { function a(e, a, r) { return RegExp( - (function (e, r) { - return e.replace(/<<(\d+)>>/g, function (e, a) { - return r[+a]; + (function (e, a) { + return e.replace(/<<(\d+)>>/g, function (e, r) { + return a[+r]; }); })(e, a), r || '' diff --git a/public/prism/prism-awk.js b/public/prism/prism-awk.js new file mode 100644 index 0000000..ebb59b0 --- /dev/null +++ b/public/prism/prism-awk.js @@ -0,0 +1,33 @@ +Prism.languages.awk = { + hashbang: { + pattern: /^#!.*/, + greedy: true, + alias: 'comment', + }, + comment: { + pattern: /#.*/, + greedy: true, + }, + string: { + pattern: /(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/, + lookbehind: true, + greedy: true, + }, + regex: { + pattern: /((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//, + lookbehind: true, + greedy: true, + }, + + variable: /\$\w+/, + keyword: + /\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/, + + function: /\b[a-z_]\w*(?=\s*\()/i, + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/, + + operator: /--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/, + punctuation: /[()[\]{},;]/, +}; + +Prism.languages.gawk = Prism.languages.awk; diff --git a/public/prism/prism-awk.min.js b/public/prism/prism-awk.min.js new file mode 100644 index 0000000..a34b266 --- /dev/null +++ b/public/prism/prism-awk.min.js @@ -0,0 +1,22 @@ +(Prism.languages.awk = { + hashbang: { pattern: /^#!.*/, greedy: !0, alias: 'comment' }, + comment: { pattern: /#.*/, greedy: !0 }, + string: { + pattern: /(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/, + lookbehind: !0, + greedy: !0, + }, + regex: { + pattern: /((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//, + lookbehind: !0, + greedy: !0, + }, + variable: /\$\w+/, + keyword: + /\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/, + operator: /--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/, + punctuation: /[()[\]{},;]/, +}), + (Prism.languages.gawk = Prism.languages.awk); diff --git a/public/prism/prism-bash.js b/public/prism/prism-bash.js index 167d193..e807cbe 100644 --- a/public/prism/prism-bash.js +++ b/public/prism/prism-bash.js @@ -104,7 +104,7 @@ // Highlight variable names as variables in the left-hand part // of assignments (“=” and “+=”). 'assign-left': { - pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, inside: { environment: { pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars), @@ -115,6 +115,12 @@ alias: 'variable', lookbehind: true, }, + // Highlight parameter names as variables + parameter: { + pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, + alias: 'variable', + lookbehind: true, + }, string: [ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document { @@ -164,7 +170,7 @@ variable: insideString.variable, function: { pattern: - /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: true, }, keyword: { @@ -214,6 +220,7 @@ 'function-name', 'for-or-select', 'assign-left', + 'parameter', 'string', 'environment', 'function', @@ -230,5 +237,6 @@ inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]; } + Prism.languages.sh = Prism.languages.bash; Prism.languages.shell = Prism.languages.bash; })(Prism); diff --git a/public/prism/prism-bash.min.js b/public/prism/prism-bash.min.js index 970494f..3671284 100644 --- a/public/prism/prism-bash.min.js +++ b/public/prism/prism-bash.min.js @@ -1,14 +1,14 @@ !(function (e) { var t = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b', - n = { + a = { pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, lookbehind: !0, alias: 'punctuation', inside: null, }, - a = { - bash: n, + n = { + bash: a, environment: { pattern: RegExp('\\$' + t), alias: 'constant' }, variable: [ { @@ -66,7 +66,7 @@ lookbehind: !0, }, 'assign-left': { - pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, inside: { environment: { pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + t), @@ -77,38 +77,43 @@ alias: 'variable', lookbehind: !0, }, + parameter: { + pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, + alias: 'variable', + lookbehind: !0, + }, string: [ { pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, lookbehind: !0, greedy: !0, - inside: a, + inside: n, }, { pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, lookbehind: !0, greedy: !0, - inside: { bash: n }, + inside: { bash: a }, }, { pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, lookbehind: !0, greedy: !0, - inside: a, + inside: n, }, { pattern: /(^|[^$\\])'[^']*'/, lookbehind: !0, greedy: !0 }, { pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, greedy: !0, - inside: { entity: a.entity }, + inside: { entity: n.entity }, }, ], environment: { pattern: RegExp('\\$?' + t), alias: 'constant' }, - variable: a.variable, + variable: n.variable, function: { pattern: - /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: !0, }, keyword: { @@ -135,13 +140,14 @@ punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, number: { pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, lookbehind: !0 }, }), - (n.inside = e.languages.bash); + (a.inside = e.languages.bash); for ( var s = [ 'comment', 'function-name', 'for-or-select', 'assign-left', + 'parameter', 'string', 'environment', 'function', @@ -153,11 +159,11 @@ 'punctuation', 'number', ], - o = a.variable[1].inside, + o = n.variable[1].inside, i = 0; i < s.length; i++ ) o[s[i]] = e.languages.bash[s[i]]; - e.languages.shell = e.languages.bash; + (e.languages.sh = e.languages.bash), (e.languages.shell = e.languages.bash); })(Prism); diff --git a/public/prism/prism-batch.min.js b/public/prism/prism-batch.min.js index b3d691a..7e22b33 100644 --- a/public/prism/prism-batch.min.js +++ b/public/prism/prism-batch.min.js @@ -7,7 +7,7 @@ }, n = /"(?:[\\"]"|[^"])*"(?!")/, i = /(?:\b|-)\d+\b/; - Prism.languages.batch = { + e.languages.batch = { comment: [ /^::.*/m, { @@ -80,4 +80,4 @@ operator: /[&@]/, punctuation: /[()']/, }; -})(); +})(Prism); diff --git a/public/prism/prism-bbj.js b/public/prism/prism-bbj.js new file mode 100644 index 0000000..bd4a265 --- /dev/null +++ b/public/prism/prism-bbj.js @@ -0,0 +1,20 @@ +(function (Prism) { + Prism.languages.bbj = { + comment: { + pattern: /(^|[^\\:])rem\s+.*/i, + lookbehind: true, + greedy: true, + }, + string: { + pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/, + greedy: true, + }, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i, + function: /\b\w+(?=\()/, + boolean: /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i, + operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, + punctuation: /[.,;:()]/, + }; +})(Prism); diff --git a/public/prism/prism-bbj.min.js b/public/prism/prism-bbj.min.js new file mode 100644 index 0000000..88c7b00 --- /dev/null +++ b/public/prism/prism-bbj.min.js @@ -0,0 +1,13 @@ +!(function (e) { + e.languages.bbj = { + comment: { pattern: /(^|[^\\:])rem\s+.*/i, lookbehind: !0, greedy: !0 }, + string: { pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/, greedy: !0 }, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i, + function: /\b\w+(?=\()/, + boolean: /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i, + operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, + punctuation: /[.,;:()]/, + }; +})(Prism); diff --git a/public/prism/prism-bqn.js b/public/prism/prism-bqn.js new file mode 100644 index 0000000..34b8f5a --- /dev/null +++ b/public/prism/prism-bqn.js @@ -0,0 +1,64 @@ +Prism.languages.bqn = { + shebang: { + pattern: /^#![ \t]*\/.*/, + alias: 'important', + greedy: true, + }, + comment: { + pattern: /#.*/, + greedy: true, + }, + 'string-literal': { + pattern: /"(?:[^"]|"")*"/, + greedy: true, + alias: 'string', + }, + 'character-literal': { + pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/, + greedy: true, + alias: 'char', + }, + function: /•[\w¯.∞π]+[\w¯.∞π]*/, + 'dot-notation-on-brackets': { + pattern: /\{(?=.*\}\.)|\}\./, + alias: 'namespace', + }, + 'special-name': { + pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/, + alias: 'keyword', + }, + 'dot-notation-on-name': { + pattern: /[A-Za-z_][\w¯∞π]*\./, + alias: 'namespace', + }, + 'word-number-scientific': { + pattern: /\d+(?:\.\d+)?[eE]¯?\d+/, + alias: 'number', + }, + 'word-name': { + pattern: /[A-Za-z_][\w¯∞π]*/, + alias: 'symbol', + }, + 'word-number': { + pattern: + /[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/, + alias: 'number', + }, + 'null-literal': { + pattern: /@/, + alias: 'char', + }, + 'primitive-functions': { + pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/, + alias: 'operator', + }, + 'primitive-1-operators': { + pattern: /[`˜˘¨⁼⌜´˝˙]/, + alias: 'operator', + }, + 'primitive-2-operators': { + pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/, + alias: 'operator', + }, + punctuation: /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/, +}; diff --git a/public/prism/prism-bqn.min.js b/public/prism/prism-bqn.min.js new file mode 100644 index 0000000..b28eb95 --- /dev/null +++ b/public/prism/prism-bqn.min.js @@ -0,0 +1,41 @@ +Prism.languages.bqn = { + shebang: { pattern: /^#![ \t]*\/.*/, alias: 'important', greedy: !0 }, + comment: { pattern: /#.*/, greedy: !0 }, + 'string-literal': { pattern: /"(?:[^"]|"")*"/, greedy: !0, alias: 'string' }, + 'character-literal': { + pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/, + greedy: !0, + alias: 'char', + }, + function: /•[\w¯.∞π]+[\w¯.∞π]*/, + 'dot-notation-on-brackets': { + pattern: /\{(?=.*\}\.)|\}\./, + alias: 'namespace', + }, + 'special-name': { + pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/, + alias: 'keyword', + }, + 'dot-notation-on-name': { + pattern: /[A-Za-z_][\w¯∞π]*\./, + alias: 'namespace', + }, + 'word-number-scientific': { + pattern: /\d+(?:\.\d+)?[eE]¯?\d+/, + alias: 'number', + }, + 'word-name': { pattern: /[A-Za-z_][\w¯∞π]*/, alias: 'symbol' }, + 'word-number': { + pattern: + /[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/, + alias: 'number', + }, + 'null-literal': { pattern: /@/, alias: 'char' }, + 'primitive-functions': { + pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/, + alias: 'operator', + }, + 'primitive-1-operators': { pattern: /[`˜˘¨⁼⌜´˝˙]/, alias: 'operator' }, + 'primitive-2-operators': { pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/, alias: 'operator' }, + punctuation: /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/, +}; diff --git a/public/prism/prism-cfscript.js b/public/prism/prism-cfscript.js index da83537..be8c4d5 100644 --- a/public/prism/prism-cfscript.js +++ b/public/prism/prism-cfscript.js @@ -20,7 +20,7 @@ Prism.languages.cfscript = Prism.languages.extend('clike', { keyword: /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/, operator: [ - /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/, + /\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/, /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/, ], scope: { diff --git a/public/prism/prism-cfscript.min.js b/public/prism/prism-cfscript.min.js index abeee99..a61cdfb 100644 --- a/public/prism/prism-cfscript.min.js +++ b/public/prism/prism-cfscript.min.js @@ -12,7 +12,7 @@ keyword: /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/, operator: [ - /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/, + /\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/, /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/, ], scope: { diff --git a/public/prism/prism-cilkc.js b/public/prism/prism-cilkc.js new file mode 100644 index 0000000..3f8acb0 --- /dev/null +++ b/public/prism/prism-cilkc.js @@ -0,0 +1,8 @@ +Prism.languages.cilkc = Prism.languages.insertBefore('c', 'function', { + 'parallel-keyword': { + pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, + alias: 'keyword', + }, +}); + +Prism.languages['cilk-c'] = Prism.languages['cilkc']; diff --git a/public/prism/prism-cilkc.min.js b/public/prism/prism-cilkc.min.js new file mode 100644 index 0000000..d58dea6 --- /dev/null +++ b/public/prism/prism-cilkc.min.js @@ -0,0 +1,7 @@ +(Prism.languages.cilkc = Prism.languages.insertBefore('c', 'function', { + 'parallel-keyword': { + pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, + alias: 'keyword', + }, +})), + (Prism.languages['cilk-c'] = Prism.languages.cilkc); diff --git a/public/prism/prism-cilkcpp.js b/public/prism/prism-cilkcpp.js new file mode 100644 index 0000000..2fd9331 --- /dev/null +++ b/public/prism/prism-cilkcpp.js @@ -0,0 +1,9 @@ +Prism.languages.cilkcpp = Prism.languages.insertBefore('cpp', 'function', { + 'parallel-keyword': { + pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, + alias: 'keyword', + }, +}); + +Prism.languages['cilk-cpp'] = Prism.languages['cilkcpp']; +Prism.languages['cilk'] = Prism.languages['cilkcpp']; diff --git a/public/prism/prism-cilkcpp.min.js b/public/prism/prism-cilkcpp.min.js new file mode 100644 index 0000000..e575393 --- /dev/null +++ b/public/prism/prism-cilkcpp.min.js @@ -0,0 +1,8 @@ +(Prism.languages.cilkcpp = Prism.languages.insertBefore('cpp', 'function', { + 'parallel-keyword': { + pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, + alias: 'keyword', + }, +})), + (Prism.languages['cilk-cpp'] = Prism.languages.cilkcpp), + (Prism.languages.cilk = Prism.languages.cilkcpp); diff --git a/public/prism/prism-cmake.js b/public/prism/prism-cmake.js index 986327f..1f3da01 100644 --- a/public/prism/prism-cmake.js +++ b/public/prism/prism-cmake.js @@ -14,9 +14,9 @@ Prism.languages.cmake = { }, }, variable: - /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/, + /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_NAME|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE))\b/, property: - /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, + /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, keyword: /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/, boolean: /\b(?:FALSE|OFF|ON|TRUE)\b/, diff --git a/public/prism/prism-cmake.min.js b/public/prism/prism-cmake.min.js index bb0d567..64f2d01 100644 --- a/public/prism/prism-cmake.min.js +++ b/public/prism/prism-cmake.min.js @@ -11,9 +11,9 @@ Prism.languages.cmake = { }, }, variable: - /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/, + /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_NAME|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE))\b/, property: - /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, + /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, keyword: /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/, boolean: /\b(?:FALSE|OFF|ON|TRUE)\b/, diff --git a/public/prism/prism-cooklang.js b/public/prism/prism-cooklang.js new file mode 100644 index 0000000..445d856 --- /dev/null +++ b/public/prism/prism-cooklang.js @@ -0,0 +1,140 @@ +(function (Prism) { + // see https://github.com/cooklang/spec/blob/main/EBNF.md + + var single_token_suffix = /(?:(?!\s)[\d$+<=a-zA-Z\x80-\uFFFF])+/.source; + var multi_token_infix = /[^{}@#]+/.source; + var multi_token_suffix = /\{[^}#@]*\}/.source; + + var multi_token = multi_token_infix + multi_token_suffix; + + var timer_units = /(?:h|hours|hrs|m|min|minutes)/.source; + + var amount_group_impl = { + pattern: /\{[^{}]*\}/, + inside: { + amount: { + pattern: /([\{|])[^{}|*%]+/, + lookbehind: true, + alias: 'number', + }, + unit: { + pattern: /(%)[^}]+/, + lookbehind: true, + alias: 'symbol', + }, + 'servings-scaler': { + pattern: /\*/, + alias: 'operator', + }, + 'servings-alternative-separator': { + pattern: /\|/, + alias: 'operator', + }, + 'unit-separator': { + pattern: /(?:%|(\*)%)/, + lookbehind: true, + alias: 'operator', + }, + punctuation: /[{}]/, + }, + }; + + Prism.languages.cooklang = { + comment: { + // [- comment -] + // -- comment + pattern: /\[-[\s\S]*?-\]|--.*/, + greedy: true, + }, + meta: { + // >> key: value + pattern: />>.*:.*/, + inside: { + property: { + // key: + pattern: /(>>\s*)[^\s:](?:[^:]*[^\s:])?/, + lookbehind: true, + }, + }, + }, + 'cookware-group': { + // #...{...}, #... + pattern: new RegExp( + '#(?:' + multi_token + '|' + single_token_suffix + ')' + ), + inside: { + cookware: { + pattern: new RegExp('(^#)(?:' + multi_token_infix + ')'), + lookbehind: true, + alias: 'variable', + }, + 'cookware-keyword': { + pattern: /^#/, + alias: 'keyword', + }, + 'quantity-group': { + pattern: new RegExp(/\{[^{}@#]*\}/), + inside: { + quantity: { + pattern: new RegExp(/(^\{)/.source + multi_token_infix), + lookbehind: true, + alias: 'number', + }, + punctuation: /[{}]/, + }, + }, + }, + }, + 'ingredient-group': { + // @...{...}, @... + pattern: new RegExp( + '@(?:' + multi_token + '|' + single_token_suffix + ')' + ), + inside: { + ingredient: { + pattern: new RegExp('(^@)(?:' + multi_token_infix + ')'), + lookbehind: true, + alias: 'variable', + }, + 'ingredient-keyword': { + pattern: /^@/, + alias: 'keyword', + }, + 'amount-group': amount_group_impl, + }, + }, + 'timer-group': { + // ~timer{...} + // eslint-disable-next-line regexp/sort-alternatives + pattern: /~(?!\s)[^@#~{}]*\{[^{}]*\}/, + inside: { + timer: { + pattern: /(^~)[^{]+/, + lookbehind: true, + alias: 'variable', + }, + 'duration-group': { + // {...} + pattern: /\{[^{}]*\}/, + inside: { + punctuation: /[{}]/, + unit: { + pattern: new RegExp(/(%\s*)/.source + timer_units + /\b/.source), + lookbehind: true, + alias: 'symbol', + }, + operator: /%/, + duration: { + pattern: /\d+/, + alias: 'number', + }, + }, + }, + 'timer-keyword': { + pattern: /^~/, + alias: 'keyword', + }, + }, + }, + }; +})(Prism); diff --git a/public/prism/prism-cooklang.min.js b/public/prism/prism-cooklang.min.js new file mode 100644 index 0000000..dfb80d6 --- /dev/null +++ b/public/prism/prism-cooklang.min.js @@ -0,0 +1,88 @@ +!(function (e) { + var a = '(?:(?!\\s)[\\d$+<=a-zA-Z\\x80-\\uFFFF])+', + t = '[^{}@#]+\\{[^}#@]*\\}'; + e.languages.cooklang = { + comment: { pattern: /\[-[\s\S]*?-\]|--.*/, greedy: !0 }, + meta: { + pattern: />>.*:.*/, + inside: { + property: { pattern: /(>>\s*)[^\s:](?:[^:]*[^\s:])?/, lookbehind: !0 }, + }, + }, + 'cookware-group': { + pattern: new RegExp('#(?:' + t + '|' + a + ')'), + inside: { + cookware: { + pattern: new RegExp('(^#)(?:[^{}@#]+)'), + lookbehind: !0, + alias: 'variable', + }, + 'cookware-keyword': { pattern: /^#/, alias: 'keyword' }, + 'quantity-group': { + pattern: new RegExp(/\{[^{}@#]*\}/), + inside: { + quantity: { + pattern: new RegExp('(^\\{)[^{}@#]+'), + lookbehind: !0, + alias: 'number', + }, + punctuation: /[{}]/, + }, + }, + }, + }, + 'ingredient-group': { + pattern: new RegExp('@(?:' + t + '|' + a + ')'), + inside: { + ingredient: { + pattern: new RegExp('(^@)(?:[^{}@#]+)'), + lookbehind: !0, + alias: 'variable', + }, + 'ingredient-keyword': { pattern: /^@/, alias: 'keyword' }, + 'amount-group': { + pattern: /\{[^{}]*\}/, + inside: { + amount: { + pattern: /([\{|])[^{}|*%]+/, + lookbehind: !0, + alias: 'number', + }, + unit: { pattern: /(%)[^}]+/, lookbehind: !0, alias: 'symbol' }, + 'servings-scaler': { pattern: /\*/, alias: 'operator' }, + 'servings-alternative-separator': { + pattern: /\|/, + alias: 'operator', + }, + 'unit-separator': { + pattern: /(?:%|(\*)%)/, + lookbehind: !0, + alias: 'operator', + }, + punctuation: /[{}]/, + }, + }, + }, + }, + 'timer-group': { + pattern: /~(?!\s)[^@#~{}]*\{[^{}]*\}/, + inside: { + timer: { pattern: /(^~)[^{]+/, lookbehind: !0, alias: 'variable' }, + 'duration-group': { + pattern: /\{[^{}]*\}/, + inside: { + punctuation: /[{}]/, + unit: { + pattern: new RegExp('(%\\s*)(?:h|hours|hrs|m|min|minutes)\\b'), + lookbehind: !0, + alias: 'symbol', + }, + operator: /%/, + duration: { pattern: /\d+/, alias: 'number' }, + }, + }, + 'timer-keyword': { pattern: /^~/, alias: 'keyword' }, + }, + }, + }; +})(Prism); diff --git a/public/prism/prism-csharp.min.js b/public/prism/prism-csharp.min.js index bb80a4c..44e5704 100644 --- a/public/prism/prism-csharp.min.js +++ b/public/prism/prism-csharp.min.js @@ -1,20 +1,20 @@ -!(function (s) { - function a(e, s) { - return e.replace(/<<(\d+)>>/g, function (e, n) { - return '(?:' + s[+n] + ')'; +!(function (e) { + function n(e, n) { + return e.replace(/<<(\d+)>>/g, function (e, s) { + return '(?:' + n[+s] + ')'; }); } - function t(e, n, s) { - return RegExp(a(e, n), s || ''); + function s(e, s, a) { + return RegExp(n(e, s), a || ''); } - function e(e, n) { + function a(e, n) { for (var s = 0; s < n; s++) e = e.replace(/<>/g, function () { return '(?:' + e + ')'; }); return e.replace(/<>/g, '[^\\s\\S]'); } - var n = + var t = 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void', r = 'class enum interface record struct', i = @@ -25,65 +25,61 @@ return '\\b(?:' + e.trim().replace(/ /g, '|') + ')\\b'; } var d = l(r), - p = RegExp(l(n + ' ' + r + ' ' + i + ' ' + o)), + p = RegExp(l(t + ' ' + r + ' ' + i + ' ' + o)), c = l(r + ' ' + i + ' ' + o), - u = l(n + ' ' + r + ' ' + o), - g = e('<(?:[^<>;=+\\-*/%&|^]|<>)*>', 2), - b = e('\\((?:[^()]|<>)*\\)', 2), + u = l(t + ' ' + r + ' ' + o), + g = a('<(?:[^<>;=+\\-*/%&|^]|<>)*>', 2), + b = a('\\((?:[^()]|<>)*\\)', 2), h = '@?\\b[A-Za-z_]\\w*\\b', - f = a('<<0>>(?:\\s*<<1>>)?', [h, g]), - m = a('(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*', [c, f]), + f = n('<<0>>(?:\\s*<<1>>)?', [h, g]), + m = n('(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*', [c, f]), k = '\\[\\s*(?:,\\s*)*\\]', - y = a('<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?', [m, k]), - w = a('(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?', [ - a('\\(<<0>>+(?:,<<0>>+)+\\)', [ - a('[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>', [g, b, k]), - ]), - m, - k, - ]), - v = { keyword: p, punctuation: /[<>()?,.:[\]]/ }, - x = "'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'", - $ = '"(?:\\\\.|[^\\\\"\r\n])*"'; - (s.languages.csharp = s.languages.extend('clike', { + y = n('<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?', [m, k]), + w = n('[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>', [g, b, k]), + v = n('\\(<<0>>+(?:,<<0>>+)+\\)', [w]), + x = n('(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?', [v, m, k]), + $ = { keyword: p, punctuation: /[<>()?,.:[\]]/ }, + _ = "'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'", + B = '"(?:\\\\.|[^\\\\"\r\n])*"'; + (e.languages.csharp = e.languages.extend('clike', { string: [ { - pattern: t('(^|[^$\\\\])<<0>>', ['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']), + pattern: s('(^|[^$\\\\])<<0>>', ['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']), lookbehind: !0, greedy: !0, }, - { pattern: t('(^|[^@$\\\\])<<0>>', [$]), lookbehind: !0, greedy: !0 }, + { pattern: s('(^|[^@$\\\\])<<0>>', [B]), lookbehind: !0, greedy: !0 }, ], 'class-name': [ { - pattern: t('(\\busing\\s+static\\s+)<<0>>(?=\\s*;)', [m]), + pattern: s('(\\busing\\s+static\\s+)<<0>>(?=\\s*;)', [m]), lookbehind: !0, - inside: v, + inside: $, }, { - pattern: t('(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)', [h, w]), + pattern: s('(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)', [h, x]), lookbehind: !0, - inside: v, + inside: $, }, - { pattern: t('(\\busing\\s+)<<0>>(?=\\s*=)', [h]), lookbehind: !0 }, - { pattern: t('(\\b<<0>>\\s+)<<1>>', [d, f]), lookbehind: !0, inside: v }, + { pattern: s('(\\busing\\s+)<<0>>(?=\\s*=)', [h]), lookbehind: !0 }, + { pattern: s('(\\b<<0>>\\s+)<<1>>', [d, f]), lookbehind: !0, inside: $ }, { - pattern: t('(\\bcatch\\s*\\(\\s*)<<0>>', [m]), + pattern: s('(\\bcatch\\s*\\(\\s*)<<0>>', [m]), lookbehind: !0, - inside: v, + inside: $, }, - { pattern: t('(\\bwhere\\s+)<<0>>', [h]), lookbehind: !0 }, + { pattern: s('(\\bwhere\\s+)<<0>>', [h]), lookbehind: !0 }, { - pattern: t('(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>', [y]), + pattern: s('(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>', [y]), lookbehind: !0, - inside: v, + inside: $, }, { - pattern: t( + pattern: s( '\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))', - [w, u, h] + [x, u, h] ), - inside: v, + inside: $, }, ], keyword: p, @@ -92,19 +88,19 @@ operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/, punctuation: /\?\.?|::|[{}[\];(),.:]/, })), - s.languages.insertBefore('csharp', 'number', { + e.languages.insertBefore('csharp', 'number', { range: { pattern: /\.\./, alias: 'operator' }, }), - s.languages.insertBefore('csharp', 'punctuation', { + e.languages.insertBefore('csharp', 'punctuation', { 'named-parameter': { - pattern: t('([(,]\\s*)<<0>>(?=\\s*:)', [h]), + pattern: s('([(,]\\s*)<<0>>(?=\\s*:)', [h]), lookbehind: !0, alias: 'punctuation', }, }), - s.languages.insertBefore('csharp', 'class-name', { + e.languages.insertBefore('csharp', 'class-name', { namespace: { - pattern: t( + pattern: s( '(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])', [h] ), @@ -112,50 +108,50 @@ inside: { punctuation: /\./ }, }, 'type-expression': { - pattern: t( + pattern: s( '(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))', [b] ), lookbehind: !0, alias: 'class-name', - inside: v, + inside: $, }, 'return-type': { - pattern: t( + pattern: s( '<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))', - [w, m] + [x, m] ), - inside: v, + inside: $, alias: 'class-name', }, 'constructor-invocation': { - pattern: t('(\\bnew\\s+)<<0>>(?=\\s*[[({])', [w]), + pattern: s('(\\bnew\\s+)<<0>>(?=\\s*[[({])', [x]), lookbehind: !0, - inside: v, + inside: $, alias: 'class-name', }, 'generic-method': { - pattern: t('<<0>>\\s*<<1>>(?=\\s*\\()', [h, g]), + pattern: s('<<0>>\\s*<<1>>(?=\\s*\\()', [h, g]), inside: { - function: t('^<<0>>', [h]), - generic: { pattern: RegExp(g), alias: 'class-name', inside: v }, + function: s('^<<0>>', [h]), + generic: { pattern: RegExp(g), alias: 'class-name', inside: $ }, }, }, 'type-list': { - pattern: t( + pattern: s( '\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))', - [d, f, h, w, p.source, b, '\\bnew\\s*\\(\\s*\\)'] + [d, f, h, x, p.source, b, '\\bnew\\s*\\(\\s*\\)'] ), lookbehind: !0, inside: { 'record-arguments': { - pattern: t('(^(?!new\\s*\\()<<0>>\\s*)<<1>>', [f, b]), + pattern: s('(^(?!new\\s*\\()<<0>>\\s*)<<1>>', [f, b]), lookbehind: !0, greedy: !0, - inside: s.languages.csharp, + inside: e.languages.csharp, }, keyword: p, - 'class-name': { pattern: RegExp(w), greedy: !0, inside: v }, + 'class-name': { pattern: RegExp(x), greedy: !0, inside: $ }, punctuation: /[,()]/, }, }, @@ -173,49 +169,49 @@ }, }, }); - var _ = $ + '|' + x, - B = a('/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>', [_]), - E = e(a('[^"\'/()]|<<0>>|\\(<>*\\)', [B]), 2), - R = + var E = B + '|' + _, + R = n('/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>', [E]), + z = a(n('[^"\'/()]|<<0>>|\\(<>*\\)', [R]), 2), + S = '\\b(?:assembly|event|field|method|module|param|property|return|type)\\b', - z = a('<<0>>(?:\\s*\\(<<1>>*\\))?', [m, E]); - s.languages.insertBefore('csharp', 'class-name', { + j = n('<<0>>(?:\\s*\\(<<1>>*\\))?', [m, z]); + e.languages.insertBefore('csharp', 'class-name', { attribute: { - pattern: t( + pattern: s( '((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])', - [R, z] + [S, j] ), lookbehind: !0, greedy: !0, inside: { - target: { pattern: t('^<<0>>(?=\\s*:)', [R]), alias: 'keyword' }, + target: { pattern: s('^<<0>>(?=\\s*:)', [S]), alias: 'keyword' }, 'attribute-arguments': { - pattern: t('\\(<<0>>*\\)', [E]), - inside: s.languages.csharp, + pattern: s('\\(<<0>>*\\)', [z]), + inside: e.languages.csharp, }, 'class-name': { pattern: RegExp(m), inside: { punctuation: /\./ } }, punctuation: /[:,]/, }, }, }); - var S = ':[^}\r\n]+', - j = e(a('[^"\'/()]|<<0>>|\\(<>*\\)', [B]), 2), - A = a('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [j, S]), - F = e( - a('[^"\'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<>*\\)', [ - _, + var A = ':[^}\r\n]+', + F = a(n('[^"\'/()]|<<0>>|\\(<>*\\)', [R]), 2), + P = n('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [F, A]), + U = a( + n('[^"\'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<>*\\)', [ + E, ]), 2 ), - P = a('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [F, S]); - function U(e, n) { + Z = n('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [U, A]); + function q(n, a) { return { interpolation: { - pattern: t('((?:^|[^{])(?:\\{\\{)*)<<0>>', [e]), + pattern: s('((?:^|[^{])(?:\\{\\{)*)<<0>>', [n]), lookbehind: !0, inside: { 'format-string': { - pattern: t('(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)', [n, S]), + pattern: s('(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)', [a, A]), lookbehind: !0, inside: { punctuation: /^:/ }, }, @@ -223,32 +219,32 @@ expression: { pattern: /[\s\S]+/, alias: 'language-csharp', - inside: s.languages.csharp, + inside: e.languages.csharp, }, }, }, string: /[\s\S]+/, }; } - s.languages.insertBefore('csharp', 'string', { + e.languages.insertBefore('csharp', 'string', { 'interpolation-string': [ { - pattern: t( + pattern: s( '(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"', - [A] + [P] ), lookbehind: !0, greedy: !0, - inside: U(A, j), + inside: q(P, F), }, { - pattern: t('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"', [P]), + pattern: s('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"', [Z]), lookbehind: !0, greedy: !0, - inside: U(P, F), + inside: q(Z, U), }, ], - char: { pattern: RegExp(x), greedy: !0 }, + char: { pattern: RegExp(_), greedy: !0 }, }), - (s.languages.dotnet = s.languages.cs = s.languages.csharp); + (e.languages.dotnet = e.languages.cs = e.languages.csharp); })(Prism); diff --git a/public/prism/prism-cshtml.js b/public/prism/prism-cshtml.js index df73bac..c427353 100644 --- a/public/prism/prism-cshtml.js +++ b/public/prism/prism-cshtml.js @@ -30,9 +30,29 @@ } var round = nested(/\((?:[^()'"@/]|||)*\)/.source, 2); - var square = nested(/\[(?:[^\[\]'"@/]|||)*\]/.source, 2); + var square = nested(/\[(?:[^\[\]'"@/]|||)*\]/.source, 1); var curly = nested(/\{(?:[^{}'"@/]|||)*\}/.source, 2); - var angle = nested(/<(?:[^<>'"@/]|||)*>/.source, 2); + var angle = nested(/<(?:[^<>'"@/]||)*>/.source, 1); + + var inlineCs = + /@/.source + + /(?:await\b\s*)?/.source + + '(?:' + + /(?!await\b)\w+\b/.source + + '|' + + round + + ')' + + '(?:' + + /[?!]?\.\w+\b/.source + + '|' + + '(?:' + + angle + + ')?' + + round + + '|' + + square + + ')*' + + /(?![?!\.(\[]|<(?!\/))/.source; // Note about the above bracket patterns: // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and @@ -46,9 +66,21 @@ // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also // allows invalid characters to support HTML expressions like this:

That's it!

. + var tagAttrInlineCs = /@(?![\w()])/.source + '|' + inlineCs; + var tagAttrValue = + '(?:' + + /"[^"@]*"|'[^'@]*'|[^\s'"@>=]+(?=[\s>])/.source + + '|' + + '["\'][^"\'@]*(?:(?:' + + tagAttrInlineCs + + ')[^"\'@]*)+["\']' + + ')'; + var tagAttrs = - /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/ - .source; + /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*|(?=[\s/>])))+)?/.source.replace( + //, + tagAttrValue + ); var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source; var tagRegion = /\B@?/.source + @@ -122,6 +154,28 @@ inside: csharpWithHtml, }; + var inlineValue = { + pattern: RegExp(/(^|[^@])/.source + inlineCs), + lookbehind: true, + greedy: true, + alias: 'variable', + inside: { + keyword: /^@/, + csharp: cs, + }, + }; + + Prism.languages.cshtml.tag.pattern = RegExp(/<\/?/.source + tagContent); + Prism.languages.cshtml.tag.inside['attr-value'].pattern = RegExp( + /=\s*/.source + tagAttrValue + ); + Prism.languages.insertBefore( + 'inside', + 'punctuation', + { value: inlineValue }, + Prism.languages.cshtml.tag.inside['attr-value'] + ); + Prism.languages.insertBefore('cshtml', 'prolog', { 'razor-comment': { pattern: /@\*[\s\S]*?\*@/, @@ -172,6 +226,8 @@ /\s*/.source + curly + ')*', + // @helper Ident(params) { ... } + /helper\s+\w+\s*/.source + round + /\s*/.source + curly, ].join('|') + ')' ), @@ -194,34 +250,7 @@ }, }, - value: { - pattern: RegExp( - /(^|[^@])@/.source + - /(?:await\b\s*)?/.source + - '(?:' + - /\w+\b/.source + - '|' + - round + - ')' + - '(?:' + - /[?!]?\.\w+\b/.source + - '|' + - round + - '|' + - square + - '|' + - angle + - round + - ')*' - ), - lookbehind: true, - greedy: true, - alias: 'variable', - inside: { - keyword: /^@/, - csharp: cs, - }, - }, + value: inlineValue, 'delegate-operator': { pattern: /(^|[^@])@(?=<)/, diff --git a/public/prism/prism-cshtml.min.js b/public/prism/prism-cshtml.min.js index 0ca0caf..25d1059 100644 --- a/public/prism/prism-cshtml.min.js +++ b/public/prism/prism-cshtml.min.js @@ -8,8 +8,7 @@ .replace(//g, '[^\\s\\S]') .replace( //g, - '(?:@(?!")|"(?:[^\r\n\\\\"]|\\\\.)*"|@"(?:[^\\\\"]|""|\\\\[^])*"(?!")|' + - "'(?:(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'|(?=[^\\\\](?!'))))" + '(?:@(?!")|"(?:[^\r\n\\\\"]|\\\\.)*"|@"(?:[^\\\\"]|""|\\\\[^])*"(?!")|\'(?:(?:[^\r\n\'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})\'|(?=[^\\\\](?!\'))))' ) .replace( //g, @@ -17,104 +16,121 @@ ); } var a = s('\\((?:[^()\'"@/]|||)*\\)', 2), - r = s('\\[(?:[^\\[\\]\'"@/]|||)*\\]', 2), - t = s('\\{(?:[^{}\'"@/]|||)*\\}', 2), - n = s('<(?:[^<>\'"@/]|||)*>', 2), + t = s('\\[(?:[^\\[\\]\'"@/]|||)*\\]', 1), + r = s('\\{(?:[^{}\'"@/]|||)*\\}', 2), + n = + '@(?:await\\b\\s*)?(?:(?!await\\b)\\w+\\b|' + + a + + ')(?:[?!]?\\.\\w+\\b|(?:' + + s('<(?:[^<>\'"@/]||)*>', 1) + + ')?' + + a + + '|' + + t + + ')*(?![?!\\.(\\[]|<(?!/))', l = - '(?:\\s(?:\\s*[^\\s>/=]+(?:\\s*=\\s*(?:"[^"]*"|\'[^\']*\'|[^\\s\'">=]+(?=[\\s>]))|(?=[\\s/>])))+)?', - i = '(?!\\d)[^\\s>/=$<%]+' + l + '\\s*/?>', + '(?:"[^"@]*"|\'[^\'@]*\'|[^\\s\'"@>=]+(?=[\\s>])|["\'][^"\'@]*(?:(?:@(?![\\w()])|' + + n + + ')[^"\'@]*)+["\'])', + i = + '(?:\\s(?:\\s*[^\\s>/=]+(?:\\s*=\\s*|(?=[\\s/>])))+)?'.replace( + //, + l + ), + g = '(?!\\d)[^\\s>/=$<%]+' + i + '\\s*/?>', o = '\\B@?(?:<([a-zA-Z][\\w:]*)' + - l + - '\\s*>(?:[^<]|(?:[^<]|(?:[^<]|)*', + '<\\1' + i + '\\s*>(?:[^<]|)*', 2 ) + ')*|<' + - i + + g + ')'; e.languages.cshtml = e.languages.extend('markup', {}); - var g = { - pattern: /\S[\s\S]*/, - alias: 'language-csharp', - inside: e.languages.insertBefore( - 'csharp', - 'string', - { html: { pattern: RegExp(o), greedy: !0, inside: e.languages.cshtml } }, - { csharp: e.languages.extend('csharp', {}) } - ), - }; - e.languages.insertBefore('cshtml', 'prolog', { - 'razor-comment': { - pattern: /@\*[\s\S]*?\*@/, - greedy: !0, - alias: 'comment', - }, - block: { - pattern: RegExp( - '(^|[^@])@(?:' + - [ - t, - '(?:code|functions)\\s*' + t, - '(?:for|foreach|lock|switch|using|while)\\s*' + a + '\\s*' + t, - 'do\\s*' + t + '\\s*while\\s*' + a + '(?:\\s*;)?', - 'try\\s*' + - t + - '\\s*catch\\s*' + - a + - '\\s*' + - t + - '\\s*finally\\s*' + - t, - 'if\\s*' + - a + - '\\s*' + - t + - '(?:\\s*else(?:\\s+if\\s*' + - a + - ')?\\s*' + - t + - ')*', - ].join('|') + - ')' + var c = { + pattern: /\S[\s\S]*/, + alias: 'language-csharp', + inside: e.languages.insertBefore( + 'csharp', + 'string', + { + html: { pattern: RegExp(o), greedy: !0, inside: e.languages.cshtml }, + }, + { csharp: e.languages.extend('csharp', {}) } ), - lookbehind: !0, - greedy: !0, - inside: { keyword: /^@\w*/, csharp: g }, }, - directive: { - pattern: - /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m, - lookbehind: !0, - greedy: !0, - inside: { keyword: /^@\w+/, csharp: g }, - }, - value: { - pattern: RegExp( - '(^|[^@])@(?:await\\b\\s*)?(?:\\w+\\b|' + - a + - ')(?:[?!]?\\.\\w+\\b|' + - a + - '|' + - r + - '|' + - n + - a + - ')*' - ), + p = { + pattern: RegExp('(^|[^@])' + n), lookbehind: !0, greedy: !0, alias: 'variable', - inside: { keyword: /^@/, csharp: g }, - }, - 'delegate-operator': { - pattern: /(^|[^@])@(?=<)/, - lookbehind: !0, - alias: 'operator', - }, - }), + inside: { keyword: /^@/, csharp: c }, + }; + (e.languages.cshtml.tag.pattern = RegExp(')*"""/.source + + // eslint-disable-next-line regexp/strict + '|' + + /'''(?:[^\\']|'(?!''\2)|)*'''/.source + + // eslint-disable-next-line regexp/strict + '|' + + /"(?:[^\\\r\n"]|"(?!\2)|)*"/.source + + // eslint-disable-next-line regexp/strict + '|' + + /'(?:[^\\\r\n']|'(?!\2)|)*'/.source; + var stringLiteral = '(?:' + stringTypes.replace(//g, stringEscape) + ')'; + + Prism.languages.cue = { + comment: { + pattern: /\/\/.*/, + greedy: true, + }, + 'string-literal': { + // eslint-disable-next-line regexp/strict + pattern: RegExp( + /(^|[^#"'\\])(#*)/.source + stringLiteral + /(?!["'])\2/.source + ), + lookbehind: true, + greedy: true, + inside: { + // I'm using dirty hack here. We have to know the number hashes at the start of the string somehow, + // but we can't look back. So instead, we will use a lookahead, go to the end of the string, and + // capture the hashes at the end of the string. + escape: { + pattern: + /(?=[\s\S]*["'](#*)$)\\\1(?:U[a-fA-F0-9]{1,8}|u[a-fA-F0-9]{1,4}|x[a-fA-F0-9]{1,2}|\d{2,3}|[^(])/, + greedy: true, + alias: 'string', + }, + interpolation: { + pattern: /(?=[\s\S]*["'](#*)$)\\\1\([^()]*\)/, + greedy: true, + inside: { + punctuation: /^\\#*\(|\)$/, + expression: { + pattern: /[\s\S]+/, + inside: null, + }, + }, + }, + string: /[\s\S]+/, + }, + }, + + keyword: { + pattern: /(^|[^\w$])(?:for|if|import|in|let|null|package)(?![\w$])/, + lookbehind: true, + }, + boolean: { + pattern: /(^|[^\w$])(?:false|true)(?![\w$])/, + lookbehind: true, + }, + builtin: { + pattern: + /(^|[^\w$])(?:bool|bytes|float|float(?:32|64)|u?int(?:8|16|32|64|128)?|number|rune|string)(?![\w$])/, + lookbehind: true, + }, + + attribute: { + pattern: /@[\w$]+(?=\s*\()/, + alias: 'function', + }, + function: { + pattern: /(^|[^\w$])[a-z_$][\w$]*(?=\s*\()/i, + lookbehind: true, + }, + + number: { + pattern: + /(^|[^\w$.])(?:0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*|(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[eE][+-]?\d+(?:_\d+)*)?(?:[KMGTP]i?)?)(?![\w$])/, + lookbehind: true, + }, + + operator: /\.{3}|_\|_|&&?|\|\|?|[=!]~|[<>=!]=?|[+\-*/?]/, + punctuation: /[()[\]{},.:]/, + }; + + Prism.languages.cue[ + 'string-literal' + ].inside.interpolation.inside.expression.inside = Prism.languages.cue; +})(Prism); diff --git a/public/prism/prism-cue.min.js b/public/prism/prism-cue.min.js new file mode 100644 index 0000000..10a1176 --- /dev/null +++ b/public/prism/prism-cue.min.js @@ -0,0 +1,56 @@ +!(function (e) { + var n = + '(?:' + + '"""(?:[^\\\\"]|"(?!""\\2)|)*"""|\'\'\'(?:[^\\\\\']|\'(?!\'\'\\2)|)*\'\'\'|"(?:[^\\\\\r\n"]|"(?!\\2)|)*"|\'(?:[^\\\\\r\n\']|\'(?!\\2)|)*\''.replace( + //g, + '\\\\(?:(?!\\2)|\\2(?:[^()\r\n]|\\([^()]*\\)))' + ) + + ')'; + (e.languages.cue = { + comment: { pattern: /\/\/.*/, greedy: !0 }, + 'string-literal': { + pattern: RegExp('(^|[^#"\'\\\\])(#*)' + n + '(?!["\'])\\2'), + lookbehind: !0, + greedy: !0, + inside: { + escape: { + pattern: + /(?=[\s\S]*["'](#*)$)\\\1(?:U[a-fA-F0-9]{1,8}|u[a-fA-F0-9]{1,4}|x[a-fA-F0-9]{1,2}|\d{2,3}|[^(])/, + greedy: !0, + alias: 'string', + }, + interpolation: { + pattern: /(?=[\s\S]*["'](#*)$)\\\1\([^()]*\)/, + greedy: !0, + inside: { + punctuation: /^\\#*\(|\)$/, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }, + string: /[\s\S]+/, + }, + }, + keyword: { + pattern: /(^|[^\w$])(?:for|if|import|in|let|null|package)(?![\w$])/, + lookbehind: !0, + }, + boolean: { pattern: /(^|[^\w$])(?:false|true)(?![\w$])/, lookbehind: !0 }, + builtin: { + pattern: + /(^|[^\w$])(?:bool|bytes|float|float(?:32|64)|u?int(?:8|16|32|64|128)?|number|rune|string)(?![\w$])/, + lookbehind: !0, + }, + attribute: { pattern: /@[\w$]+(?=\s*\()/, alias: 'function' }, + function: { pattern: /(^|[^\w$])[a-z_$][\w$]*(?=\s*\()/i, lookbehind: !0 }, + number: { + pattern: + /(^|[^\w$.])(?:0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*|(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[eE][+-]?\d+(?:_\d+)*)?(?:[KMGTP]i?)?)(?![\w$])/, + lookbehind: !0, + }, + operator: /\.{3}|_\|_|&&?|\|\|?|[=!]~|[<>=!]=?|[+\-*/?]/, + punctuation: /[()[\]{},.:]/, + }), + (e.languages.cue[ + 'string-literal' + ].inside.interpolation.inside.expression.inside = e.languages.cue); +})(Prism); diff --git a/public/prism/prism-dataweave.min.js b/public/prism/prism-dataweave.min.js index a0d2dde..85893f8 100644 --- a/public/prism/prism-dataweave.min.js +++ b/public/prism/prism-dataweave.min.js @@ -1,22 +1,28 @@ -Prism.languages.dataweave = { - url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/, - property: { - pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/, - greedy: !0, - }, - string: { pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, greedy: !0 }, - 'mime-type': /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/, - date: { pattern: /\|[\w:+-]+\|/, greedy: !0 }, - comment: [ - { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, - { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, - ], - regex: { pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//, greedy: !0 }, - keyword: - /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/, - function: /\b[A-Z_]\w*(?=\s*\()/i, - number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, - punctuation: /[{}[\];(),.:@]/, - operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/, - boolean: /\b(?:false|true)\b/, -}; +!(function (e) { + e.languages.dataweave = { + url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/, + property: { + pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/, + greedy: !0, + }, + string: { pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, greedy: !0 }, + 'mime-type': /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/, + date: { pattern: /\|[\w:+-]+\|/, greedy: !0 }, + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + greedy: !0, + }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + regex: { pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//, greedy: !0 }, + keyword: + /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/, + function: /\b[A-Z_]\w*(?=\s*\()/i, + number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + punctuation: /[{}[\];(),.:@]/, + operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/, + boolean: /\b(?:false|true)\b/, + }; +})(Prism); diff --git a/public/prism/prism-diff.min.js b/public/prism/prism-diff.min.js index 899368a..3bf005b 100644 --- a/public/prism/prism-diff.min.js +++ b/public/prism/prism-diff.min.js @@ -1,8 +1,8 @@ -!(function (i) { - i.languages.diff = { +!(function (e) { + e.languages.diff = { coord: [/^(?:\*{3}|-{3}|\+{3}).*$/m, /^@@.*@@$/m, /^\d.*$/m], }; - var r = { + var n = { 'deleted-sign': '-', 'deleted-arrow': '<', 'inserted-sign': '+', @@ -10,19 +10,19 @@ unchanged: ' ', diff: '!', }; - Object.keys(r).forEach(function (e) { - var n = r[e], - a = []; - /^\w+$/.test(e) || a.push(/\w+/.exec(e)[0]), - 'diff' === e && a.push('bold'), - (i.languages.diff[e] = { - pattern: RegExp('^(?:[' + n + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'), - alias: a, + Object.keys(n).forEach(function (a) { + var i = n[a], + r = []; + /^\w+$/.test(a) || r.push(/\w+/.exec(a)[0]), + 'diff' === a && r.push('bold'), + (e.languages.diff[a] = { + pattern: RegExp('^(?:[' + i + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'), + alias: r, inside: { line: { pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/, lookbehind: !0 }, - prefix: { pattern: /[\s\S]/, alias: /\w+/.exec(e)[0] }, + prefix: { pattern: /[\s\S]/, alias: /\w+/.exec(a)[0] }, }, }); }), - Object.defineProperty(i.languages.diff, 'PREFIXES', { value: r }); + Object.defineProperty(e.languages.diff, 'PREFIXES', { value: n }); })(Prism); diff --git a/public/prism/prism-docker.min.js b/public/prism/prism-docker.min.js index 87e86ea..665a2fb 100644 --- a/public/prism/prism-docker.min.js +++ b/public/prism/prism-docker.min.js @@ -1,30 +1,30 @@ !(function (e) { - var r = '(?:[ \t]+(?![ \t])(?:)?|)'.replace( + var n = '(?:[ \t]+(?![ \t])(?:)?|)'.replace( //g, function () { return '\\\\[\r\n](?:\\s|\\\\[\r\n]|#.*(?!.))*(?![\\s#]|\\\\[\r\n])'; } ), - n = + r = '"(?:[^"\\\\\r\n]|\\\\(?:\r\n|[^]))*"|\'(?:[^\'\\\\\r\n]|\\\\(?:\r\n|[^]))*\'', t = '--[\\w-]+=(?:|(?!["\'])(?:[^\\s\\\\]|\\\\.)+)'.replace( //g, function () { - return n; + return r; } ), - o = { pattern: RegExp(n), greedy: !0 }, + o = { pattern: RegExp(r), greedy: !0 }, i = { pattern: /(^[ \t]*)#.*/m, lookbehind: !0, greedy: !0 }; - function a(e, n) { + function a(e, r) { return ( (e = e .replace(//g, function () { return t; }) .replace(//g, function () { - return r; + return n; })), - RegExp(e, n) + RegExp(e, r) ); } (e.languages.docker = { diff --git a/public/prism/prism-dot.min.js b/public/prism/prism-dot.min.js index 44dd9a3..39bffbf 100644 --- a/public/prism/prism-dot.min.js +++ b/public/prism/prism-dot.min.js @@ -1,5 +1,5 @@ !(function (e) { - var n = + var a = '(?:' + [ '[a-zA-Z_\\x80-\\uFFFF][\\w\\x80-\\uFFFF]*', @@ -8,7 +8,7 @@ '<(?:[^<>]|(?!\x3c!--)<(?:[^<>"\']|"[^"]*"|\'[^\']*\')+>|\x3c!--(?:[^-]|-(?!->))*--\x3e)*>', ].join('|') + ')', - a = { + n = { markup: { pattern: /(^<)[\s\S]+(?=>$)/, lookbehind: !0, @@ -16,12 +16,12 @@ inside: e.languages.markup, }, }; - function r(e, a) { + function r(e, n) { return RegExp( e.replace(//g, function () { - return n; + return a; }), - a + n ); } (e.languages.dot = { @@ -31,19 +31,19 @@ lookbehind: !0, greedy: !0, alias: 'class-name', - inside: a, + inside: n, }, 'attr-value': { pattern: r('(=[ \t\r\n]*)'), lookbehind: !0, greedy: !0, - inside: a, + inside: n, }, 'attr-name': { pattern: r('([\\[;, \t\r\n])(?=[ \t\r\n]*=)'), lookbehind: !0, greedy: !0, - inside: a, + inside: n, }, keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i, 'compass-point': { @@ -55,7 +55,7 @@ pattern: r('(^|[^-.\\w\\x80-\\uFFFF\\\\])'), lookbehind: !0, greedy: !0, - inside: a, + inside: n, }, operator: /[=:]|-[->]/, punctuation: /[\[\]{};,]/, diff --git a/public/prism/prism-editorconfig.js b/public/prism/prism-editorconfig.js index 66fad09..ad3b6e2 100644 --- a/public/prism/prism-editorconfig.js +++ b/public/prism/prism-editorconfig.js @@ -4,7 +4,7 @@ Prism.languages.editorconfig = { section: { pattern: /(^[ \t]*)\[.+\]/m, lookbehind: true, - alias: 'keyword', + alias: 'selector', inside: { regex: /\\\\[\[\]{},!?.*]/, // Escape special characters with '\\' operator: /[!?]|\.\.|\*{1,2}/, diff --git a/public/prism/prism-editorconfig.min.js b/public/prism/prism-editorconfig.min.js index fe6660b..e5bbc78 100644 --- a/public/prism/prism-editorconfig.min.js +++ b/public/prism/prism-editorconfig.min.js @@ -3,7 +3,7 @@ Prism.languages.editorconfig = { section: { pattern: /(^[ \t]*)\[.+\]/m, lookbehind: !0, - alias: 'keyword', + alias: 'selector', inside: { regex: /\\\\[\[\]{},!?.*]/, operator: /[!?]|\.\.|\*{1,2}/, diff --git a/public/prism/prism-ejs.min.js b/public/prism/prism-ejs.min.js index fe2c434..2c778e2 100644 --- a/public/prism/prism-ejs.min.js +++ b/public/prism/prism-ejs.min.js @@ -1,21 +1,21 @@ -!(function (e) { - (e.languages.ejs = { +!(function (a) { + (a.languages.ejs = { delimiter: { pattern: /^<%[-_=]?|[-_]?%>$/, alias: 'punctuation' }, comment: /^#[\s\S]*/, 'language-javascript': { pattern: /[\s\S]+/, - inside: e.languages.javascript, + inside: a.languages.javascript, }, }), - e.hooks.add('before-tokenize', function (a) { - e.languages['markup-templating'].buildPlaceholders( - a, + a.hooks.add('before-tokenize', function (e) { + a.languages['markup-templating'].buildPlaceholders( + e, 'ejs', /<%(?!%)[\s\S]+?%>/g ); }), - e.hooks.add('after-tokenize', function (a) { - e.languages['markup-templating'].tokenizePlaceholders(a, 'ejs'); + a.hooks.add('after-tokenize', function (e) { + a.languages['markup-templating'].tokenizePlaceholders(e, 'ejs'); }), - (e.languages.eta = e.languages.ejs); + (a.languages.eta = a.languages.ejs); })(Prism); diff --git a/public/prism/prism-erb.min.js b/public/prism/prism-erb.min.js index 90e72c9..a76fb64 100644 --- a/public/prism/prism-erb.min.js +++ b/public/prism/prism-erb.min.js @@ -1,5 +1,5 @@ -!(function (n) { - (n.languages.erb = { +!(function (e) { + (e.languages.erb = { delimiter: { pattern: /^(\s*)<%=?|%>(?=\s*$)/, lookbehind: !0, @@ -8,17 +8,17 @@ ruby: { pattern: /\s*\S[\s\S]*/, alias: 'language-ruby', - inside: n.languages.ruby, + inside: e.languages.ruby, }, }), - n.hooks.add('before-tokenize', function (e) { - n.languages['markup-templating'].buildPlaceholders( - e, + e.hooks.add('before-tokenize', function (n) { + e.languages['markup-templating'].buildPlaceholders( + n, 'erb', /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g ); }), - n.hooks.add('after-tokenize', function (e) { - n.languages['markup-templating'].tokenizePlaceholders(e, 'erb'); + e.hooks.add('after-tokenize', function (n) { + e.languages['markup-templating'].tokenizePlaceholders(n, 'erb'); }); })(Prism); diff --git a/public/prism/prism-erlang.js b/public/prism/prism-erlang.js index bfd4aa3..521d7a2 100644 --- a/public/prism/prism-erlang.js +++ b/public/prism/prism-erlang.js @@ -13,7 +13,7 @@ Prism.languages.erlang = { alias: 'atom', }, boolean: /\b(?:false|true)\b/, - keyword: /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/, + keyword: /\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/, number: [ /\$\\?./, /\b\d+#[a-z0-9]+/i, diff --git a/public/prism/prism-erlang.min.js b/public/prism/prism-erlang.min.js index c670dd5..bca12fd 100644 --- a/public/prism/prism-erlang.min.js +++ b/public/prism/prism-erlang.min.js @@ -7,7 +7,7 @@ Prism.languages.erlang = { }, 'quoted-atom': { pattern: /'(?:\\.|[^\\'\r\n])+'/, alias: 'atom' }, boolean: /\b(?:false|true)\b/, - keyword: /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/, + keyword: /\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/, number: [ /\$\\?./, /\b\d+#[a-z0-9]+/i, diff --git a/public/prism/prism-etlua.min.js b/public/prism/prism-etlua.min.js index 331398d..188ef9d 100644 --- a/public/prism/prism-etlua.min.js +++ b/public/prism/prism-etlua.min.js @@ -1,16 +1,16 @@ -!(function (e) { - (e.languages.etlua = { +!(function (a) { + (a.languages.etlua = { delimiter: { pattern: /^<%[-=]?|-?%>$/, alias: 'punctuation' }, - 'language-lua': { pattern: /[\s\S]+/, inside: e.languages.lua }, + 'language-lua': { pattern: /[\s\S]+/, inside: a.languages.lua }, }), - e.hooks.add('before-tokenize', function (a) { - e.languages['markup-templating'].buildPlaceholders( - a, + a.hooks.add('before-tokenize', function (e) { + a.languages['markup-templating'].buildPlaceholders( + e, 'etlua', /<%[\s\S]+?%>/g ); }), - e.hooks.add('after-tokenize', function (a) { - e.languages['markup-templating'].tokenizePlaceholders(a, 'etlua'); + a.hooks.add('after-tokenize', function (e) { + a.languages['markup-templating'].tokenizePlaceholders(e, 'etlua'); }); })(Prism); diff --git a/public/prism/prism-excel-formula.js b/public/prism/prism-excel-formula.js index 1338efe..d206c62 100644 --- a/public/prism/prism-excel-formula.js +++ b/public/prism/prism-excel-formula.js @@ -40,12 +40,12 @@ Prism.languages['excel-formula'] = { }, 'function-name': { pattern: /\b[A-Z]\w*(?=\()/i, - alias: 'keyword', + alias: 'builtin', }, range: { pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i, - alias: 'property', + alias: 'selector', inside: { operator: /:/, cell: /\$?[A-Z]+\$?\d+/i, @@ -57,7 +57,7 @@ Prism.languages['excel-formula'] = { // Excel is case insensitive, so the string "foo1" could be either a variable or a cell. // To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise. pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/, - alias: 'property', + alias: 'selector', }, number: /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i, boolean: /\b(?:FALSE|TRUE)\b/i, diff --git a/public/prism/prism-excel-formula.min.js b/public/prism/prism-excel-formula.min.js index 838e1fc..4d27312 100644 --- a/public/prism/prism-excel-formula.min.js +++ b/public/prism/prism-excel-formula.min.js @@ -18,11 +18,11 @@ path: /[\s\S]+/, }, }, - 'function-name': { pattern: /\b[A-Z]\w*(?=\()/i, alias: 'keyword' }, + 'function-name': { pattern: /\b[A-Z]\w*(?=\()/i, alias: 'builtin' }, range: { pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i, - alias: 'property', + alias: 'selector', inside: { operator: /:/, cell: /\$?[A-Z]+\$?\d+/i, @@ -32,7 +32,7 @@ }, cell: { pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/, - alias: 'property', + alias: 'selector', }, number: /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i, boolean: /\b(?:FALSE|TRUE)\b/i, diff --git a/public/prism/prism-factor.min.js b/public/prism/prism-factor.min.js index 70fb151..9cf6720 100644 --- a/public/prism/prism-factor.min.js +++ b/public/prism/prism-factor.min.js @@ -525,221 +525,221 @@ }; Object.keys(a).forEach(function (e) { i[e].pattern = r(a[e]); - }); - (i.combinators.pattern = r([ - '2bi', - 'while', - '2tri', - 'bi*', - '4dip', - 'both?', - 'same?', - 'tri@', - 'curry', - 'prepose', - '3bi', - '?if', - 'tri*', - '2keep', - '3keep', - 'curried', - '2keepd', - 'when', - '2bi*', - '2tri*', - '4keep', - 'bi@', - 'keepdd', - 'do', - 'unless*', - 'tri-curry', - 'if*', - 'loop', - 'bi-curry*', - 'when*', - '2bi@', - '2tri@', - 'with', - '2with', - 'either?', - 'bi', - 'until', - '3dip', - '3curry', - 'tri-curry*', - 'tri-curry@', - 'bi-curry', - 'keepd', - 'compose', - '2dip', - 'if', - '3tri', - 'unless', - 'tuple', - 'keep', - '2curry', - 'tri', - 'most', - 'while*', - 'dip', - 'composed', - 'bi-curry@', - 'find-last-from', - 'trim-head-slice', - 'map-as', - 'each-from', - 'none?', - 'trim-tail', - 'partition', - 'if-empty', - 'accumulate*', - 'reject!', - 'find-from', - 'accumulate-as', - 'collector-for-as', - 'reject', - 'map', - 'map-sum', - 'accumulate!', - '2each-from', - 'follow', - 'supremum-by', - 'map!', - 'unless-empty', - 'collector', - 'padding', - 'reduce-index', - 'replicate-as', - 'infimum-by', - 'trim-tail-slice', - 'count', - 'find-index', - 'filter', - 'accumulate*!', - 'reject-as', - 'map-integers', - 'map-find', - 'reduce', - 'selector', - 'interleave', - '2map', - 'filter-as', - 'binary-reduce', - 'map-index-as', - 'find', - 'produce', - 'filter!', - 'replicate', - 'cartesian-map', - 'cartesian-each', - 'find-index-from', - 'map-find-last', - '3map-as', - '3map', - 'find-last', - 'selector-as', - '2map-as', - '2map-reduce', - 'accumulate', - 'each', - 'each-index', - 'accumulate*-as', - 'when-empty', - 'all?', - 'collector-as', - 'push-either', - 'new-like', - 'collector-for', - '2selector', - 'push-if', - '2all?', - 'map-reduce', - '3each', - 'any?', - 'trim-slice', - '2reduce', - 'change-nth', - 'produce-as', - '2each', - 'trim', - 'trim-head', - 'cartesian-find', - 'map-index', - 'if-zero', - 'each-integer', - 'unless-zero', - '(find-integer)', - 'when-zero', - 'find-last-integer', - '(all-integers?)', - 'times', - '(each-integer)', - 'find-integer', - 'all-integers?', - 'unless-negative', - 'if-positive', - 'when-positive', - 'when-negative', - 'unless-positive', - 'if-negative', - 'case', - '2cleave', - 'cond>quot', - 'case>quot', - '3cleave', - 'wrong-values', - 'to-fixed-point', - 'alist>quot', - 'cond', - 'cleave', - 'call-effect', - 'recursive-hashcode', - 'spread', - 'deep-spread>quot', - '2||', - '0||', - 'n||', - '0&&', - '2&&', - '3||', - '1||', - '1&&', - 'n&&', - '3&&', - 'smart-unless*', - 'keep-inputs', - 'reduce-outputs', - 'smart-when*', - 'cleave>array', - 'smart-with', - 'smart-apply', - 'smart-if', - 'inputs/outputs', - 'output>sequence-n', - 'map-outputs', - 'map-reduce-outputs', - 'dropping', - 'output>array', - 'smart-map-reduce', - 'smart-2map-reduce', - 'output>array-n', - 'nullary', - 'inputsequence', - ])), + }), + (i.combinators.pattern = r([ + '2bi', + 'while', + '2tri', + 'bi*', + '4dip', + 'both?', + 'same?', + 'tri@', + 'curry', + 'prepose', + '3bi', + '?if', + 'tri*', + '2keep', + '3keep', + 'curried', + '2keepd', + 'when', + '2bi*', + '2tri*', + '4keep', + 'bi@', + 'keepdd', + 'do', + 'unless*', + 'tri-curry', + 'if*', + 'loop', + 'bi-curry*', + 'when*', + '2bi@', + '2tri@', + 'with', + '2with', + 'either?', + 'bi', + 'until', + '3dip', + '3curry', + 'tri-curry*', + 'tri-curry@', + 'bi-curry', + 'keepd', + 'compose', + '2dip', + 'if', + '3tri', + 'unless', + 'tuple', + 'keep', + '2curry', + 'tri', + 'most', + 'while*', + 'dip', + 'composed', + 'bi-curry@', + 'find-last-from', + 'trim-head-slice', + 'map-as', + 'each-from', + 'none?', + 'trim-tail', + 'partition', + 'if-empty', + 'accumulate*', + 'reject!', + 'find-from', + 'accumulate-as', + 'collector-for-as', + 'reject', + 'map', + 'map-sum', + 'accumulate!', + '2each-from', + 'follow', + 'supremum-by', + 'map!', + 'unless-empty', + 'collector', + 'padding', + 'reduce-index', + 'replicate-as', + 'infimum-by', + 'trim-tail-slice', + 'count', + 'find-index', + 'filter', + 'accumulate*!', + 'reject-as', + 'map-integers', + 'map-find', + 'reduce', + 'selector', + 'interleave', + '2map', + 'filter-as', + 'binary-reduce', + 'map-index-as', + 'find', + 'produce', + 'filter!', + 'replicate', + 'cartesian-map', + 'cartesian-each', + 'find-index-from', + 'map-find-last', + '3map-as', + '3map', + 'find-last', + 'selector-as', + '2map-as', + '2map-reduce', + 'accumulate', + 'each', + 'each-index', + 'accumulate*-as', + 'when-empty', + 'all?', + 'collector-as', + 'push-either', + 'new-like', + 'collector-for', + '2selector', + 'push-if', + '2all?', + 'map-reduce', + '3each', + 'any?', + 'trim-slice', + '2reduce', + 'change-nth', + 'produce-as', + '2each', + 'trim', + 'trim-head', + 'cartesian-find', + 'map-index', + 'if-zero', + 'each-integer', + 'unless-zero', + '(find-integer)', + 'when-zero', + 'find-last-integer', + '(all-integers?)', + 'times', + '(each-integer)', + 'find-integer', + 'all-integers?', + 'unless-negative', + 'if-positive', + 'when-positive', + 'when-negative', + 'unless-positive', + 'if-negative', + 'case', + '2cleave', + 'cond>quot', + 'case>quot', + '3cleave', + 'wrong-values', + 'to-fixed-point', + 'alist>quot', + 'cond', + 'cleave', + 'call-effect', + 'recursive-hashcode', + 'spread', + 'deep-spread>quot', + '2||', + '0||', + 'n||', + '0&&', + '2&&', + '3||', + '1||', + '1&&', + 'n&&', + '3&&', + 'smart-unless*', + 'keep-inputs', + 'reduce-outputs', + 'smart-when*', + 'cleave>array', + 'smart-with', + 'smart-apply', + 'smart-if', + 'inputs/outputs', + 'output>sequence-n', + 'map-outputs', + 'map-reduce-outputs', + 'dropping', + 'output>array', + 'smart-map-reduce', + 'smart-2map-reduce', + 'output>array-n', + 'nullary', + 'inputsequence', + ])), (e.languages.factor = i); })(Prism); diff --git a/public/prism/prism-false.min.js b/public/prism/prism-false.min.js index 39621e5..01cc69d 100644 --- a/public/prism/prism-false.min.js +++ b/public/prism/prism-false.min.js @@ -1,11 +1,13 @@ -Prism.languages.false = { - comment: { pattern: /\{[^}]*\}/ }, - string: { pattern: /"[^"]*"/, greedy: !0 }, - 'character-code': { pattern: /'(?:[^\r]|\r\n?)/, alias: 'number' }, - 'assembler-code': { pattern: /\d+`/, alias: 'important' }, - number: /\d+/, - operator: /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/, - punctuation: /\[|\]/, - variable: /[a-z]/, - 'non-standard': { pattern: /[()?@\\^_`|~ßø]/, + punctuation: /\[|\]/, + variable: /[a-z]/, + 'non-standard': { pattern: /[())*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|"(?:[^\\\\"]|\\\\.)*"|\'(?:[^\\\\\']|\\\\.)*\'', - e = 0; - e < 2; - e++ + n = 0; + n < 2; + n++ ) - i = i.replace(//g, function () { - return i; + t = t.replace(//g, function () { + return t; }); - i = i.replace(//g, '[^\\s\\S]'); - var t = { + t = t.replace(//g, '[^\\s\\S]'); + var i = { comment: /<#--[\s\S]*?-->/, string: [ { pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/, greedy: !0 }, @@ -19,7 +19,7 @@ '("|\')(?:(?!\\1|\\$\\{)[^\\\\]|\\\\.|\\$\\{(?:(?!\\})(?:))*\\})*\\1'.replace( //g, function () { - return i; + return t; } ) ), @@ -30,7 +30,7 @@ '((?:^|[^\\\\])(?:\\\\\\\\)*)\\$\\{(?:(?!\\})(?:))*\\}'.replace( //g, function () { - return i; + return t; } ) ), @@ -59,8 +59,8 @@ /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/, punctuation: /[,;.:()[\]{}]/, }; - (t.string[1].inside.interpolation.inside.rest = t), - (n.languages.ftl = { + (i.string[1].inside.interpolation.inside.rest = i), + (e.languages.ftl = { 'ftl-comment': { pattern: /^<#--[\s\S]*/, alias: 'comment' }, 'ftl-directive': { pattern: /^<[\s\S]+>$/, @@ -71,30 +71,30 @@ alias: 'keyword', }, punctuation: /^<\/?|\/?>$/, - content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t }, + content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: i }, }, }, 'ftl-interpolation': { pattern: /^\$\{[\s\S]*\}$/, inside: { punctuation: /^\$\{|\}$/, - content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t }, + content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: i }, }, }, }), - n.hooks.add('before-tokenize', function (e) { - var t = RegExp( + e.hooks.add('before-tokenize', function (n) { + var i = RegExp( '<#--[^]*?--\x3e|)*?>|\\$\\{(?:)*?\\}'.replace( //g, function () { - return i; + return t; } ), 'gi' ); - n.languages['markup-templating'].buildPlaceholders(e, 'ftl', t); + e.languages['markup-templating'].buildPlaceholders(n, 'ftl', i); }), - n.hooks.add('after-tokenize', function (e) { - n.languages['markup-templating'].tokenizePlaceholders(e, 'ftl'); + e.hooks.add('after-tokenize', function (t) { + e.languages['markup-templating'].tokenizePlaceholders(t, 'ftl'); }); })(Prism); diff --git a/public/prism/prism-gedcom.js b/public/prism/prism-gedcom.js index 9819c04..08244b7 100644 --- a/public/prism/prism-gedcom.js +++ b/public/prism/prism-gedcom.js @@ -11,12 +11,12 @@ Prism.languages.gedcom = { }, }, }, - tag: { + record: { // Preceded by level and optional pointer pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, lookbehind: true, - alias: 'string', + alias: 'tag', }, level: { pattern: /(^[\t ]*)\d+/m, diff --git a/public/prism/prism-gedcom.min.js b/public/prism/prism-gedcom.min.js index f8d5912..4bb5d0a 100644 --- a/public/prism/prism-gedcom.min.js +++ b/public/prism/prism-gedcom.min.js @@ -10,11 +10,11 @@ Prism.languages.gedcom = { }, }, }, - tag: { + record: { pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, lookbehind: !0, - alias: 'string', + alias: 'tag', }, level: { pattern: /(^[\t ]*)\d+/m, lookbehind: !0, alias: 'number' }, pointer: { diff --git a/public/prism/prism-gettext.js b/public/prism/prism-gettext.js new file mode 100644 index 0000000..e2b351d --- /dev/null +++ b/public/prism/prism-gettext.js @@ -0,0 +1,43 @@ +Prism.languages.gettext = { + comment: [ + { + pattern: /# .*/, + greedy: true, + alias: 'translator-comment', + }, + { + pattern: /#\..*/, + greedy: true, + alias: 'extracted-comment', + }, + { + pattern: /#:.*/, + greedy: true, + alias: 'reference-comment', + }, + { + pattern: /#,.*/, + greedy: true, + alias: 'flag-comment', + }, + { + pattern: /#\|.*/, + greedy: true, + alias: 'previously-untranslated-comment', + }, + { + pattern: /#.*/, + greedy: true, + }, + ], + string: { + pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/, + lookbehind: true, + greedy: true, + }, + keyword: /^msg(?:ctxt|id|id_plural|str)\b/m, + number: /\b\d+\b/, + punctuation: /[\[\]]/, +}; + +Prism.languages.po = Prism.languages.gettext; diff --git a/public/prism/prism-gettext.min.js b/public/prism/prism-gettext.min.js new file mode 100644 index 0000000..9a9061b --- /dev/null +++ b/public/prism/prism-gettext.min.js @@ -0,0 +1,15 @@ +(Prism.languages.gettext = { + comment: [ + { pattern: /# .*/, greedy: !0, alias: 'translator-comment' }, + { pattern: /#\..*/, greedy: !0, alias: 'extracted-comment' }, + { pattern: /#:.*/, greedy: !0, alias: 'reference-comment' }, + { pattern: /#,.*/, greedy: !0, alias: 'flag-comment' }, + { pattern: /#\|.*/, greedy: !0, alias: 'previously-untranslated-comment' }, + { pattern: /#.*/, greedy: !0 }, + ], + string: { pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/, lookbehind: !0, greedy: !0 }, + keyword: /^msg(?:ctxt|id|id_plural|str)\b/m, + number: /\b\d+\b/, + punctuation: /[\[\]]/, +}), + (Prism.languages.po = Prism.languages.gettext); diff --git a/public/prism/prism-gherkin.min.js b/public/prism/prism-gherkin.min.js index 14fb884..3ec3a18 100644 --- a/public/prism/prism-gherkin.min.js +++ b/public/prism/prism-gherkin.min.js @@ -1,6 +1,6 @@ !(function (a) { var n = '(?:\r?\n|\r)[ \t]*\\|.+\\|(?:(?!\\|).)*'; - Prism.languages.gherkin = { + a.languages.gherkin = { pystring: { pattern: /("""|''')[\s\S]+?\1/, alias: 'string' }, comment: { pattern: /(^[ \t]*)#.*/m, lookbehind: !0 }, tag: { pattern: /(^[ \t]*)@\S*/m, lookbehind: !0 }, @@ -49,4 +49,4 @@ }, outline: { pattern: /<[^>]+>/, alias: 'variable' }, }; -})(); +})(Prism); diff --git a/public/prism/prism-gradle.js b/public/prism/prism-gradle.js new file mode 100644 index 0000000..f22494e --- /dev/null +++ b/public/prism/prism-gradle.js @@ -0,0 +1,64 @@ +(function (Prism) { + var interpolation = { + pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { + pattern: /[\s\S]+/, + inside: null, + }, + }, + }; + + Prism.languages.gradle = Prism.languages.extend('clike', { + string: { + pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, + greedy: true, + }, + keyword: + /\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/, + number: + /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, + operator: { + pattern: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: true, + }, + punctuation: /\.+|[{}[\];(),:$]/, + }); + + Prism.languages.insertBefore('gradle', 'string', { + shebang: { + pattern: /#!.+/, + alias: 'comment', + greedy: true, + }, + 'interpolation-string': { + pattern: + /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: true, + inside: { + interpolation: interpolation, + string: /[\s\S]+/, + }, + }, + }); + + Prism.languages.insertBefore('gradle', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }); + + Prism.languages.insertBefore('gradle', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: true, + alias: 'punctuation', + }, + }); + + interpolation.inside.expression.inside = Prism.languages.gradle; +})(Prism); diff --git a/public/prism/prism-gradle.min.js b/public/prism/prism-gradle.min.js new file mode 100644 index 0000000..8b8b62f --- /dev/null +++ b/public/prism/prism-gradle.min.js @@ -0,0 +1,49 @@ +!(function (e) { + var n = { + pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }; + (e.languages.gradle = e.languages.extend('clike', { + string: { + pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, + greedy: !0, + }, + keyword: + /\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/, + number: + /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, + operator: { + pattern: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: !0, + }, + punctuation: /\.+|[{}[\];(),:$]/, + })), + e.languages.insertBefore('gradle', 'string', { + shebang: { pattern: /#!.+/, alias: 'comment', greedy: !0 }, + 'interpolation-string': { + pattern: + /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: !0, + inside: { interpolation: n, string: /[\s\S]+/ }, + }, + }), + e.languages.insertBefore('gradle', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }), + e.languages.insertBefore('gradle', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: !0, + alias: 'punctuation', + }, + }), + (n.inside.expression.inside = e.languages.gradle); +})(Prism); diff --git a/public/prism/prism-graphql.min.js b/public/prism/prism-graphql.min.js index be11b77..e265e1d 100644 --- a/public/prism/prism-graphql.min.js +++ b/public/prism/prism-graphql.min.js @@ -58,52 +58,52 @@ Prism.hooks.add('after-tokenize', function (n) { if ('graphql' === n.language) for ( - var o = n.tokens.filter(function (n) { + var t = n.tokens.filter(function (n) { return ( 'string' != typeof n && 'comment' !== n.type && 'scalar' !== n.type ); }), - s = 0; - s < o.length; + e = 0; + e < t.length; ) { - var t = o[s++]; - if ('keyword' === t.type && 'mutation' === t.content) { - var e = []; + var a = t[e++]; + if ('keyword' === a.type && 'mutation' === a.content) { + var r = []; if ( c(['definition-mutation', 'punctuation']) && '(' === l(1).content ) { - s += 2; - var a = f(/^\($/, /^\)$/); - if (-1 === a) continue; - for (; s < a; s++) { - var r = l(0); - 'variable' === r.type && - (b(r, 'variable-input'), e.push(r.content)); + e += 2; + var i = f(/^\($/, /^\)$/); + if (-1 === i) continue; + for (; e < i; e++) { + var o = l(0); + 'variable' === o.type && + (b(o, 'variable-input'), r.push(o.content)); } - s = a + 1; + e = i + 1; } if ( c(['punctuation', 'property-query']) && '{' === l(0).content && - (s++, b(l(0), 'property-mutation'), 0 < e.length) + (e++, b(l(0), 'property-mutation'), r.length > 0) ) { - var i = f(/^\{$/, /^\}$/); - if (-1 === i) continue; - for (var u = s; u < i; u++) { - var p = o[u]; + var s = f(/^\{$/, /^\}$/); + if (-1 === s) continue; + for (var u = e; u < s; u++) { + var p = t[u]; 'variable' === p.type && - 0 <= e.indexOf(p.content) && + r.indexOf(p.content) >= 0 && b(p, 'variable-input'); } } } } function l(n) { - return o[s + n]; + return t[e + n]; } function c(n, t) { t = t || 0; @@ -113,13 +113,13 @@ } return !0; } - function f(n, t) { - for (var e = 1, a = s; a < o.length; a++) { - var r = o[a], - i = r.content; - if ('punctuation' === r.type && 'string' == typeof i) - if (n.test(i)) e++; - else if (t.test(i) && 0 === --e) return a; + function f(n, a) { + for (var r = 1, i = e; i < t.length; i++) { + var o = t[i], + s = o.content; + if ('punctuation' === o.type && 'string' == typeof s) + if (n.test(s)) r++; + else if (a.test(s) && 0 == --r) return i; } return -1; } diff --git a/public/prism/prism-groovy.js b/public/prism/prism-groovy.js index c6d1bbc..5da0b34 100644 --- a/public/prism/prism-groovy.js +++ b/public/prism/prism-groovy.js @@ -1,72 +1,67 @@ -Prism.languages.groovy = Prism.languages.extend('clike', { - string: [ - { +(function (Prism) { + var interpolation = { + pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { + pattern: /[\s\S]+/, + inside: null, // see below + }, + }, + }; + + Prism.languages.groovy = Prism.languages.extend('clike', { + string: { // https://groovy-lang.org/syntax.html#_dollar_slashy_string + pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, + greedy: true, + }, + keyword: + /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, + number: + /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, + operator: { pattern: - /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: true, + }, + punctuation: /\.+|[{}[\];(),:$]/, + }); + + Prism.languages.insertBefore('groovy', 'string', { + shebang: { + pattern: /#!.+/, + alias: 'comment', greedy: true, }, - { + 'interpolation-string': { // TODO: Slash strings (e.g. /foo/) can contain line breaks but this will cause a lot of trouble with // simple division (see JS regex), so find a fix maybe? - pattern: /(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/, + pattern: + /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, greedy: true, + inside: { + interpolation: interpolation, + string: /[\s\S]+/, + }, }, - ], - keyword: - /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, - number: - /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, - operator: { - pattern: - /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, - lookbehind: true, - }, - punctuation: /\.+|[{}[\];(),:$]/, -}); - -Prism.languages.insertBefore('groovy', 'string', { - shebang: { - pattern: /#!.+/, - alias: 'comment', - }, -}); - -Prism.languages.insertBefore('groovy', 'punctuation', { - 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, -}); - -Prism.languages.insertBefore('groovy', 'function', { - annotation: { - pattern: /(^|[^.])@\w+/, - lookbehind: true, - alias: 'punctuation', - }, -}); - -// Handle string interpolation -Prism.hooks.add('wrap', function (env) { - if (env.language === 'groovy' && env.type === 'string') { - var delimiter = env.content[0]; + }); - if (delimiter != "'") { - var pattern = /([^\\])(?:\$(?:\{.*?\}|[\w.]+))/; - if (delimiter === '$') { - pattern = /([^\$])(?:\$(?:\{.*?\}|[\w.]+))/; - } + Prism.languages.insertBefore('groovy', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }); - // To prevent double HTML-encoding we have to decode env.content first - env.content = env.content.replace(/</g, '<').replace(/&/g, '&'); - - env.content = Prism.highlight(env.content, { - expression: { - pattern: pattern, - lookbehind: true, - inside: Prism.languages.groovy, - }, - }); + Prism.languages.insertBefore('groovy', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: true, + alias: 'punctuation', + }, + }); - env.classes.push(delimiter === '/' ? 'regex' : 'gstring'); - } - } -}); + interpolation.inside.expression.inside = Prism.languages.groovy; +})(Prism); diff --git a/public/prism/prism-groovy.min.js b/public/prism/prism-groovy.min.js index a32d5d2..54365e2 100644 --- a/public/prism/prism-groovy.min.js +++ b/public/prism/prism-groovy.min.js @@ -1,51 +1,49 @@ -(Prism.languages.groovy = Prism.languages.extend('clike', { - string: [ - { - pattern: - /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, +!(function (e) { + var n = { + pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }; + (e.languages.groovy = e.languages.extend('clike', { + string: { + pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, greedy: !0, }, - { pattern: /(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, - ], - keyword: - /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, - number: - /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, - operator: { - pattern: - /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, - lookbehind: !0, - }, - punctuation: /\.+|[{}[\];(),:$]/, -})), - Prism.languages.insertBefore('groovy', 'string', { - shebang: { pattern: /#!.+/, alias: 'comment' }, - }), - Prism.languages.insertBefore('groovy', 'punctuation', { - 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, - }), - Prism.languages.insertBefore('groovy', 'function', { - annotation: { - pattern: /(^|[^.])@\w+/, + keyword: + /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, + number: + /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, + operator: { + pattern: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, lookbehind: !0, - alias: 'punctuation', }, - }), - Prism.hooks.add('wrap', function (e) { - if ('groovy' === e.language && 'string' === e.type) { - var t = e.content[0]; - if ("'" != t) { - var n = /([^\\])(?:\$(?:\{.*?\}|[\w.]+))/; - '$' === t && (n = /([^\$])(?:\$(?:\{.*?\}|[\w.]+))/), - (e.content = e.content.replace(/</g, '<').replace(/&/g, '&')), - (e.content = Prism.highlight(e.content, { - expression: { - pattern: n, - lookbehind: !0, - inside: Prism.languages.groovy, - }, - })), - e.classes.push('/' === t ? 'regex' : 'gstring'); - } - } - }); + punctuation: /\.+|[{}[\];(),:$]/, + })), + e.languages.insertBefore('groovy', 'string', { + shebang: { pattern: /#!.+/, alias: 'comment', greedy: !0 }, + 'interpolation-string': { + pattern: + /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: !0, + inside: { interpolation: n, string: /[\s\S]+/ }, + }, + }), + e.languages.insertBefore('groovy', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }), + e.languages.insertBefore('groovy', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: !0, + alias: 'punctuation', + }, + }), + (n.inside.expression.inside = e.languages.groovy); +})(Prism); diff --git a/public/prism/prism-handlebars.js b/public/prism/prism-handlebars.js index e7591fb..c1cbdda 100644 --- a/public/prism/prism-handlebars.js +++ b/public/prism/prism-handlebars.js @@ -41,4 +41,5 @@ }); Prism.languages.hbs = Prism.languages.handlebars; + Prism.languages.mustache = Prism.languages.handlebars; })(Prism); diff --git a/public/prism/prism-handlebars.min.js b/public/prism/prism-handlebars.min.js index 8be0206..796e1a1 100644 --- a/public/prism/prism-handlebars.min.js +++ b/public/prism/prism-handlebars.min.js @@ -1,5 +1,5 @@ -!(function (e) { - (e.languages.handlebars = { +!(function (a) { + (a.languages.handlebars = { comment: /\{\{![\s\S]*?\}\}/, delimiter: { pattern: /^\{\{\{?|\}\}\}?$/, alias: 'punctuation' }, string: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, @@ -17,15 +17,16 @@ punctuation: /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/, variable: /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/, }), - e.hooks.add('before-tokenize', function (a) { - e.languages['markup-templating'].buildPlaceholders( - a, + a.hooks.add('before-tokenize', function (e) { + a.languages['markup-templating'].buildPlaceholders( + e, 'handlebars', /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g ); }), - e.hooks.add('after-tokenize', function (a) { - e.languages['markup-templating'].tokenizePlaceholders(a, 'handlebars'); + a.hooks.add('after-tokenize', function (e) { + a.languages['markup-templating'].tokenizePlaceholders(e, 'handlebars'); }), - (e.languages.hbs = e.languages.handlebars); + (a.languages.hbs = a.languages.handlebars), + (a.languages.mustache = a.languages.handlebars); })(Prism); diff --git a/public/prism/prism-hoon.js b/public/prism/prism-hoon.js index 70601b7..60ae2fe 100644 --- a/public/prism/prism-hoon.js +++ b/public/prism/prism-hoon.js @@ -4,7 +4,7 @@ Prism.languages.hoon = { greedy: true, }, string: { - pattern: /"[^"]*"|'[^']*'/, + pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/, greedy: true, }, constant: /%(?:\.[ny]|[\w-]+)/, diff --git a/public/prism/prism-hoon.min.js b/public/prism/prism-hoon.min.js index 7da8ca3..ee6464e 100644 --- a/public/prism/prism-hoon.min.js +++ b/public/prism/prism-hoon.min.js @@ -1,6 +1,6 @@ Prism.languages.hoon = { comment: { pattern: /::.*/, greedy: !0 }, - string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, + string: { pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/, greedy: !0 }, constant: /%(?:\.[ny]|[\w-]+)/, 'class-name': /@(?:[a-z0-9-]*[a-z0-9])?|\*/i, function: /(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/, diff --git a/public/prism/prism-http.min.js b/public/prism/prism-http.min.js index 12c5e3a..ffec655 100644 --- a/public/prism/prism-http.min.js +++ b/public/prism/prism-http.min.js @@ -67,36 +67,34 @@ }, }; var e, - n, - s, - i = t.languages, - p = { - 'application/javascript': i.javascript, - 'application/json': i.json || i.javascript, - 'application/xml': i.xml, - 'text/xml': i.xml, - 'text/html': i.html, - 'text/css': i.css, - 'text/plain': i.plain, + n = t.languages, + s = { + 'application/javascript': n.javascript, + 'application/json': n.json || n.javascript, + 'application/xml': n.xml, + 'text/xml': n.xml, + 'text/html': n.html, + 'text/css': n.css, + 'text/plain': n.plain, }, - r = { 'application/json': !0, 'application/xml': !0 }; - for (var l in p) - if (p[l]) { + i = { 'application/json': !0, 'application/xml': !0 }; + function r(t) { + var a = t.replace(/^[a-z]+\//, ''); + return '(?:' + t + '|\\w+/(?:[\\w.-]+\\+)+' + a + '(?![+\\w.-]))'; + } + for (var p in s) + if (s[p]) { e = e || {}; - var o = r[l] - ? (void 0, - (s = (n = l).replace(/^[a-z]+\//, '')), - '(?:' + n + '|\\w+/(?:[\\w.-]+\\+)+' + s + '(?![+\\w.-]))') - : l; - e[l.replace(/\//g, '-')] = { + var l = i[p] ? r(p) : p; + e[p.replace(/\//g, '-')] = { pattern: RegExp( '(content-type:\\s*' + - o + + l + '(?:(?:\r\n?|\n)[\\w-].*)*(?:\r(?:\n|(?!\n))|\n))[^ \t\\w-][^]*', 'i' ), lookbehind: !0, - inside: p[l], + inside: s[p], }; } e && t.languages.insertBefore('http', 'header', e); diff --git a/public/prism/prism-icu-message-format.min.js b/public/prism/prism-icu-message-format.min.js index f6aa19c..2e6152d 100644 --- a/public/prism/prism-icu-message-format.min.js +++ b/public/prism/prism-icu-message-format.min.js @@ -1,19 +1,19 @@ !(function (e) { - function s(e, t) { - return t <= 0 + function t(e, s) { + return s <= 0 ? '[]' : e.replace(//g, function () { - return s(e, t - 1); + return t(e, s - 1); }); } - var t = /'[{}:=,](?:[^']|'')*'(?!')/, + var s = /'[{}:=,](?:[^']|'')*'(?!')/, n = { pattern: /''/, greedy: !0, alias: 'operator' }, - r = { pattern: t, greedy: !0, inside: { escape: n } }, - a = s( + r = { pattern: s, greedy: !0, inside: { escape: n } }, + a = t( "\\{(?:[^{}']|'(?![{},'])|''||)*\\}".replace( //g, function () { - return t.source; + return s.source; } ), 8 @@ -90,7 +90,7 @@ 'arg-style-text': { pattern: RegExp( '(^\\s*,\\s*(?=\\S))' + - s("(?:[^{}']|'[^']*'|\\{(?:)?\\})+", 8) + + t("(?:[^{}']|'[^']*'|\\{(?:)?\\})+", 8) + '$' ), lookbehind: !0, diff --git a/public/prism/prism-ini.js b/public/prism/prism-ini.js index 96254f8..26e0b6b 100644 --- a/public/prism/prism-ini.js +++ b/public/prism/prism-ini.js @@ -9,7 +9,7 @@ Prism.languages.ini = { pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m, lookbehind: true, }, - header: { + section: { pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m, lookbehind: true, inside: { diff --git a/public/prism/prism-ini.min.js b/public/prism/prism-ini.min.js index ad79628..c907547 100644 --- a/public/prism/prism-ini.min.js +++ b/public/prism/prism-ini.min.js @@ -1,6 +1,6 @@ Prism.languages.ini = { comment: { pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m, lookbehind: !0 }, - header: { + section: { pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m, lookbehind: !0, inside: { diff --git a/public/prism/prism-java.js b/public/prism/prism-java.js index 083f63a..94a0ba9 100644 --- a/public/prism/prism-java.js +++ b/public/prism/prism-java.js @@ -1,14 +1,17 @@ (function (Prism) { var keywords = - /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; // full package (optional) + parent classes (optional) - var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/ - .source; + var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source; // based on the java naming conventions var className = { - pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), + pattern: RegExp( + /(^|[^\w.])/.source + + classNamePrefix + + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source + ), lookbehind: true, inside: { namespace: { @@ -30,10 +33,25 @@ 'class-name': [ className, { - // variables and parameters + // variables, parameters, and constructor references // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) pattern: RegExp( - classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source + /(^|[^\w.])/.source + + classNamePrefix + + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/ + .source + ), + lookbehind: true, + inside: className.inside, + }, + { + // class names based on keyword + // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) + pattern: RegExp( + /(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/ + .source + + classNamePrefix + + /[A-Z]\w*\b/.source ), lookbehind: true, inside: className.inside, @@ -54,6 +72,7 @@ /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: true, }, + constant: /\b[A-Z][A-Z_\d]+\b/, }); Prism.languages.insertBefore('java', 'string', { @@ -85,6 +104,38 @@ operator: /[?&|]/, }, }, + import: [ + { + pattern: RegExp( + /(\bimport\s+)/.source + + classNamePrefix + + /(?:[A-Z]\w*|\*)(?=\s*;)/.source + ), + lookbehind: true, + inside: { + namespace: className.inside.namespace, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + { + pattern: RegExp( + /(\bimport\s+static\s+)/.source + + classNamePrefix + + /(?:\w+|\*)(?=\s*;)/.source + ), + lookbehind: true, + alias: 'static', + inside: { + namespace: className.inside.namespace, + static: /\b\w+$/, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + ], namespace: { pattern: RegExp( /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace( diff --git a/public/prism/prism-java.min.js b/public/prism/prism-java.min.js index 98c645c..bd7c64f 100644 --- a/public/prism/prism-java.min.js +++ b/public/prism/prism-java.min.js @@ -1,9 +1,9 @@ !(function (e) { - var t = - /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, - n = '(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', - a = { - pattern: RegExp(n + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), + var n = + /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, + t = '(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', + s = { + pattern: RegExp('(^|[^\\w.])' + t + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), lookbehind: !0, inside: { namespace: { @@ -20,14 +20,27 @@ greedy: !0, }, 'class-name': [ - a, + s, { - pattern: RegExp(n + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])'), + pattern: RegExp( + '(^|[^\\w.])' + + t + + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)' + ), lookbehind: !0, - inside: a.inside, + inside: s.inside, + }, + { + pattern: RegExp( + '(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)' + + t + + '[A-Z]\\w*\\b' + ), + lookbehind: !0, + inside: s.inside, }, ], - keyword: t, + keyword: n, function: [ e.languages.clike.function, { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }, @@ -39,6 +52,7 @@ /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: !0, }, + constant: /\b[A-Z][A-Z_\d]+\b/, })), e.languages.insertBefore('java', 'string', { 'triple-quoted-string': { @@ -58,18 +72,44 @@ pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { - 'class-name': a, - keyword: t, + 'class-name': s, + keyword: n, punctuation: /[<>(),.:]/, operator: /[?&|]/, }, }, + import: [ + { + pattern: RegExp('(\\bimport\\s+)' + t + '(?:[A-Z]\\w*|\\*)(?=\\s*;)'), + lookbehind: !0, + inside: { + namespace: s.inside.namespace, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + { + pattern: RegExp( + '(\\bimport\\s+static\\s+)' + t + '(?:\\w+|\\*)(?=\\s*;)' + ), + lookbehind: !0, + alias: 'static', + inside: { + namespace: s.inside.namespace, + static: /\b\w+$/, + punctuation: /\./, + operator: /\*/, + 'class-name': /\w+/, + }, + }, + ], namespace: { pattern: RegExp( '(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?'.replace( //g, function () { - return t.source; + return n.source; } ) ), diff --git a/public/prism/prism-javadoclike.min.js b/public/prism/prism-javadoclike.min.js index 782f3f1..0477366 100644 --- a/public/prism/prism-javadoclike.min.js +++ b/public/prism/prism-javadoclike.min.js @@ -1,5 +1,5 @@ -!(function (p) { - var a = (p.languages.javadoclike = { +!(function (a) { + var e = (a.languages.javadoclike = { parameter: { pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, lookbehind: !0, @@ -10,38 +10,36 @@ }, punctuation: /[{}]/, }); - Object.defineProperty(a, 'addSupport', { - value: function (a, e) { - 'string' == typeof a && (a = [a]), - a.forEach(function (a) { - !(function (a, e) { - var n = 'doc-comment', - t = p.languages[a]; - if (t) { - var r = t[n]; - if (!r) { - var o = { - 'doc-comment': { - pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, - lookbehind: !0, - alias: 'comment', - }, - }; - r = (t = p.languages.insertBefore(a, 'comment', o))[n]; - } + Object.defineProperty(e, 'addSupport', { + value: function (e, n) { + 'string' == typeof e && (e = [e]), + e.forEach(function (e) { + !(function (e, n) { + var t = 'doc-comment', + r = a.languages[e]; + if (r) { + var o = r[t]; if ( - (r instanceof RegExp && (r = t[n] = { pattern: r }), - Array.isArray(r)) + (o || + (o = (r = a.languages.insertBefore(e, 'comment', { + 'doc-comment': { + pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + alias: 'comment', + }, + }))[t]), + o instanceof RegExp && (o = r[t] = { pattern: o }), + Array.isArray(o)) ) - for (var i = 0, s = r.length; i < s; i++) - r[i] instanceof RegExp && (r[i] = { pattern: r[i] }), e(r[i]); - else e(r); + for (var i = 0, s = o.length; i < s; i++) + o[i] instanceof RegExp && (o[i] = { pattern: o[i] }), n(o[i]); + else n(o); } - })(a, function (a) { - a.inside || (a.inside = {}), (a.inside.rest = e); + })(e, function (a) { + a.inside || (a.inside = {}), (a.inside.rest = n); }); }); }, }), - a.addSupport(['java', 'javascript', 'php'], a); + e.addSupport(['java', 'javascript', 'php'], e); })(Prism); diff --git a/public/prism/prism-javascript.js b/public/prism/prism-javascript.js index 9d679c2..be663f4 100644 --- a/public/prism/prism-javascript.js +++ b/public/prism/prism-javascript.js @@ -57,9 +57,26 @@ Prism.languages.javascript['class-name'][0].pattern = Prism.languages.insertBefore('javascript', 'keyword', { regex: { - // eslint-disable-next-line regexp/no-dupe-characters-character-class - pattern: - /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + pattern: RegExp( + // lookbehind + // eslint-disable-next-line regexp/no-dupe-characters-character-class + /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + + // Regex pattern: + // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character + // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible + // with the only syntax, so we have to define 2 different regex patterns. + /\//.source + + '(?:' + + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/ + .source + + '|' + + // `v` flag syntax. This supports 3 levels of nested character classes. + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/ + .source + + ')' + + // lookahead + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source + ), lookbehind: true, greedy: true, inside: { diff --git a/public/prism/prism-javascript.min.js b/public/prism/prism-javascript.min.js index 330bb66..d00cd80 100644 --- a/public/prism/prism-javascript.min.js +++ b/public/prism/prism-javascript.min.js @@ -30,8 +30,9 @@ /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/), Prism.languages.insertBefore('javascript', 'keyword', { regex: { - pattern: - /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + pattern: RegExp( + '((?:^|[^$\\w\\xA0-\\uFFFF."\'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))' + ), lookbehind: !0, greedy: !0, inside: { diff --git a/public/prism/prism-js-extras.min.js b/public/prism/prism-js-extras.min.js index 26d73f2..00f94f2 100644 --- a/public/prism/prism-js-extras.min.js +++ b/public/prism/prism-js-extras.min.js @@ -93,6 +93,6 @@ 'RegExp' === a.util.type(s) && (s = a.languages.javascript[n] = { pattern: s }); var o = s.inside || {}; - (s.inside = o)['maybe-class-name'] = /^[A-Z][\s\S]*/; + (s.inside = o), (o['maybe-class-name'] = /^[A-Z][\s\S]*/); } })(Prism); diff --git a/public/prism/prism-js-templates.min.js b/public/prism/prism-js-templates.min.js index c3171c1..0a4a47f 100644 --- a/public/prism/prism-js-templates.min.js +++ b/public/prism/prism-js-templates.min.js @@ -1,146 +1,141 @@ -!(function (u) { - var e = u.languages.javascript['template-string'], - n = e.pattern.source, - a = e.inside.interpolation, - i = a.inside['interpolation-punctuation'], - r = a.pattern.source; - function t(e, t) { - if (u.languages[e]) +!(function (e) { + var t = e.languages.javascript['template-string'], + n = t.pattern.source, + r = t.inside.interpolation, + a = r.inside['interpolation-punctuation'], + i = r.pattern.source; + function o(t, r) { + if (e.languages[t]) return { - pattern: RegExp('((?:' + t + ')\\s*)' + n), + pattern: RegExp('((?:' + r + ')\\s*)' + n), lookbehind: !0, greedy: !0, inside: { 'template-punctuation': { pattern: /^`|`$/, alias: 'string' }, - 'embedded-code': { pattern: /[\s\S]+/, alias: e }, + 'embedded-code': { pattern: /[\s\S]+/, alias: t }, }, }; } - function s(e, t, n) { - var r = { code: e, grammar: t, language: n }; + function s(e, t) { + return '___' + t.toUpperCase() + '_' + e + '___'; + } + function p(t, n, r) { + var a = { code: t, grammar: n, language: r }; return ( - u.hooks.run('before-tokenize', r), - (r.tokens = u.tokenize(r.code, r.grammar)), - u.hooks.run('after-tokenize', r), - r.tokens + e.hooks.run('before-tokenize', a), + (a.tokens = e.tokenize(a.code, a.grammar)), + e.hooks.run('after-tokenize', a), + a.tokens ); } - function d(e) { - var t = {}; - t['interpolation-punctuation'] = i; - var n = u.tokenize(e, t); - if (3 === n.length) { - var r = [1, 1]; - r.push.apply(r, s(n[1], u.languages.javascript, 'javascript')), - n.splice.apply(n, r); + function l(t) { + var n = {}; + n['interpolation-punctuation'] = a; + var i = e.tokenize(t, n); + if (3 === i.length) { + var o = [1, 1]; + o.push.apply(o, p(i[1], e.languages.javascript, 'javascript')), + i.splice.apply(i, o); } - return new u.Token('interpolation', n, a.alias, e); + return new e.Token('interpolation', i, r.alias, t); } - function c(a, e, i) { - var t = u.tokenize(a, { - interpolation: { pattern: RegExp(r), lookbehind: !0 }, + function g(t, n, r) { + var a = e.tokenize(t, { + interpolation: { pattern: RegExp(i), lookbehind: !0 }, }), - f = 0, - y = {}, - n = s( - t + o = 0, + g = {}, + u = p( + a .map(function (e) { if ('string' == typeof e) return e; - for ( - var t, n = e.content; - -1 !== - a.indexOf( - ((r = f++), (t = '___' + i.toUpperCase() + '_' + r + '___')) - ); - - ); - return (y[t] = n), t; - var r; + for (var n, a = e.content; -1 !== t.indexOf((n = s(o++, r))); ); + return (g[n] = a), n; }) .join(''), - e, - i + n, + r ), - v = Object.keys(y); + c = Object.keys(g); return ( - (f = 0), + (o = 0), (function e(t) { for (var n = 0; n < t.length; n++) { - if (f >= v.length) return; + if (o >= c.length) return; var r = t[n]; if ('string' == typeof r || 'string' == typeof r.content) { - var a = v[f], + var a = c[o], i = 'string' == typeof r ? r : r.content, s = i.indexOf(a); if (-1 !== s) { - ++f; - var o = i.substring(0, s), - p = d(y[a]), - l = i.substring(s + a.length), - g = []; - if ((o && g.push(o), g.push(p), l)) { - var u = [l]; - e(u), g.push.apply(g, u); + ++o; + var p = i.substring(0, s), + u = l(g[a]), + f = i.substring(s + a.length), + y = []; + if ((p && y.push(p), y.push(u), f)) { + var v = [f]; + e(v), y.push.apply(y, v); } 'string' == typeof r - ? (t.splice.apply(t, [n, 1].concat(g)), (n += g.length - 1)) - : (r.content = g); + ? (t.splice.apply(t, [n, 1].concat(y)), (n += y.length - 1)) + : (r.content = y); } } else { - var c = r.content; - Array.isArray(c) ? e(c) : e([c]); + var d = r.content; + Array.isArray(d) ? e(d) : e([d]); } } - })(n), - new u.Token(i, n, 'language-' + i, a) + })(u), + new e.Token(r, u, 'language-' + r, t) ); } - u.languages.javascript['template-string'] = [ - t( + e.languages.javascript['template-string'] = [ + o( 'css', '\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)' ), - t('html', '\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?='), - t('svg', '\\bsvg'), - t('markdown', '\\b(?:markdown|md)'), - t('graphql', '\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)'), - t('sql', '\\bsql'), - e, + o('html', '\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?='), + o('svg', '\\bsvg'), + o('markdown', '\\b(?:markdown|md)'), + o('graphql', '\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)'), + o('sql', '\\bsql'), + t, ].filter(Boolean); - var o = { javascript: !0, js: !0, typescript: !0, ts: !0, jsx: !0, tsx: !0 }; - function f(e) { + var u = { javascript: !0, js: !0, typescript: !0, ts: !0, jsx: !0, tsx: !0 }; + function c(e) { return 'string' == typeof e ? e : Array.isArray(e) - ? e.map(f).join('') - : f(e.content); + ? e.map(c).join('') + : c(e.content); } - u.hooks.add('after-tokenize', function (e) { - e.language in o && - !(function e(t) { - for (var n = 0, r = t.length; n < r; n++) { - var a = t[n]; - if ('string' != typeof a) { - var i = a.content; - if (Array.isArray(i)) - if ('template-string' === a.type) { - var s = i[1]; + e.hooks.add('after-tokenize', function (t) { + t.language in u && + (function t(n) { + for (var r = 0, a = n.length; r < a; r++) { + var i = n[r]; + if ('string' != typeof i) { + var o = i.content; + if (Array.isArray(o)) + if ('template-string' === i.type) { + var s = o[1]; if ( - 3 === i.length && + 3 === o.length && 'string' != typeof s && 'embedded-code' === s.type ) { - var o = f(s), - p = s.alias, - l = Array.isArray(p) ? p[0] : p, - g = u.languages[l]; - if (!g) continue; - i[1] = c(o, g, l); + var p = c(s), + l = s.alias, + u = Array.isArray(l) ? l[0] : l, + f = e.languages[u]; + if (!f) continue; + o[1] = g(p, f, u); } - } else e(i); - else 'string' != typeof i && e([i]); + } else t(o); + else 'string' != typeof o && t([o]); } } - })(e.tokens); + })(t.tokens); }); })(Prism); diff --git a/public/prism/prism-jsx.min.js b/public/prism/prism-jsx.min.js index 121a56f..8e359ee 100644 --- a/public/prism/prism-jsx.min.js +++ b/public/prism/prism-jsx.min.js @@ -1,7 +1,7 @@ -!(function (o) { - var t = o.util.clone(o.languages.javascript), +!(function (t) { + var n = t.util.clone(t.languages.javascript), e = '(?:\\{*\\.{3}(?:[^{}]|)*\\})'; - function n(t, n) { + function a(t, n) { return ( (t = t .replace(//g, function () { @@ -16,88 +16,88 @@ RegExp(t, n) ); } - (e = n(e).source), - (o.languages.jsx = o.languages.extend('markup', t)), - (o.languages.jsx.tag.pattern = n( + (e = a(e).source), + (t.languages.jsx = t.languages.extend('markup', n)), + (t.languages.jsx.tag.pattern = a( '+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[^]|[^\\\\"])*"|\'(?:\\\\[^]|[^\\\\\'])*\'|[^\\s{\'"/>=]+|))?|))**/?)?>' )), - (o.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/), - (o.languages.jsx.tag.inside['attr-value'].pattern = + (t.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/), + (t.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/), - (o.languages.jsx.tag.inside.tag.inside['class-name'] = + (t.languages.jsx.tag.inside.tag.inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/), - (o.languages.jsx.tag.inside.comment = t.comment), - o.languages.insertBefore( + (t.languages.jsx.tag.inside.comment = n.comment), + t.languages.insertBefore( 'inside', 'attr-name', - { spread: { pattern: n(''), inside: o.languages.jsx } }, - o.languages.jsx.tag + { spread: { pattern: a(''), inside: t.languages.jsx } }, + t.languages.jsx.tag ), - o.languages.insertBefore( + t.languages.insertBefore( 'inside', 'special-attr', { script: { - pattern: n('='), + pattern: a('='), alias: 'language-javascript', inside: { 'script-punctuation': { pattern: /^=(?=\{)/, alias: 'punctuation' }, - rest: o.languages.jsx, + rest: t.languages.jsx, }, }, }, - o.languages.jsx.tag + t.languages.jsx.tag ); - var i = function (t) { + var s = function (t) { return t ? 'string' == typeof t ? t : 'string' == typeof t.content ? t.content - : t.content.map(i).join('') + : t.content.map(s).join('') : ''; }, - r = function (t) { - for (var n = [], e = 0; e < t.length; e++) { - var a = t[e], - s = !1; + g = function (n) { + for (var e = [], a = 0; a < n.length; a++) { + var o = n[a], + i = !1; if ( - ('string' != typeof a && - ('tag' === a.type && a.content[0] && 'tag' === a.content[0].type - ? '' === a.content[a.content.length - 1].content || - n.push({ - tagName: i(a.content[0].content[1]), + ('string' != typeof o && + ('tag' === o.type && o.content[0] && 'tag' === o.content[0].type + ? ' 0 && + e[e.length - 1].tagName === s(o.content[0].content[1]) && + e.pop() + : '/>' === o.content[o.content.length - 1].content || + e.push({ + tagName: s(o.content[0].content[1]), openedBraces: 0, }) - : 0 < n.length && 'punctuation' === a.type && '{' === a.content - ? n[n.length - 1].openedBraces++ - : 0 < n.length && - 0 < n[n.length - 1].openedBraces && - 'punctuation' === a.type && - '}' === a.content - ? n[n.length - 1].openedBraces-- - : (s = !0)), - (s || 'string' == typeof a) && - 0 < n.length && - 0 === n[n.length - 1].openedBraces) + : e.length > 0 && 'punctuation' === o.type && '{' === o.content + ? e[e.length - 1].openedBraces++ + : e.length > 0 && + e[e.length - 1].openedBraces > 0 && + 'punctuation' === o.type && + '}' === o.content + ? e[e.length - 1].openedBraces-- + : (i = !0)), + (i || 'string' == typeof o) && + e.length > 0 && + 0 === e[e.length - 1].openedBraces) ) { - var g = i(a); - e < t.length - 1 && - ('string' == typeof t[e + 1] || 'plain-text' === t[e + 1].type) && - ((g += i(t[e + 1])), t.splice(e + 1, 1)), - 0 < e && - ('string' == typeof t[e - 1] || 'plain-text' === t[e - 1].type) && - ((g = i(t[e - 1]) + g), t.splice(e - 1, 1), e--), - (t[e] = new o.Token('plain-text', g, null, g)); + var r = s(o); + a < n.length - 1 && + ('string' == typeof n[a + 1] || 'plain-text' === n[a + 1].type) && + ((r += s(n[a + 1])), n.splice(a + 1, 1)), + a > 0 && + ('string' == typeof n[a - 1] || 'plain-text' === n[a - 1].type) && + ((r = s(n[a - 1]) + r), n.splice(a - 1, 1), a--), + (n[a] = new t.Token('plain-text', r, null, r)); } - a.content && 'string' != typeof a.content && r(a.content); + o.content && 'string' != typeof o.content && g(o.content); } }; - o.hooks.add('after-tokenize', function (t) { - ('jsx' !== t.language && 'tsx' !== t.language) || r(t.tokens); + t.hooks.add('after-tokenize', function (t) { + ('jsx' !== t.language && 'tsx' !== t.language) || g(t.tokens); }); })(Prism); diff --git a/public/prism/prism-keyman.js b/public/prism/prism-keyman.js index cc58923..2328aad 100644 --- a/public/prism/prism-keyman.js +++ b/public/prism/prism-keyman.js @@ -31,7 +31,8 @@ Prism.languages.keyman = { alias: 'keyword', }, 'structural-keyword': { - pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + pattern: + /\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i, alias: 'keyword', }, diff --git a/public/prism/prism-keyman.min.js b/public/prism/prism-keyman.min.js index 6023bbf..186cbeb 100644 --- a/public/prism/prism-keyman.min.js +++ b/public/prism/prism-keyman.min.js @@ -19,7 +19,8 @@ Prism.languages.keyman = { alias: 'keyword', }, 'structural-keyword': { - pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + pattern: + /\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i, alias: 'keyword', }, 'compile-target': { diff --git a/public/prism/prism-latte.min.js b/public/prism/prism-latte.min.js index 2d5a735..2f2f6a7 100644 --- a/public/prism/prism-latte.min.js +++ b/public/prism/prism-latte.min.js @@ -1,5 +1,5 @@ -!(function (t) { - t.languages.latte = { +!(function (a) { + a.languages.latte = { comment: /^\{\*[\s\S]*/, 'latte-tag': { pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i, @@ -10,11 +10,11 @@ php: { pattern: /\S(?:[\s\S]*\S)?/, alias: 'language-php', - inside: t.languages.php, + inside: a.languages.php, }, }; - var e = t.languages.extend('markup', {}); - t.languages.insertBefore( + var t = a.languages.extend('markup', {}); + a.languages.insertBefore( 'inside', 'attr-value', { @@ -29,25 +29,24 @@ /^=/, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }, ], - php: { pattern: /\S(?:[\s\S]*\S)?/, inside: t.languages.php }, + php: { pattern: /\S(?:[\s\S]*\S)?/, inside: a.languages.php }, }, }, }, }, }, - e.tag + t.tag ), - t.hooks.add('before-tokenize', function (a) { - if ('latte' === a.language) { - t.languages['markup-templating'].buildPlaceholders( - a, + a.hooks.add('before-tokenize', function (e) { + 'latte' === e.language && + (a.languages['markup-templating'].buildPlaceholders( + e, 'latte', /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g ), - (a.grammar = e); - } + (e.grammar = t)); }), - t.hooks.add('after-tokenize', function (a) { - t.languages['markup-templating'].tokenizePlaceholders(a, 'latte'); + a.hooks.add('after-tokenize', function (t) { + a.languages['markup-templating'].tokenizePlaceholders(t, 'latte'); }); })(Prism); diff --git a/public/prism/prism-linker-script.js b/public/prism/prism-linker-script.js new file mode 100644 index 0000000..3231d53 --- /dev/null +++ b/public/prism/prism-linker-script.js @@ -0,0 +1,30 @@ +Prism.languages['linker-script'] = { + comment: { + pattern: /(^|\s)\/\*[\s\S]*?(?:$|\*\/)/, + lookbehind: true, + greedy: true, + }, + identifier: { + pattern: /"[^"\r\n]*"/, + greedy: true, + }, + + 'location-counter': { + pattern: /\B\.\B/, + alias: 'important', + }, + + section: { + pattern: /(^|[^\w*])\.\w+\b/, + lookbehind: true, + alias: 'keyword', + }, + function: /\b[A-Z][A-Z_]*(?=\s*\()/, + + number: /\b(?:0[xX][a-fA-F0-9]+|\d+)[KM]?\b/, + + operator: />>=?|<<=?|->|\+\+|--|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?/, + punctuation: /[(){},;]/, +}; + +Prism.languages['ld'] = Prism.languages['linker-script']; diff --git a/public/prism/prism-linker-script.min.js b/public/prism/prism-linker-script.min.js new file mode 100644 index 0000000..bc5d071 --- /dev/null +++ b/public/prism/prism-linker-script.min.js @@ -0,0 +1,15 @@ +(Prism.languages['linker-script'] = { + comment: { + pattern: /(^|\s)\/\*[\s\S]*?(?:$|\*\/)/, + lookbehind: !0, + greedy: !0, + }, + identifier: { pattern: /"[^"\r\n]*"/, greedy: !0 }, + 'location-counter': { pattern: /\B\.\B/, alias: 'important' }, + section: { pattern: /(^|[^\w*])\.\w+\b/, lookbehind: !0, alias: 'keyword' }, + function: /\b[A-Z][A-Z_]*(?=\s*\()/, + number: /\b(?:0[xX][a-fA-F0-9]+|\d+)[KM]?\b/, + operator: />>=?|<<=?|->|\+\+|--|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?/, + punctuation: /[(){},;]/, +}), + (Prism.languages.ld = Prism.languages['linker-script']); diff --git a/public/prism/prism-liquid.min.js b/public/prism/prism-liquid.min.js index d4089c2..b6c39ba 100644 --- a/public/prism/prism-liquid.min.js +++ b/public/prism/prism-liquid.min.js @@ -24,19 +24,19 @@ empty: { pattern: /\bempty\b/, alias: 'keyword' }, }), Prism.hooks.add('before-tokenize', function (e) { - var i = !1; + var t = !1; Prism.languages['markup-templating'].buildPlaceholders( e, 'liquid', /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g, function (e) { - var t = /^\{%-?\s*(\w+)/.exec(e); - if (t) { - var n = t[1]; - if ('raw' === n && !i) return (i = !0); - if ('endraw' === n) return !(i = !1); + var n = /^\{%-?\s*(\w+)/.exec(e); + if (n) { + var i = n[1]; + if ('raw' === i && !t) return (t = !0), !0; + if ('endraw' === i) return (t = !1), !0; } - return !i; + return !t; } ); }), diff --git a/public/prism/prism-lisp.min.js b/public/prism/prism-lisp.min.js index d9b5041..c641587 100644 --- a/public/prism/prism-lisp.min.js +++ b/public/prism/prism-lisp.min.js @@ -7,10 +7,9 @@ } var t = '(?!\\d)[-+*/~!@$%^=<>{}\\w]+', r = '(\\()', - i = '(?=\\s)', - s = + i = '(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*', - l = { + s = { heading: { pattern: /;;;.*/, alias: ['comment', 'title'] }, comment: /;.*/, string: { @@ -30,15 +29,13 @@ keyword: [ { pattern: RegExp( - r + - '(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)' + - i + '(\\()(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)(?=\\s)' ), lookbehind: !0, }, { pattern: RegExp( - r + '(?:append|by|collect|concat|do|finally|for|in|return)' + i + '(\\()(?:append|by|collect|concat|do|finally|for|in|return)(?=\\s)' ), lookbehind: !0, }, @@ -52,13 +49,13 @@ boolean: { pattern: a('nil|t'), lookbehind: !0 }, number: { pattern: a('[-+]?\\d+(?:\\.\\d*)?'), lookbehind: !0 }, defvar: { - pattern: RegExp(r + 'def(?:const|custom|group|var)\\s+' + t), + pattern: RegExp('(\\()def(?:const|custom|group|var)\\s+' + t), lookbehind: !0, inside: { keyword: /^def[a-z]+/, variable: RegExp(t) }, }, defun: { pattern: RegExp( - r + '(?:cl-)?(?:defmacro|defun\\*?)\\s+' + t + '\\s+\\(' + s + '\\)' + '(\\()(?:cl-)?(?:defmacro|defun\\*?)\\s+' + t + '\\s+\\(' + i + '\\)' ), lookbehind: !0, greedy: !0, @@ -71,7 +68,7 @@ }, lambda: { pattern: RegExp( - r + 'lambda\\s+\\(\\s*(?:&?' + t + '(?:\\s+&?' + t + ')*\\s*)?\\)' + '(\\()lambda\\s+\\(\\s*(?:&?' + t + '(?:\\s+&?' + t + ')*\\s*)?\\)' ), lookbehind: !0, greedy: !0, @@ -83,42 +80,42 @@ { pattern: /(\s)\.(?=\s)/, lookbehind: !0 }, ], }, - o = { + l = { 'lisp-marker': RegExp('&(?!\\d)[-+*/~!@$%^=<>{}\\w]+'), varform: { - pattern: RegExp('\\(' + t + '\\s+(?=\\S)' + s + '\\)'), - inside: l, + pattern: RegExp('\\(' + t + '\\s+(?=\\S)' + i + '\\)'), + inside: s, }, argument: { pattern: RegExp('(^|[\\s(])' + t), lookbehind: !0, alias: 'variable', }, - rest: l, + rest: s, }, - p = '\\S+(?:\\s+\\S+)*', - d = { - pattern: RegExp(r + s + '(?=\\))'), + o = '\\S+(?:\\s+\\S+)*', + p = { + pattern: RegExp(r + i + '(?=\\))'), lookbehind: !0, inside: { - 'rest-vars': { pattern: RegExp('&(?:body|rest)\\s+' + p), inside: o }, + 'rest-vars': { pattern: RegExp('&(?:body|rest)\\s+' + o), inside: l }, 'other-marker-vars': { - pattern: RegExp('&(?:aux|optional)\\s+' + p), - inside: o, + pattern: RegExp('&(?:aux|optional)\\s+' + o), + inside: l, }, keys: { - pattern: RegExp('&key\\s+' + p + '(?:\\s+&allow-other-keys)?'), - inside: o, + pattern: RegExp('&key\\s+' + o + '(?:\\s+&allow-other-keys)?'), + inside: l, }, argument: { pattern: RegExp(t), alias: 'variable' }, punctuation: /[()]/, }, }; - (l.lambda.inside.arguments = d), - (l.defun.inside.arguments = e.util.clone(d)), - (l.defun.inside.arguments.inside.sublist = d), - (e.languages.lisp = l), - (e.languages.elisp = l), - (e.languages.emacs = l), - (e.languages['emacs-lisp'] = l); + (s.lambda.inside.arguments = p), + (s.defun.inside.arguments = e.util.clone(p)), + (s.defun.inside.arguments.inside.sublist = p), + (e.languages.lisp = s), + (e.languages.elisp = s), + (e.languages.emacs = s), + (e.languages['emacs-lisp'] = s); })(Prism); diff --git a/public/prism/prism-llvm.min.js b/public/prism/prism-llvm.min.js index 3f49697..a0800f9 100644 --- a/public/prism/prism-llvm.min.js +++ b/public/prism/prism-llvm.min.js @@ -1,16 +1,18 @@ -Prism.languages.llvm = { - comment: /;.*/, - string: { pattern: /"[^"]*"/, greedy: !0 }, - boolean: /\b(?:false|true)\b/, - variable: /[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i, - label: /(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i, - type: { - pattern: - /\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/, - alias: 'class-name', - }, - keyword: /\b[a-z_][a-z_0-9]*\b/, - number: - /[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/, - punctuation: /[{}[\];(),.!*=<>]/, -}; +!(function (a) { + a.languages.llvm = { + comment: /;.*/, + string: { pattern: /"[^"]*"/, greedy: !0 }, + boolean: /\b(?:false|true)\b/, + variable: /[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i, + label: /(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i, + type: { + pattern: + /\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/, + alias: 'class-name', + }, + keyword: /\b[a-z_][a-z_0-9]*\b/, + number: + /[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/, + punctuation: /[{}[\];(),.!*=<>]/, + }; +})(Prism); diff --git a/public/prism/prism-markdown.js b/public/prism/prism-markdown.js index 191fc73..c816c39 100644 --- a/public/prism/prism-markdown.js +++ b/public/prism/prism-markdown.js @@ -275,14 +275,14 @@ }); ['url', 'bold', 'italic', 'strike'].forEach(function (token) { - ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function ( - inside - ) { - if (token !== inside) { - Prism.languages.markdown[token].inside.content.inside[inside] = - Prism.languages.markdown[inside]; + ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach( + function (inside) { + if (token !== inside) { + Prism.languages.markdown[token].inside.content.inside[inside] = + Prism.languages.markdown[inside]; + } } - }); + ); }); Prism.hooks.add('after-tokenize', function (env) { diff --git a/public/prism/prism-markdown.min.js b/public/prism/prism-markdown.min.js index ba1b36f..32436d7 100644 --- a/public/prism/prism-markdown.min.js +++ b/public/prism/prism-markdown.min.js @@ -1,5 +1,5 @@ -!(function (s) { - function n(n) { +!(function (n) { + function e(n) { return ( (n = n.replace(//g, function () { return '(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))'; @@ -7,17 +7,17 @@ RegExp('((?:^|[^\\\\])(?:\\\\{2})*)(?:' + n + ')') ); } - var e = '(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+', - t = '\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))'.replace( + var t = '(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+', + a = '\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))'.replace( /__/g, function () { - return e; + return t; } ), - a = + i = '\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)'; - (s.languages.markdown = s.languages.extend('markup', {})), - s.languages.insertBefore('markdown', 'prolog', { + (n.languages.markdown = n.languages.extend('markup', {})), + n.languages.insertBefore('markdown', 'prolog', { 'front-matter-block': { pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, lookbehind: !0, @@ -27,37 +27,37 @@ 'front-matter': { pattern: /\S+(?:\s+\S+)*/, alias: ['yaml', 'language-yaml'], - inside: s.languages.yaml, + inside: n.languages.yaml, }, }, }, blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: 'punctuation' }, table: { - pattern: RegExp('^' + t + a + '(?:' + t + ')*', 'm'), + pattern: RegExp('^' + a + i + '(?:' + a + ')*', 'm'), inside: { 'table-data-rows': { - pattern: RegExp('^(' + t + a + ')(?:' + t + ')*$'), + pattern: RegExp('^(' + a + i + ')(?:' + a + ')*$'), lookbehind: !0, inside: { 'table-data': { - pattern: RegExp(e), - inside: s.languages.markdown, + pattern: RegExp(t), + inside: n.languages.markdown, }, punctuation: /\|/, }, }, 'table-line': { - pattern: RegExp('^(' + t + ')' + a + '$'), + pattern: RegExp('^(' + a + ')' + i + '$'), lookbehind: !0, inside: { punctuation: /\||:?-{3,}:?/ }, }, 'table-header-row': { - pattern: RegExp('^' + t + '$'), + pattern: RegExp('^' + a + '$'), inside: { 'table-header': { - pattern: RegExp(e), + pattern: RegExp(t), alias: 'important', - inside: s.languages.markdown, + inside: n.languages.markdown, }, punctuation: /\|/, }, @@ -119,7 +119,7 @@ alias: 'url', }, bold: { - pattern: n( + pattern: e( '\\b__(?:(?!_)|_(?:(?!_))+_)+__\\b|\\*\\*(?:(?!\\*)|\\*(?:(?!\\*))+\\*)+\\*\\*' ), lookbehind: !0, @@ -134,7 +134,7 @@ }, }, italic: { - pattern: n( + pattern: e( '\\b_(?:(?!_)|__(?:(?!_))+__)+_\\b|\\*(?:(?!\\*)|\\*\\*(?:(?!\\*))+\\*\\*)+\\*' ), lookbehind: !0, @@ -145,7 +145,7 @@ }, }, strike: { - pattern: n('(~~?)(?:(?!~))+\\2'), + pattern: e('(~~?)(?:(?!~))+\\2'), lookbehind: !0, greedy: !0, inside: { @@ -165,7 +165,7 @@ alias: ['code', 'keyword'], }, url: { - pattern: n( + pattern: e( '!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \t]?\\[(?:(?!\\]))+\\])' ), lookbehind: !0, @@ -183,29 +183,29 @@ }, }), ['url', 'bold', 'italic', 'strike'].forEach(function (e) { - ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (n) { - e !== n && - (s.languages.markdown[e].inside.content.inside[n] = - s.languages.markdown[n]); + ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (t) { + e !== t && + (n.languages.markdown[e].inside.content.inside[t] = + n.languages.markdown[t]); }); }), - s.hooks.add('after-tokenize', function (n) { + n.hooks.add('after-tokenize', function (n) { ('markdown' !== n.language && 'md' !== n.language) || - !(function n(e) { + (function n(e) { if (e && 'string' != typeof e) for (var t = 0, a = e.length; t < a; t++) { - var r = e[t]; - if ('code' === r.type) { - var i = r.content[1], - o = r.content[3]; + var i = e[t]; + if ('code' === i.type) { + var r = i.content[1], + o = i.content[3]; if ( - i && + r && o && - 'code-language' === i.type && + 'code-language' === r.type && 'code-block' === o.type && - 'string' == typeof i.content + 'string' == typeof r.content ) { - var l = i.content + var l = r.content .replace(/\b#/g, 'sharp') .replace(/\b\+\+/g, 'pp'), s = @@ -217,62 +217,55 @@ : o.alias.push(s) : (o.alias = [s]); } - } else n(r.content); + } else n(i.content); } })(n.tokens); }), - s.hooks.add('wrap', function (n) { - if ('code-block' === n.type) { - for (var e = '', t = 0, a = n.classes.length; t < a; t++) { - var r = n.classes[t], - i = /language-(.+)/.exec(r); - if (i) { - e = i[1]; + n.hooks.add('wrap', function (e) { + if ('code-block' === e.type) { + for (var t = '', a = 0, i = e.classes.length; a < i; a++) { + var s = e.classes[a], + d = /language-(.+)/.exec(s); + if (d) { + t = d[1]; break; } } - var o = s.languages[e]; - if (o) - n.content = s.highlight( - (function (n) { - var e = n.replace(d, ''); - return (e = e.replace( - /&(\w{1,8}|#x?[\da-f]{1,8});/gi, - function (n, e) { - var t; - if ('#' === (e = e.toLowerCase())[0]) - return ( - (t = - 'x' === e[1] - ? parseInt(e.slice(2), 16) - : Number(e.slice(1))), - u(t) - ); - var a = p[e]; - return a || n; - } - )); - })(n.content), - o, - e + var p = n.languages[t]; + if (p) + e.content = n.highlight( + e.content + .replace(r, '') + .replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (n, e) { + var t; + return '#' === (e = e.toLowerCase())[0] + ? ((t = + 'x' === e[1] + ? parseInt(e.slice(2), 16) + : Number(e.slice(1))), + l(t)) + : o[e] || n; + }), + p, + t ); - else if (e && 'none' !== e && s.plugins.autoloader) { - var l = + else if (t && 'none' !== t && n.plugins.autoloader) { + var u = 'md-' + new Date().valueOf() + '-' + Math.floor(1e16 * Math.random()); - (n.attributes.id = l), - s.plugins.autoloader.loadLanguages(e, function () { - var n = document.getElementById(l); - n && - (n.innerHTML = s.highlight(n.textContent, s.languages[e], e)); + (e.attributes.id = u), + n.plugins.autoloader.loadLanguages(t, function () { + var e = document.getElementById(u); + e && + (e.innerHTML = n.highlight(e.textContent, n.languages[t], t)); }); } } }); - var d = RegExp(s.languages.markup.tag.pattern.source, 'gi'), - p = { amp: '&', lt: '<', gt: '>', quot: '"' }, - u = String.fromCodePoint || String.fromCharCode; - s.languages.md = s.languages.markdown; + var r = RegExp(n.languages.markup.tag.pattern.source, 'gi'), + o = { amp: '&', lt: '<', gt: '>', quot: '"' }, + l = String.fromCodePoint || String.fromCharCode; + n.languages.md = n.languages.markdown; })(Prism); diff --git a/public/prism/prism-markup-templating.min.js b/public/prism/prism-markup-templating.min.js index 43488c9..49a723c 100644 --- a/public/prism/prism-markup-templating.min.js +++ b/public/prism/prism-markup-templating.min.js @@ -1,62 +1,62 @@ -!(function (h) { - function v(e, n) { +!(function (e) { + function n(e, n) { return '___' + e.toUpperCase() + n + '___'; } - Object.defineProperties((h.languages['markup-templating'] = {}), { + Object.defineProperties((e.languages['markup-templating'] = {}), { buildPlaceholders: { - value: function (a, r, e, o) { - if (a.language === r) { - var c = (a.tokenStack = []); - (a.code = a.code.replace(e, function (e) { + value: function (t, a, r, o) { + if (t.language === a) { + var c = (t.tokenStack = []); + (t.code = t.code.replace(r, function (e) { if ('function' == typeof o && !o(e)) return e; - for (var n, t = c.length; -1 !== a.code.indexOf((n = v(r, t))); ) - ++t; - return (c[t] = e), n; + for (var r, i = c.length; -1 !== t.code.indexOf((r = n(a, i))); ) + ++i; + return (c[i] = e), r; })), - (a.grammar = h.languages.markup); + (t.grammar = e.languages.markup); } }, }, tokenizePlaceholders: { - value: function (p, k) { - if (p.language === k && p.tokenStack) { - p.grammar = h.languages[k]; - var m = 0, - d = Object.keys(p.tokenStack); - !(function e(n) { - for (var t = 0; t < n.length && !(m >= d.length); t++) { - var a = n[t]; + value: function (t, a) { + if (t.language === a && t.tokenStack) { + t.grammar = e.languages[a]; + var r = 0, + o = Object.keys(t.tokenStack); + !(function c(i) { + for (var u = 0; u < i.length && !(r >= o.length); u++) { + var g = i[u]; if ( - 'string' == typeof a || - (a.content && 'string' == typeof a.content) + 'string' == typeof g || + (g.content && 'string' == typeof g.content) ) { - var r = d[m], - o = p.tokenStack[r], - c = 'string' == typeof a ? a : a.content, - i = v(k, r), - u = c.indexOf(i); - if (-1 < u) { - ++m; - var g = c.substring(0, u), - l = new h.Token( - k, - h.tokenize(o, p.grammar), - 'language-' + k, - o + var l = o[r], + s = t.tokenStack[l], + f = 'string' == typeof g ? g : g.content, + p = n(a, l), + k = f.indexOf(p); + if (k > -1) { + ++r; + var m = f.substring(0, k), + d = new e.Token( + a, + e.tokenize(s, t.grammar), + 'language-' + a, + s ), - s = c.substring(u + i.length), - f = []; - g && f.push.apply(f, e([g])), - f.push(l), - s && f.push.apply(f, e([s])), - 'string' == typeof a - ? n.splice.apply(n, [t, 1].concat(f)) - : (a.content = f); + h = f.substring(k + p.length), + v = []; + m && v.push.apply(v, c([m])), + v.push(d), + h && v.push.apply(v, c([h])), + 'string' == typeof g + ? i.splice.apply(i, [u, 1].concat(v)) + : (g.content = v); } - } else a.content && e(a.content); + } else g.content && c(g.content); } - return n; - })(p.tokens); + return i; + })(t.tokens); } }, }, diff --git a/public/prism/prism-markup.js b/public/prism/prism-markup.js index 031bbc9..b5d2129 100644 --- a/public/prism/prism-markup.js +++ b/public/prism/prism-markup.js @@ -53,7 +53,10 @@ Prism.languages.markup = { pattern: /^=/, alias: 'attr-equals', }, - /"|'/, + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true, + }, ], }, }, diff --git a/public/prism/prism-markup.min.js b/public/prism/prism-markup.min.js index 2c04143..1117db7 100644 --- a/public/prism/prism-markup.min.js +++ b/public/prism/prism-markup.min.js @@ -32,7 +32,10 @@ 'attr-value': { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { - punctuation: [{ pattern: /^=/, alias: 'attr-equals' }, /"|'/], + punctuation: [ + { pattern: /^=/, alias: 'attr-equals' }, + { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }, + ], }, }, punctuation: /\/?>/, diff --git a/public/prism/prism-mata.js b/public/prism/prism-mata.js new file mode 100644 index 0000000..adec279 --- /dev/null +++ b/public/prism/prism-mata.js @@ -0,0 +1,54 @@ +// https://www.stata.com/manuals/m.pdf + +(function (Prism) { + var orgType = /\b(?:(?:col|row)?vector|matrix|scalar)\b/.source; + var type = + /\bvoid\b||\b(?:complex|numeric|pointer(?:\s*\([^()]*\))?|real|string|(?:class|struct)\s+\w+|transmorphic)(?:\s*)?/.source.replace( + //g, + orgType + ); + + Prism.languages.mata = { + comment: { + pattern: + /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//, + greedy: true, + }, + string: { + pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/, + greedy: true, + }, + + 'class-name': { + pattern: /(\b(?:class|extends|struct)\s+)\w+(?=\s*(?:\{|\bextends\b))/, + lookbehind: true, + }, + type: { + pattern: RegExp(type), + alias: 'class-name', + inside: { + punctuation: /[()]/, + keyword: /\b(?:class|function|struct|void)\b/, + }, + }, + keyword: + /\b(?:break|class|continue|do|else|end|extends|external|final|for|function|goto|if|pragma|private|protected|public|return|static|struct|unset|unused|version|virtual|while)\b/, + constant: /\bNULL\b/, + + number: { + pattern: + /(^|[^\w.])(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|\d[a-f0-9]*(?:\.[a-f0-9]+)?x[+-]?\d+)i?(?![\w.])/i, + lookbehind: true, + }, + missing: { + pattern: /(^|[^\w.])(?:\.[a-z]?)(?![\w.])/, + lookbehind: true, + alias: 'symbol', + }, + + function: /\b[a-z_]\w*(?=\s*\()/i, + + operator: /\.\.|\+\+|--|&&|\|\||:?(?:[!=<>]=|[+\-*/^<>&|:])|[!?=\\#’`']/, + punctuation: /[()[\]{},;.]/, + }; +})(Prism); diff --git a/public/prism/prism-mata.min.js b/public/prism/prism-mata.min.js new file mode 100644 index 0000000..528cb5a --- /dev/null +++ b/public/prism/prism-mata.min.js @@ -0,0 +1,43 @@ +!(function (t) { + var e = + '\\bvoid\\b||\\b(?:complex|numeric|pointer(?:\\s*\\([^()]*\\))?|real|string|(?:class|struct)\\s+\\w+|transmorphic)(?:\\s*)?'.replace( + //g, + '\\b(?:(?:col|row)?vector|matrix|scalar)\\b' + ); + t.languages.mata = { + comment: { + pattern: + /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//, + greedy: !0, + }, + string: { pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/, greedy: !0 }, + 'class-name': { + pattern: /(\b(?:class|extends|struct)\s+)\w+(?=\s*(?:\{|\bextends\b))/, + lookbehind: !0, + }, + type: { + pattern: RegExp(e), + alias: 'class-name', + inside: { + punctuation: /[()]/, + keyword: /\b(?:class|function|struct|void)\b/, + }, + }, + keyword: + /\b(?:break|class|continue|do|else|end|extends|external|final|for|function|goto|if|pragma|private|protected|public|return|static|struct|unset|unused|version|virtual|while)\b/, + constant: /\bNULL\b/, + number: { + pattern: + /(^|[^\w.])(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|\d[a-f0-9]*(?:\.[a-f0-9]+)?x[+-]?\d+)i?(?![\w.])/i, + lookbehind: !0, + }, + missing: { + pattern: /(^|[^\w.])(?:\.[a-z]?)(?![\w.])/, + lookbehind: !0, + alias: 'symbol', + }, + function: /\b[a-z_]\w*(?=\s*\()/i, + operator: /\.\.|\+\+|--|&&|\|\||:?(?:[!=<>]=|[+\-*/^<>&|:])|[!?=\\#’`']/, + punctuation: /[()[\]{},;.]/, + }; +})(Prism); diff --git a/public/prism/prism-maxscript.min.js b/public/prism/prism-maxscript.min.js index 22af7d9..9e9dbf9 100644 --- a/public/prism/prism-maxscript.min.js +++ b/public/prism/prism-maxscript.min.js @@ -1,7 +1,7 @@ !(function (t) { var e = /\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i; - Prism.languages.maxscript = { + t.languages.maxscript = { comment: { pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/, greedy: !0 }, string: { pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/, @@ -52,4 +52,4 @@ operator: /[-+*/<>=!]=?|[&^?]|#(?!\()/, punctuation: /[()\[\]{}.:,;]|#(?=\()|\\$/m, }; -})(); +})(Prism); diff --git a/public/prism/prism-mel.js b/public/prism/prism-mel.js index 88d6291..7381d42 100644 --- a/public/prism/prism-mel.js +++ b/public/prism/prism-mel.js @@ -1,7 +1,10 @@ Prism.languages.mel = { - comment: /\/\/.*/, + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?\*\//, + greedy: true, + }, code: { - pattern: /`(?:\\.|[^\\`\r\n])*`/, + pattern: /`(?:\\.|[^\\`])*`/, greedy: true, alias: 'italic', inside: { @@ -9,7 +12,10 @@ Prism.languages.mel = { pattern: /^`|`$/, alias: 'punctuation', }, - // See rest below + statement: { + pattern: /[\s\S]+/, + inside: null, // see below + }, }, }, string: { @@ -24,22 +30,19 @@ Prism.languages.mel = { }, keyword: /\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/, - function: - /\b\w+(?=\()|\b(?:CBG|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|Mayatomr|about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/, + function: { + pattern: + /((?:^|[{;])[ \t]*)[a-z_]\w*\b(?!\s*(?:\.(?!\.)|[[{=]))|\b[a-z_]\w*(?=[ \t]*\()/im, + lookbehind: true, + greedy: true, + }, - operator: [ - /\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/, - { - // We don't want to match << - pattern: /(^|[^<])<(?!<)/, - lookbehind: true, - }, - { - // We don't want to match >> - pattern: /(^|[^>])>(?!>)/, - lookbehind: true, - }, - ], - punctuation: /<<|>>|[.,:;?\[\](){}]/, + 'tensor-punctuation': { + pattern: /<<|>>/, + alias: 'punctuation', + }, + operator: /\+[+=]?|-[-=]?|&&|\|\||[<>]=?|[*\/!=]=?|[%^]/, + punctuation: /[.,:;?\[\](){}]/, }; -Prism.languages.mel['code'].inside.rest = Prism.languages.mel; + +Prism.languages.mel['code'].inside['statement'].inside = Prism.languages.mel; diff --git a/public/prism/prism-mel.min.js b/public/prism/prism-mel.min.js index 44dfea9..e86ddbf 100644 --- a/public/prism/prism-mel.min.js +++ b/public/prism/prism-mel.min.js @@ -1,10 +1,13 @@ (Prism.languages.mel = { - comment: /\/\/.*/, + comment: { pattern: /\/\/.*|\/\*[\s\S]*?\*\//, greedy: !0 }, code: { - pattern: /`(?:\\.|[^\\`\r\n])*`/, + pattern: /`(?:\\.|[^\\`])*`/, greedy: !0, alias: 'italic', - inside: { delimiter: { pattern: /^`|`$/, alias: 'punctuation' } }, + inside: { + delimiter: { pattern: /^`|`$/, alias: 'punctuation' }, + statement: { pattern: /[\s\S]+/, inside: null }, + }, }, string: { pattern: /"(?:\\.|[^\\"\r\n])*"/, greedy: !0 }, variable: /\$\w+/, @@ -12,13 +15,14 @@ flag: { pattern: /-[^\d\W]\w*/, alias: 'operator' }, keyword: /\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/, - function: - /\b\w+(?=\()|\b(?:CBG|HfAddAttractorToAS|HfAssignAS|HfBuildEqualMap|HfBuildFurFiles|HfBuildFurImages|HfCancelAFR|HfConnectASToHF|HfCreateAttractor|HfDeleteAS|HfEditAS|HfPerformCreateAS|HfRemoveAttractorFromAS|HfSelectAttached|HfSelectAttractors|HfUnAssignAS|Mayatomr|about|abs|addAttr|addAttributeEditorNodeHelp|addDynamic|addNewShelfTab|addPP|addPanelCategory|addPrefixToName|advanceToNextDrivenKey|affectedNet|affects|aimConstraint|air|alias|aliasAttr|align|alignCtx|alignCurve|alignSurface|allViewFit|ambientLight|angle|angleBetween|animCone|animCurveEditor|animDisplay|animView|annotate|appendStringArray|applicationName|applyAttrPreset|applyTake|arcLenDimContext|arcLengthDimension|arclen|arrayMapper|art3dPaintCtx|artAttrCtx|artAttrPaintVertexCtx|artAttrSkinPaintCtx|artAttrTool|artBuildPaintMenu|artFluidAttrCtx|artPuttyCtx|artSelectCtx|artSetPaintCtx|artUserPaintCtx|assignCommand|assignInputDevice|assignViewportFactories|attachCurve|attachDeviceAttr|attachSurface|attrColorSliderGrp|attrCompatibility|attrControlGrp|attrEnumOptionMenu|attrEnumOptionMenuGrp|attrFieldGrp|attrFieldSliderGrp|attrNavigationControlGrp|attrPresetEditWin|attributeExists|attributeInfo|attributeMenu|attributeQuery|autoKeyframe|autoPlace|bakeClip|bakeFluidShading|bakePartialHistory|bakeResults|bakeSimulation|basename|basenameEx|batchRender|bessel|bevel|bevelPlus|binMembership|bindSkin|blend2|blendShape|blendShapeEditor|blendShapePanel|blendTwoAttr|blindDataType|boneLattice|boundary|boxDollyCtx|boxZoomCtx|bufferCurve|buildBookmarkMenu|buildKeyframeMenu|button|buttonManip|cacheFile|cacheFileCombine|cacheFileMerge|cacheFileTrack|camera|cameraView|canCreateManip|canvas|capitalizeString|catch|catchQuiet|ceil|changeSubdivComponentDisplayLevel|changeSubdivRegion|channelBox|character|characterMap|characterOutlineEditor|characterize|chdir|checkBox|checkBoxGrp|checkDefaultRenderGlobals|choice|circle|circularFillet|clamp|clear|clearCache|clip|clipEditor|clipEditorCurrentTimeCtx|clipSchedule|clipSchedulerOutliner|clipTrimBefore|closeCurve|closeSurface|cluster|cmdFileOutput|cmdScrollFieldExecuter|cmdScrollFieldReporter|cmdShell|coarsenSubdivSelectionList|collision|color|colorAtPoint|colorEditor|colorIndex|colorIndexSliderGrp|colorSliderButtonGrp|colorSliderGrp|columnLayout|commandEcho|commandLine|commandPort|compactHairSystem|componentEditor|compositingInterop|computePolysetVolume|condition|cone|confirmDialog|connectAttr|connectControl|connectDynamic|connectJoint|connectionInfo|constrain|constrainValue|constructionHistory|container|containsMultibyte|contextInfo|control|convertFromOldLayers|convertIffToPsd|convertLightmap|convertSolidTx|convertTessellation|convertUnit|copyArray|copyFlexor|copyKey|copySkinWeights|cos|cpButton|cpCache|cpClothSet|cpCollision|cpConstraint|cpConvClothToMesh|cpForces|cpGetSolverAttr|cpPanel|cpProperty|cpRigidCollisionFilter|cpSeam|cpSetEdit|cpSetSolverAttr|cpSolver|cpSolverTypes|cpTool|cpUpdateClothUVs|createDisplayLayer|createDrawCtx|createEditor|createLayeredPsdFile|createMotionField|createNewShelf|createNode|createRenderLayer|createSubdivRegion|cross|crossProduct|ctxAbort|ctxCompletion|ctxEditMode|ctxTraverse|currentCtx|currentTime|currentTimeCtx|currentUnit|curve|curveAddPtCtx|curveCVCtx|curveEPCtx|curveEditorCtx|curveIntersect|curveMoveEPCtx|curveOnSurface|curveSketchCtx|cutKey|cycleCheck|cylinder|dagPose|date|defaultLightListCheckBox|defaultNavigation|defineDataServer|defineVirtualDevice|deformer|deg_to_rad|delete|deleteAttr|deleteShadingGroupsAndMaterials|deleteShelfTab|deleteUI|deleteUnusedBrushes|delrandstr|detachCurve|detachDeviceAttr|detachSurface|deviceEditor|devicePanel|dgInfo|dgdirty|dgeval|dgtimer|dimWhen|directKeyCtx|directionalLight|dirmap|dirname|disable|disconnectAttr|disconnectJoint|diskCache|displacementToPoly|displayAffected|displayColor|displayCull|displayLevelOfDetail|displayPref|displayRGBColor|displaySmoothness|displayStats|displayString|displaySurface|distanceDimContext|distanceDimension|doBlur|dolly|dollyCtx|dopeSheetEditor|dot|dotProduct|doubleProfileBirailSurface|drag|dragAttrContext|draggerContext|dropoffLocator|duplicate|duplicateCurve|duplicateSurface|dynCache|dynControl|dynExport|dynExpression|dynGlobals|dynPaintEditor|dynParticleCtx|dynPref|dynRelEdPanel|dynRelEditor|dynamicLoad|editAttrLimits|editDisplayLayerGlobals|editDisplayLayerMembers|editRenderLayerAdjustment|editRenderLayerGlobals|editRenderLayerMembers|editor|editorTemplate|effector|emit|emitter|enableDevice|encodeString|endString|endsWith|env|equivalent|equivalentTol|erf|error|eval|evalDeferred|evalEcho|event|exactWorldBoundingBox|exclusiveLightCheckBox|exec|executeForEachObject|exists|exp|expression|expressionEditorListen|extendCurve|extendSurface|extrude|fcheck|fclose|feof|fflush|fgetline|fgetword|file|fileBrowserDialog|fileDialog|fileExtension|fileInfo|filetest|filletCurve|filter|filterCurve|filterExpand|filterStudioImport|findAllIntersections|findAnimCurves|findKeyframe|findMenuItem|findRelatedSkinCluster|finder|firstParentOf|fitBspline|flexor|floatEq|floatField|floatFieldGrp|floatScrollBar|floatSlider|floatSlider2|floatSliderButtonGrp|floatSliderGrp|floor|flow|fluidCacheInfo|fluidEmitter|fluidVoxelInfo|flushUndo|fmod|fontDialog|fopen|formLayout|format|fprint|frameLayout|fread|freeFormFillet|frewind|fromNativePath|fwrite|gamma|gauss|geometryConstraint|getApplicationVersionAsFloat|getAttr|getClassification|getDefaultBrush|getFileList|getFluidAttr|getInputDeviceRange|getMayaPanelTypes|getModifiers|getPanel|getParticleAttr|getPluginResource|getenv|getpid|glRender|glRenderEditor|globalStitch|gmatch|goal|gotoBindPose|grabColor|gradientControl|gradientControlNoAttr|graphDollyCtx|graphSelectContext|graphTrackCtx|gravity|grid|gridLayout|group|groupObjectsByName|hardenPointCurve|hardware|hardwareRenderPanel|headsUpDisplay|headsUpMessage|help|helpLine|hermite|hide|hilite|hitTest|hotBox|hotkey|hotkeyCheck|hsv_to_rgb|hudButton|hudSlider|hudSliderButton|hwReflectionMap|hwRender|hwRenderLoad|hyperGraph|hyperPanel|hyperShade|hypot|iconTextButton|iconTextCheckBox|iconTextRadioButton|iconTextRadioCollection|iconTextScrollList|iconTextStaticLabel|ikHandle|ikHandleCtx|ikHandleDisplayScale|ikSolver|ikSplineHandleCtx|ikSystem|ikSystemInfo|ikfkDisplayMethod|illustratorCurves|image|imfPlugins|inheritTransform|insertJoint|insertJointCtx|insertKeyCtx|insertKnotCurve|insertKnotSurface|instance|instanceable|instancer|intField|intFieldGrp|intScrollBar|intSlider|intSliderGrp|interToUI|internalVar|intersect|iprEngine|isAnimCurve|isConnected|isDirty|isParentOf|isSameObject|isTrue|isValidObjectName|isValidString|isValidUiName|isolateSelect|itemFilter|itemFilterAttr|itemFilterRender|itemFilterType|joint|jointCluster|jointCtx|jointDisplayScale|jointLattice|keyTangent|keyframe|keyframeOutliner|keyframeRegionCurrentTimeCtx|keyframeRegionDirectKeyCtx|keyframeRegionDollyCtx|keyframeRegionInsertKeyCtx|keyframeRegionMoveKeyCtx|keyframeRegionScaleKeyCtx|keyframeRegionSelectKeyCtx|keyframeRegionSetKeyCtx|keyframeRegionTrackCtx|keyframeStats|lassoContext|lattice|latticeDeformKeyCtx|launch|launchImageEditor|layerButton|layeredShaderPort|layeredTexturePort|layout|layoutDialog|lightList|lightListEditor|lightListPanel|lightlink|lineIntersection|linearPrecision|linstep|listAnimatable|listAttr|listCameras|listConnections|listDeviceAttachments|listHistory|listInputDeviceAxes|listInputDeviceButtons|listInputDevices|listMenuAnnotation|listNodeTypes|listPanelCategories|listRelatives|listSets|listTransforms|listUnselected|listerEditor|loadFluid|loadNewShelf|loadPlugin|loadPluginLanguageResources|loadPrefObjects|localizedPanelLabel|lockNode|loft|log|longNameOf|lookThru|ls|lsThroughFilter|lsType|lsUI|mag|makeIdentity|makeLive|makePaintable|makeRoll|makeSingleSurface|makeTubeOn|makebot|manipMoveContext|manipMoveLimitsCtx|manipOptions|manipRotateContext|manipRotateLimitsCtx|manipScaleContext|manipScaleLimitsCtx|marker|match|max|memory|menu|menuBarLayout|menuEditor|menuItem|menuItemToShelf|menuSet|menuSetPref|messageLine|min|minimizeApp|mirrorJoint|modelCurrentTimeCtx|modelEditor|modelPanel|mouse|movIn|movOut|move|moveIKtoFK|moveKeyCtx|moveVertexAlongDirection|multiProfileBirailSurface|mute|nParticle|nameCommand|nameField|namespace|namespaceInfo|newPanelItems|newton|nodeCast|nodeIconButton|nodeOutliner|nodePreset|nodeType|noise|nonLinear|normalConstraint|normalize|nurbsBoolean|nurbsCopyUVSet|nurbsCube|nurbsEditUV|nurbsPlane|nurbsSelect|nurbsSquare|nurbsToPoly|nurbsToPolygonsPref|nurbsToSubdiv|nurbsToSubdivPref|nurbsUVSet|nurbsViewDirectionVector|objExists|objectCenter|objectLayer|objectType|objectTypeUI|obsoleteProc|oceanNurbsPreviewPlane|offsetCurve|offsetCurveOnSurface|offsetSurface|openGLExtension|openMayaPref|optionMenu|optionMenuGrp|optionVar|orbit|orbitCtx|orientConstraint|outlinerEditor|outlinerPanel|overrideModifier|paintEffectsDisplay|pairBlend|palettePort|paneLayout|panel|panelConfiguration|panelHistory|paramDimContext|paramDimension|paramLocator|parent|parentConstraint|particle|particleExists|particleInstancer|particleRenderInfo|partition|pasteKey|pathAnimation|pause|pclose|percent|performanceOptions|pfxstrokes|pickWalk|picture|pixelMove|planarSrf|plane|play|playbackOptions|playblast|plugAttr|plugNode|pluginInfo|pluginResourceUtil|pointConstraint|pointCurveConstraint|pointLight|pointMatrixMult|pointOnCurve|pointOnSurface|pointPosition|poleVectorConstraint|polyAppend|polyAppendFacetCtx|polyAppendVertex|polyAutoProjection|polyAverageNormal|polyAverageVertex|polyBevel|polyBlendColor|polyBlindData|polyBoolOp|polyBridgeEdge|polyCacheMonitor|polyCheck|polyChipOff|polyClipboard|polyCloseBorder|polyCollapseEdge|polyCollapseFacet|polyColorBlindData|polyColorDel|polyColorPerVertex|polyColorSet|polyCompare|polyCone|polyCopyUV|polyCrease|polyCreaseCtx|polyCreateFacet|polyCreateFacetCtx|polyCube|polyCut|polyCutCtx|polyCylinder|polyCylindricalProjection|polyDelEdge|polyDelFacet|polyDelVertex|polyDuplicateAndConnect|polyDuplicateEdge|polyEditUV|polyEditUVShell|polyEvaluate|polyExtrudeEdge|polyExtrudeFacet|polyExtrudeVertex|polyFlipEdge|polyFlipUV|polyForceUV|polyGeoSampler|polyHelix|polyInfo|polyInstallAction|polyLayoutUV|polyListComponentConversion|polyMapCut|polyMapDel|polyMapSew|polyMapSewMove|polyMergeEdge|polyMergeEdgeCtx|polyMergeFacet|polyMergeFacetCtx|polyMergeUV|polyMergeVertex|polyMirrorFace|polyMoveEdge|polyMoveFacet|polyMoveFacetUV|polyMoveUV|polyMoveVertex|polyNormal|polyNormalPerVertex|polyNormalizeUV|polyOptUvs|polyOptions|polyOutput|polyPipe|polyPlanarProjection|polyPlane|polyPlatonicSolid|polyPoke|polyPrimitive|polyPrism|polyProjection|polyPyramid|polyQuad|polyQueryBlindData|polyReduce|polySelect|polySelectConstraint|polySelectConstraintMonitor|polySelectCtx|polySelectEditCtx|polySeparate|polySetToFaceNormal|polySewEdge|polyShortestPathCtx|polySmooth|polySoftEdge|polySphere|polySphericalProjection|polySplit|polySplitCtx|polySplitEdge|polySplitRing|polySplitVertex|polyStraightenUVBorder|polySubdivideEdge|polySubdivideFacet|polyToSubdiv|polyTorus|polyTransfer|polyTriangulate|polyUVSet|polyUnite|polyWedgeFace|popen|popupMenu|pose|pow|preloadRefEd|print|progressBar|progressWindow|projFileViewer|projectCurve|projectTangent|projectionContext|projectionManip|promptDialog|propModCtx|propMove|psdChannelOutliner|psdEditTextureFile|psdExport|psdTextureFile|putenv|pwd|python|querySubdiv|quit|rad_to_deg|radial|radioButton|radioButtonGrp|radioCollection|radioMenuItemCollection|rampColorPort|rand|randomizeFollicles|randstate|rangeControl|readTake|rebuildCurve|rebuildSurface|recordAttr|recordDevice|redo|reference|referenceEdit|referenceQuery|refineSubdivSelectionList|refresh|refreshAE|registerPluginResource|rehash|reloadImage|removeJoint|removeMultiInstance|removePanelCategory|rename|renameAttr|renameSelectionList|renameUI|render|renderGlobalsNode|renderInfo|renderLayerButton|renderLayerParent|renderLayerPostProcess|renderLayerUnparent|renderManip|renderPartition|renderQualityNode|renderSettings|renderThumbnailUpdate|renderWindowEditor|renderWindowSelectContext|renderer|reorder|reorderDeformers|requires|reroot|resampleFluid|resetAE|resetPfxToPolyCamera|resetTool|resolutionNode|retarget|reverseCurve|reverseSurface|revolve|rgb_to_hsv|rigidBody|rigidSolver|roll|rollCtx|rootOf|rot|rotate|rotationInterpolation|roundConstantRadius|rowColumnLayout|rowLayout|runTimeCommand|runup|sampleImage|saveAllShelves|saveAttrPreset|saveFluid|saveImage|saveInitialState|saveMenu|savePrefObjects|savePrefs|saveShelf|saveToolSettings|scale|scaleBrushBrightness|scaleComponents|scaleConstraint|scaleKey|scaleKeyCtx|sceneEditor|sceneUIReplacement|scmh|scriptCtx|scriptEditorInfo|scriptJob|scriptNode|scriptTable|scriptToShelf|scriptedPanel|scriptedPanelType|scrollField|scrollLayout|sculpt|searchPathArray|seed|selLoadSettings|select|selectContext|selectCurveCV|selectKey|selectKeyCtx|selectKeyframeRegionCtx|selectMode|selectPref|selectPriority|selectType|selectedNodes|selectionConnection|separator|setAttr|setAttrEnumResource|setAttrMapping|setAttrNiceNameResource|setConstraintRestPosition|setDefaultShadingGroup|setDrivenKeyframe|setDynamic|setEditCtx|setEditor|setFluidAttr|setFocus|setInfinity|setInputDeviceMapping|setKeyCtx|setKeyPath|setKeyframe|setKeyframeBlendshapeTargetWts|setMenuMode|setNodeNiceNameResource|setNodeTypeFlag|setParent|setParticleAttr|setPfxToPolyCamera|setPluginResource|setProject|setStampDensity|setStartupMessage|setState|setToolTo|setUITemplate|setXformManip|sets|shadingConnection|shadingGeometryRelCtx|shadingLightRelCtx|shadingNetworkCompare|shadingNode|shapeCompare|shelfButton|shelfLayout|shelfTabLayout|shellField|shortNameOf|showHelp|showHidden|showManipCtx|showSelectionInTitle|showShadingGroupAttrEditor|showWindow|sign|simplify|sin|singleProfileBirailSurface|size|sizeBytes|skinCluster|skinPercent|smoothCurve|smoothTangentSurface|smoothstep|snap2to2|snapKey|snapMode|snapTogetherCtx|snapshot|soft|softMod|softModCtx|sort|sound|soundControl|source|spaceLocator|sphere|sphrand|spotLight|spotLightPreviewPort|spreadSheetEditor|spring|sqrt|squareSurface|srtContext|stackTrace|startString|startsWith|stitchAndExplodeShell|stitchSurface|stitchSurfacePoints|strcmp|stringArrayCatenate|stringArrayContains|stringArrayCount|stringArrayInsertAtIndex|stringArrayIntersector|stringArrayRemove|stringArrayRemoveAtIndex|stringArrayRemoveDuplicates|stringArrayRemoveExact|stringArrayToString|stringToStringArray|strip|stripPrefixFromName|stroke|subdAutoProjection|subdCleanTopology|subdCollapse|subdDuplicateAndConnect|subdEditUV|subdListComponentConversion|subdMapCut|subdMapSewMove|subdMatchTopology|subdMirror|subdToBlind|subdToPoly|subdTransferUVsToCache|subdiv|subdivCrease|subdivDisplaySmoothness|substitute|substituteAllString|substituteGeometry|substring|surface|surfaceSampler|surfaceShaderList|swatchDisplayPort|switchTable|symbolButton|symbolCheckBox|sysFile|system|tabLayout|tan|tangentConstraint|texLatticeDeformContext|texManipContext|texMoveContext|texMoveUVShellContext|texRotateContext|texScaleContext|texSelectContext|texSelectShortestPathCtx|texSmudgeUVContext|texWinToolCtx|text|textCurves|textField|textFieldButtonGrp|textFieldGrp|textManip|textScrollList|textToShelf|textureDisplacePlane|textureHairColor|texturePlacementContext|textureWindow|threadCount|threePointArcCtx|timeControl|timePort|timerX|toNativePath|toggle|toggleAxis|toggleWindowVisibility|tokenize|tokenizeList|tolerance|tolower|toolButton|toolCollection|toolDropped|toolHasOptions|toolPropertyWindow|torus|toupper|trace|track|trackCtx|transferAttributes|transformCompare|transformLimits|translator|trim|trunc|truncateFluidCache|truncateHairCache|tumble|tumbleCtx|turbulence|twoPointArcCtx|uiRes|uiTemplate|unassignInputDevice|undo|undoInfo|ungroup|uniform|unit|unloadPlugin|untangleUV|untitledFileName|untrim|upAxis|updateAE|userCtx|uvLink|uvSnapshot|validateShelfName|vectorize|view2dToolCtx|viewCamera|viewClipPlane|viewFit|viewHeadOn|viewLookAt|viewManip|viewPlace|viewSet|visor|volumeAxis|vortex|waitCursor|warning|webBrowser|webBrowserPrefs|whatIs|window|windowPref|wire|wireContext|workspace|wrinkle|wrinkleContext|writeTake|xbmLangPathList|xform)\b/, - operator: [ - /\+[+=]?|-[-=]?|&&|\|\||[<>]=|[*\/!=]=?|[%^]/, - { pattern: /(^|[^<])<(?!<)/, lookbehind: !0 }, - { pattern: /(^|[^>])>(?!>)/, lookbehind: !0 }, - ], - punctuation: /<<|>>|[.,:;?\[\](){}]/, + function: { + pattern: + /((?:^|[{;])[ \t]*)[a-z_]\w*\b(?!\s*(?:\.(?!\.)|[[{=]))|\b[a-z_]\w*(?=[ \t]*\()/im, + lookbehind: !0, + greedy: !0, + }, + 'tensor-punctuation': { pattern: /<<|>>/, alias: 'punctuation' }, + operator: /\+[+=]?|-[-=]?|&&|\|\||[<>]=?|[*\/!=]=?|[%^]/, + punctuation: /[.,:;?\[\](){}]/, }), - (Prism.languages.mel.code.inside.rest = Prism.languages.mel); + (Prism.languages.mel.code.inside.statement.inside = Prism.languages.mel); diff --git a/public/prism/prism-metafont.js b/public/prism/prism-metafont.js new file mode 100644 index 0000000..a2d6239 --- /dev/null +++ b/public/prism/prism-metafont.js @@ -0,0 +1,92 @@ +Prism.languages.metafont = { + // Syntax of METAFONT with the added (public) elements of PlainMETAFONT. Except for internal quantities they are expected to be rarely redefined. Freely inspired by the syntax of Christophe Grandsire for the Crimson Editor. + comment: { + pattern: /%.*/, + greedy: true, + }, + string: { + pattern: /"[^\r\n"]*"/, + greedy: true, + }, + number: /\d*\.?\d+/, + boolean: /\b(?:false|true)\b/, + punctuation: [ + /[,;()]/, + { + pattern: /(^|[^{}])(?:\{|\})(?![{}])/, + lookbehind: true, + }, + { + pattern: /(^|[^[])\[(?!\[)/, + lookbehind: true, + }, + { + pattern: /(^|[^\]])\](?!\])/, + lookbehind: true, + }, + ], + constant: [ + { + pattern: /(^|[^!?])\?\?\?(?![!?])/, + lookbehind: true, + }, + { + pattern: /(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/, + lookbehind: true, + }, + /\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/, + ], + quantity: { + pattern: + /\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/, + alias: 'keyword', + }, + command: { + pattern: + /\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/, + alias: 'builtin', + }, + operator: [ + { + pattern: + /(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/, + lookbehind: true, + }, + { + pattern: /(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/, + lookbehind: true, + }, + { + pattern: /(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/, + lookbehind: true, + }, + { + pattern: /(^|[^.])(?:\.{2,3})(?!\.)/, + lookbehind: true, + }, + { + pattern: /(^|[^@#&$])&(?![@#&$])/, + lookbehind: true, + }, + /\b(?:and|not|or)\b/, + ], + macro: { + pattern: + /\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/, + alias: 'function', + }, + builtin: + /\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/, + keyword: + /\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/, + type: { + pattern: + /\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/, + alias: 'property', + }, + variable: { + pattern: + /(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/, + lookbehind: true, + }, +}; diff --git a/public/prism/prism-metafont.min.js b/public/prism/prism-metafont.min.js new file mode 100644 index 0000000..16176c6 --- /dev/null +++ b/public/prism/prism-metafont.min.js @@ -0,0 +1,58 @@ +Prism.languages.metafont = { + comment: { pattern: /%.*/, greedy: !0 }, + string: { pattern: /"[^\r\n"]*"/, greedy: !0 }, + number: /\d*\.?\d+/, + boolean: /\b(?:false|true)\b/, + punctuation: [ + /[,;()]/, + { pattern: /(^|[^{}])(?:\{|\})(?![{}])/, lookbehind: !0 }, + { pattern: /(^|[^[])\[(?!\[)/, lookbehind: !0 }, + { pattern: /(^|[^\]])\](?!\])/, lookbehind: !0 }, + ], + constant: [ + { pattern: /(^|[^!?])\?\?\?(?![!?])/, lookbehind: !0 }, + { pattern: /(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/, lookbehind: !0 }, + /\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/, + ], + quantity: { + pattern: + /\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/, + alias: 'keyword', + }, + command: { + pattern: + /\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/, + alias: 'builtin', + }, + operator: [ + { + pattern: + /(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/, + lookbehind: !0, + }, + { pattern: /(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/, lookbehind: !0 }, + { pattern: /(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/, lookbehind: !0 }, + { pattern: /(^|[^.])(?:\.{2,3})(?!\.)/, lookbehind: !0 }, + { pattern: /(^|[^@#&$])&(?![@#&$])/, lookbehind: !0 }, + /\b(?:and|not|or)\b/, + ], + macro: { + pattern: + /\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/, + alias: 'function', + }, + builtin: + /\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/, + keyword: + /\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/, + type: { + pattern: + /\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/, + alias: 'property', + }, + variable: { + pattern: + /(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/, + lookbehind: !0, + }, +}; diff --git a/public/prism/prism-mongodb.js b/public/prism/prism-mongodb.js index 22bac3e..af0a705 100644 --- a/public/prism/prism-mongodb.js +++ b/public/prism/prism-mongodb.js @@ -90,6 +90,7 @@ '$unionWith', '$unset', '$unwind', + '$setWindowFields', // aggregation pipeline operators '$abs', @@ -222,6 +223,16 @@ '$week', '$year', '$zip', + '$count', + '$dateAdd', + '$dateDiff', + '$dateSubtract', + '$dateTrunc', + '$getField', + '$rand', + '$sampleRate', + '$setField', + '$unsetField', // aggregation pipeline query modifiers '$comment', diff --git a/public/prism/prism-mongodb.min.js b/public/prism/prism-mongodb.min.js index 6c845ac..10fe62f 100644 --- a/public/prism/prism-mongodb.min.js +++ b/public/prism/prism-mongodb.min.js @@ -85,6 +85,7 @@ '$unionWith', '$unset', '$unwind', + '$setWindowFields', '$abs', '$accumulator', '$acos', @@ -215,6 +216,16 @@ '$week', '$year', '$zip', + '$count', + '$dateAdd', + '$dateDiff', + '$dateSubtract', + '$dateTrunc', + '$getField', + '$rand', + '$sampleRate', + '$setField', + '$unsetField', '$comment', '$explain', '$hint', diff --git a/public/prism/prism-neon.js b/public/prism/prism-neon.js index e3e20f1..cb06edb 100644 --- a/public/prism/prism-neon.js +++ b/public/prism/prism-neon.js @@ -12,7 +12,7 @@ Prism.languages.neon = { key: { pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/, lookbehind: true, - alias: 'atrule', + alias: 'property', }, number: { pattern: diff --git a/public/prism/prism-neon.min.js b/public/prism/prism-neon.min.js index 8575063..ee79404 100644 --- a/public/prism/prism-neon.min.js +++ b/public/prism/prism-neon.min.js @@ -9,7 +9,7 @@ Prism.languages.neon = { key: { pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/, lookbehind: !0, - alias: 'atrule', + alias: 'property', }, number: { pattern: diff --git a/public/prism/prism-nginx.min.js b/public/prism/prism-nginx.min.js index 7f470a7..b7f5d93 100644 --- a/public/prism/prism-nginx.min.js +++ b/public/prism/prism-nginx.min.js @@ -1,6 +1,6 @@ !(function (e) { var n = /\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i; - Prism.languages.nginx = { + e.languages.nginx = { comment: { pattern: /(^|[\s{};])#.*/, lookbehind: !0, greedy: !0 }, directive: { pattern: @@ -27,4 +27,4 @@ }, punctuation: /[{};]/, }; -})(); +})(Prism); diff --git a/public/prism/prism-nsis.js b/public/prism/prism-nsis.js index 59e598b..551630a 100644 --- a/public/prism/prism-nsis.js +++ b/public/prism/prism-nsis.js @@ -15,7 +15,7 @@ Prism.languages.nsis = { }, keyword: { pattern: - /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, + /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, lookbehind: true, }, property: diff --git a/public/prism/prism-nsis.min.js b/public/prism/prism-nsis.min.js index c85ecd1..6ddd8a8 100644 --- a/public/prism/prism-nsis.min.js +++ b/public/prism/prism-nsis.min.js @@ -7,7 +7,7 @@ Prism.languages.nsis = { string: { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, keyword: { pattern: - /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, + /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m, lookbehind: !0, }, property: diff --git a/public/prism/prism-odin.js b/public/prism/prism-odin.js new file mode 100644 index 0000000..627539c --- /dev/null +++ b/public/prism/prism-odin.js @@ -0,0 +1,103 @@ +(function (Prism) { + var escapes = + /\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/; + + Prism.languages.odin = { + /** + * The current implementation supports only 1 level of nesting. + * + * @author Michael Schmidt + * @author edukisto + */ + comment: [ + { + pattern: + /\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/, + greedy: true, + }, + { + pattern: /#![^\n\r]*/, + greedy: true, + }, + { + pattern: /\/\/[^\n\r]*/, + greedy: true, + }, + ], + + /** + * Should be found before strings because of '"'"- and '`'`-like sequences. + */ + char: { + pattern: /'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/, + greedy: true, + inside: { + symbol: escapes, + }, + }, + + string: [ + { + pattern: /`[^`]*`/, + greedy: true, + }, + { + pattern: /"(?:\\.|[^\n\r"\\])*"/, + greedy: true, + inside: { + symbol: escapes, + }, + }, + ], + + directive: { + pattern: /#\w+/, + alias: 'property', + }, + + number: + /\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/, + + discard: { + pattern: /\b_\b/, + alias: 'keyword', + }, + + 'procedure-definition': { + pattern: /\b\w+(?=[ \t]*(?::\s*){2}proc\b)/, + alias: 'function', + }, + + keyword: + /\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/, + + /** + * false, nil, true can be used as procedure names. "_" and keywords can't. + */ + 'procedure-name': { + pattern: /\b\w+(?=[ \t]*\()/, + alias: 'function', + }, + + boolean: /\b(?:false|nil|true)\b/, + + 'constant-parameter-sign': { + pattern: /\$/, + alias: 'important', + }, + + undefined: { + pattern: /---/, + alias: 'operator', + }, + + arrow: { + pattern: /->/, + alias: 'punctuation', + }, + + operator: /\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/, + + punctuation: /[(),.:;@\[\]{}]/, + }; +})(Prism); diff --git a/public/prism/prism-odin.min.js b/public/prism/prism-odin.min.js new file mode 100644 index 0000000..2ffc5e2 --- /dev/null +++ b/public/prism/prism-odin.min.js @@ -0,0 +1,41 @@ +!(function (e) { + var t = + /\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/; + e.languages.odin = { + comment: [ + { + pattern: + /\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/, + greedy: !0, + }, + { pattern: /#![^\n\r]*/, greedy: !0 }, + { pattern: /\/\/[^\n\r]*/, greedy: !0 }, + ], + char: { + pattern: /'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/, + greedy: !0, + inside: { symbol: t }, + }, + string: [ + { pattern: /`[^`]*`/, greedy: !0 }, + { pattern: /"(?:\\.|[^\n\r"\\])*"/, greedy: !0, inside: { symbol: t } }, + ], + directive: { pattern: /#\w+/, alias: 'property' }, + number: + /\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/, + discard: { pattern: /\b_\b/, alias: 'keyword' }, + 'procedure-definition': { + pattern: /\b\w+(?=[ \t]*(?::\s*){2}proc\b)/, + alias: 'function', + }, + keyword: + /\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/, + 'procedure-name': { pattern: /\b\w+(?=[ \t]*\()/, alias: 'function' }, + boolean: /\b(?:false|nil|true)\b/, + 'constant-parameter-sign': { pattern: /\$/, alias: 'important' }, + undefined: { pattern: /---/, alias: 'operator' }, + arrow: { pattern: /->/, alias: 'punctuation' }, + operator: /\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/, + punctuation: /[(),.:;@\[\]{}]/, + }; +})(Prism); diff --git a/public/prism/prism-perl.min.js b/public/prism/prism-perl.min.js index 3bb0d61..87c92ce 100644 --- a/public/prism/prism-perl.min.js +++ b/public/prism/prism-perl.min.js @@ -1,7 +1,7 @@ !(function (e) { var n = '(?:\\((?:[^()\\\\]|\\\\[^])*\\)|\\{(?:[^{}\\\\]|\\\\[^])*\\}|\\[(?:[^[\\]\\\\]|\\\\[^])*\\]|<(?:[^<>\\\\]|\\\\[^])*>)'; - Prism.languages.perl = { + e.languages.perl = { comment: [ { pattern: /(^\s*)=\w[\s\S]*?=cut.*/m, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\$])#.*/, lookbehind: !0, greedy: !0 }, @@ -73,4 +73,4 @@ /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/, punctuation: /[{}[\];(),:]/, }; -})(); +})(Prism); diff --git a/public/prism/prism-php.js b/public/prism/prism-php.js index 0dbca89..d338823 100644 --- a/public/prism/prism-php.js +++ b/public/prism/prism-php.js @@ -73,7 +73,7 @@ }, { pattern: - /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string|void)\b/i, + /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i, alias: 'return-type', greedy: true, lookbehind: true, @@ -108,12 +108,12 @@ // keywords cannot be preceded by "->" // the complex lookbehind means `(?|::)\s*)` pattern: - /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i, + /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i, lookbehind: true, }, ], 'argument-name': { - pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i, + pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i, lookbehind: true, }, 'class-name': [ diff --git a/public/prism/prism-php.min.js b/public/prism/prism-php.min.js index 72aed84..050bc84 100644 --- a/public/prism/prism-php.min.js +++ b/public/prism/prism-php.min.js @@ -1,5 +1,5 @@ -!(function (a) { - var e = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/, +!(function (e) { + var a = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/, t = [ { pattern: /\b(?:false|true)\b/i, alias: 'boolean' }, { pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i, greedy: !0, lookbehind: !0 }, @@ -16,9 +16,9 @@ n = /|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/, s = /[{}\[\](),:;]/; - a.languages.php = { + e.languages.php = { delimiter: { pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, alias: 'important' }, - comment: e, + comment: a, variable: /\$+(?:\w+\b|(?=\{))/, package: { pattern: @@ -53,7 +53,7 @@ }, { pattern: - /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string|void)\b/i, + /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i, alias: 'return-type', greedy: !0, lookbehind: !0, @@ -79,12 +79,12 @@ /\bclass\b/i, { pattern: - /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i, + /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i, lookbehind: !0, }, ], 'argument-name': { - pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i, + pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i, lookbehind: !0, }, 'class-name': [ @@ -177,7 +177,7 @@ pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/, lookbehind: !0, - inside: a.languages.php, + inside: e.languages.php, }, r = [ { @@ -223,7 +223,7 @@ inside: { interpolation: l }, }, ]; - a.languages.insertBefore('php', 'variable', { + e.languages.insertBefore('php', 'variable', { string: r, attribute: { pattern: @@ -234,7 +234,7 @@ pattern: /^(#\[)[\s\S]+(?=\]$)/, lookbehind: !0, inside: { - comment: e, + comment: a, string: r, 'attribute-class-name': [ { @@ -261,16 +261,15 @@ }, }, }), - a.hooks.add('before-tokenize', function (e) { - if (/<\?/.test(e.code)) { - a.languages['markup-templating'].buildPlaceholders( - e, + e.hooks.add('before-tokenize', function (a) { + /<\?/.test(a.code) && + e.languages['markup-templating'].buildPlaceholders( + a, 'php', /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g ); - } }), - a.hooks.add('after-tokenize', function (e) { - a.languages['markup-templating'].tokenizePlaceholders(e, 'php'); + e.hooks.add('after-tokenize', function (a) { + e.languages['markup-templating'].tokenizePlaceholders(a, 'php'); }); })(Prism); diff --git a/public/prism/prism-plant-uml.js b/public/prism/prism-plant-uml.js new file mode 100644 index 0000000..cec64b3 --- /dev/null +++ b/public/prism/prism-plant-uml.js @@ -0,0 +1,124 @@ +(function (Prism) { + var variable = /\$\w+|%[a-z]+%/; + + var arrowAttr = /\[[^[\]]*\]/.source; + var arrowDirection = /(?:[drlu]|do|down|le|left|ri|right|up)/.source; + var arrowBody = + '(?:-+' + + arrowDirection + + '-+|\\.+' + + arrowDirection + + '\\.+|-+(?:' + + arrowAttr + + '-*)?|' + + arrowAttr + + '-+|\\.+(?:' + + arrowAttr + + '\\.*)?|' + + arrowAttr + + '\\.+)'; + var arrowLeft = /(?:<{1,2}|\/{1,2}|\\{1,2}|<\||[#*^+}xo])/.source; + var arrowRight = /(?:>{1,2}|\/{1,2}|\\{1,2}|\|>|[#*^+{xo])/.source; + var arrowPrefix = /[[?]?[ox]?/.source; + var arrowSuffix = /[ox]?[\]?]?/.source; + var arrow = + arrowPrefix + + '(?:' + + arrowBody + + arrowRight + + '|' + + arrowLeft + + arrowBody + + '(?:' + + arrowRight + + ')?' + + ')' + + arrowSuffix; + + Prism.languages['plant-uml'] = { + comment: { + pattern: /(^[ \t]*)(?:'.*|\/'[\s\S]*?'\/)/m, + lookbehind: true, + greedy: true, + }, + preprocessor: { + pattern: /(^[ \t]*)!.*/m, + lookbehind: true, + greedy: true, + alias: 'property', + inside: { + variable: variable, + }, + }, + delimiter: { + pattern: /(^[ \t]*)@(?:end|start)uml\b/m, + lookbehind: true, + greedy: true, + alias: 'punctuation', + }, + + arrow: { + pattern: RegExp( + /(^|[^-.<>?|\\[\]ox])/.source + arrow + /(?![-.<>?|\\\]ox])/.source + ), + lookbehind: true, + greedy: true, + alias: 'operator', + inside: { + expression: { + pattern: /(\[)[^[\]]+(?=\])/, + lookbehind: true, + inside: null, // see below + }, + punctuation: /\[(?=$|\])|^\]/, + }, + }, + + string: { + pattern: /"[^"]*"/, + greedy: true, + }, + text: { + pattern: /(\[[ \t]*[\r\n]+(?![\r\n]))[^\]]*(?=\])/, + lookbehind: true, + greedy: true, + alias: 'string', + }, + + keyword: [ + { + pattern: + /^([ \t]*)(?:abstract\s+class|end\s+(?:box|fork|group|merge|note|ref|split|title)|(?:fork|split)(?:\s+again)?|activate|actor|agent|alt|annotation|artifact|autoactivate|autonumber|backward|binary|boundary|box|break|caption|card|case|circle|class|clock|cloud|collections|component|concise|control|create|critical|database|deactivate|destroy|detach|diamond|else|elseif|end|end[hr]note|endif|endswitch|endwhile|entity|enum|file|folder|footer|frame|group|[hr]?note|header|hexagon|hide|if|interface|label|legend|loop|map|namespace|network|newpage|node|nwdiag|object|opt|package|page|par|participant|person|queue|rectangle|ref|remove|repeat|restore|return|robust|scale|set|show|skinparam|stack|start|state|stop|storage|switch|title|together|usecase|usecase\/|while)(?=\s|$)/m, + lookbehind: true, + greedy: true, + }, + /\b(?:elseif|equals|not|while)(?=\s*\()/, + /\b(?:as|is|then)\b/, + ], + + divider: { + pattern: /^==.+==$/m, + greedy: true, + alias: 'important', + }, + + time: { + pattern: /@(?:\d+(?:[:/]\d+){2}|[+-]?\d+|:[a-z]\w*(?:[+-]\d+)?)\b/i, + greedy: true, + alias: 'number', + }, + + color: { + pattern: /#(?:[a-z_]+|[a-fA-F0-9]+)\b/, + alias: 'symbol', + }, + variable: variable, + + punctuation: /[:,;()[\]{}]|\.{3}/, + }; + + Prism.languages['plant-uml'].arrow.inside.expression.inside = + Prism.languages['plant-uml']; + + Prism.languages['plantuml'] = Prism.languages['plant-uml']; +})(Prism); diff --git a/public/prism/prism-plant-uml.min.js b/public/prism/prism-plant-uml.min.js new file mode 100644 index 0000000..2e0cdf9 --- /dev/null +++ b/public/prism/prism-plant-uml.min.js @@ -0,0 +1,68 @@ +!(function (e) { + var t = /\$\w+|%[a-z]+%/; + (e.languages['plant-uml'] = { + comment: { + pattern: /(^[ \t]*)(?:'.*|\/'[\s\S]*?'\/)/m, + lookbehind: !0, + greedy: !0, + }, + preprocessor: { + pattern: /(^[ \t]*)!.*/m, + lookbehind: !0, + greedy: !0, + alias: 'property', + inside: { variable: t }, + }, + delimiter: { + pattern: /(^[ \t]*)@(?:end|start)uml\b/m, + lookbehind: !0, + greedy: !0, + alias: 'punctuation', + }, + arrow: { + pattern: RegExp( + '(^|[^-.<>?|\\\\[\\]ox])[[?]?[ox]?(?:(?:-+(?:[drlu]|do|down|le|left|ri|right|up)-+|\\.+(?:[drlu]|do|down|le|left|ri|right|up)\\.+|-+(?:\\[[^[\\]]*\\]-*)?|\\[[^[\\]]*\\]-+|\\.+(?:\\[[^[\\]]*\\]\\.*)?|\\[[^[\\]]*\\]\\.+)(?:>{1,2}|/{1,2}|\\\\{1,2}|\\|>|[#*^+{xo])|(?:<{1,2}|/{1,2}|\\\\{1,2}|<\\||[#*^+}xo])(?:-+(?:[drlu]|do|down|le|left|ri|right|up)-+|\\.+(?:[drlu]|do|down|le|left|ri|right|up)\\.+|-+(?:\\[[^[\\]]*\\]-*)?|\\[[^[\\]]*\\]-+|\\.+(?:\\[[^[\\]]*\\]\\.*)?|\\[[^[\\]]*\\]\\.+)(?:(?:>{1,2}|/{1,2}|\\\\{1,2}|\\|>|[#*^+{xo]))?)[ox]?[\\]?]?(?![-.<>?|\\\\\\]ox])' + ), + lookbehind: !0, + greedy: !0, + alias: 'operator', + inside: { + expression: { + pattern: /(\[)[^[\]]+(?=\])/, + lookbehind: !0, + inside: null, + }, + punctuation: /\[(?=$|\])|^\]/, + }, + }, + string: { pattern: /"[^"]*"/, greedy: !0 }, + text: { + pattern: /(\[[ \t]*[\r\n]+(?![\r\n]))[^\]]*(?=\])/, + lookbehind: !0, + greedy: !0, + alias: 'string', + }, + keyword: [ + { + pattern: + /^([ \t]*)(?:abstract\s+class|end\s+(?:box|fork|group|merge|note|ref|split|title)|(?:fork|split)(?:\s+again)?|activate|actor|agent|alt|annotation|artifact|autoactivate|autonumber|backward|binary|boundary|box|break|caption|card|case|circle|class|clock|cloud|collections|component|concise|control|create|critical|database|deactivate|destroy|detach|diamond|else|elseif|end|end[hr]note|endif|endswitch|endwhile|entity|enum|file|folder|footer|frame|group|[hr]?note|header|hexagon|hide|if|interface|label|legend|loop|map|namespace|network|newpage|node|nwdiag|object|opt|package|page|par|participant|person|queue|rectangle|ref|remove|repeat|restore|return|robust|scale|set|show|skinparam|stack|start|state|stop|storage|switch|title|together|usecase|usecase\/|while)(?=\s|$)/m, + lookbehind: !0, + greedy: !0, + }, + /\b(?:elseif|equals|not|while)(?=\s*\()/, + /\b(?:as|is|then)\b/, + ], + divider: { pattern: /^==.+==$/m, greedy: !0, alias: 'important' }, + time: { + pattern: /@(?:\d+(?:[:/]\d+){2}|[+-]?\d+|:[a-z]\w*(?:[+-]\d+)?)\b/i, + greedy: !0, + alias: 'number', + }, + color: { pattern: /#(?:[a-z_]+|[a-fA-F0-9]+)\b/, alias: 'symbol' }, + variable: t, + punctuation: /[:,;()[\]{}]|\.{3}/, + }), + (e.languages['plant-uml'].arrow.inside.expression.inside = + e.languages['plant-uml']), + (e.languages.plantuml = e.languages['plant-uml']); +})(Prism); diff --git a/public/prism/prism-powershell.min.js b/public/prism/prism-powershell.min.js index 386c3fb..318084b 100644 --- a/public/prism/prism-powershell.min.js +++ b/public/prism/prism-powershell.min.js @@ -1,5 +1,5 @@ !(function (e) { - var i = (Prism.languages.powershell = { + var i = (e.languages.powershell = { comment: [ { pattern: /(^|[^`])<#[\s\S]*?#>/, lookbehind: !0 }, { pattern: /(^|[^`])#.*/, lookbehind: !0 }, @@ -33,4 +33,4 @@ boolean: i.boolean, variable: i.variable, }; -})(); +})(Prism); diff --git a/public/prism/prism-properties.js b/public/prism/prism-properties.js index e8b3a65..5785bf5 100644 --- a/public/prism/prism-properties.js +++ b/public/prism/prism-properties.js @@ -1,10 +1,14 @@ Prism.languages.properties = { comment: /^[ \t]*[#!].*$/m, - 'attr-value': { + value: { pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m, lookbehind: true, + alias: 'attr-value', + }, + key: { + pattern: /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m, + alias: 'attr-name', }, - 'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m, punctuation: /[=:]/, }; diff --git a/public/prism/prism-properties.min.js b/public/prism/prism-properties.min.js index 96f80d6..60f207b 100644 --- a/public/prism/prism-properties.min.js +++ b/public/prism/prism-properties.min.js @@ -1,10 +1,14 @@ Prism.languages.properties = { comment: /^[ \t]*[#!].*$/m, - 'attr-value': { + value: { pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m, lookbehind: !0, + alias: 'attr-value', + }, + key: { + pattern: /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m, + alias: 'attr-name', }, - 'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m, punctuation: /[=:]/, }; diff --git a/public/prism/prism-pure.min.js b/public/prism/prism-pure.min.js index 80af3a5..015f3e1 100644 --- a/public/prism/prism-pure.min.js +++ b/public/prism/prism-pure.min.js @@ -1,5 +1,5 @@ -!(function (r) { - r.languages.pure = { +!(function (e) { + (e.languages.pure = { comment: [ { pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0 }, @@ -31,29 +31,29 @@ operator: /(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/, punctuation: /[(){}\[\];,|]/, - }; - ['c', { lang: 'c++', alias: 'cpp' }, 'fortran'].forEach(function (e) { - var t = e; - if ( - ('string' != typeof e && ((t = e.alias), (e = e.lang)), r.languages[t]) - ) { - var a = {}; - (a['inline-lang-' + t] = { - pattern: RegExp( - '%< *-\\*- *\\d* *-\\*-[^]+?%>'.replace( - '', - e.replace(/([.+*?\/\\(){}\[\]])/g, '\\$1') - ), - 'i' - ), - inside: r.util.clone(r.languages.pure['inline-lang'].inside), - }), - (a['inline-lang-' + t].inside.rest = r.util.clone(r.languages[t])), - r.languages.insertBefore('pure', 'inline-lang', a); - } }), - r.languages.c && - (r.languages.pure['inline-lang'].inside.rest = r.util.clone( - r.languages.c + ['c', { lang: 'c++', alias: 'cpp' }, 'fortran'].forEach(function (t) { + var a = t; + if ( + ('string' != typeof t && ((a = t.alias), (t = t.lang)), e.languages[a]) + ) { + var r = {}; + (r['inline-lang-' + a] = { + pattern: RegExp( + '%< *-\\*- *\\d* *-\\*-[^]+?%>'.replace( + '', + t.replace(/([.+*?\/\\(){}\[\]])/g, '\\$1') + ), + 'i' + ), + inside: e.util.clone(e.languages.pure['inline-lang'].inside), + }), + (r['inline-lang-' + a].inside.rest = e.util.clone(e.languages[a])), + e.languages.insertBefore('pure', 'inline-lang', r); + } + }), + e.languages.c && + (e.languages.pure['inline-lang'].inside.rest = e.util.clone( + e.languages.c )); })(Prism); diff --git a/public/prism/prism-purebasic.js b/public/prism/prism-purebasic.js index b877b7b..9faa760 100644 --- a/public/prism/prism-purebasic.js +++ b/public/prism/prism-purebasic.js @@ -9,15 +9,15 @@ slightly changed to pass all tests Prism.languages.purebasic = Prism.languages.extend('clike', { comment: /;.*/, keyword: - /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i, + /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|forever|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i, function: /\b\w+(?:\.\w+)?\s*(?=\()/, number: /(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i, operator: - /(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/, + /(?:@\*?|\?|\*)\w+\$?|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/, }); Prism.languages.insertBefore('purebasic', 'keyword', { - tag: /#\w+/, + tag: /#\w+\$?/, asm: { pattern: /(^[\t ]*)!.*/m, lookbehind: true, diff --git a/public/prism/prism-purebasic.min.js b/public/prism/prism-purebasic.min.js index 54f116d..501d08f 100644 --- a/public/prism/prism-purebasic.min.js +++ b/public/prism/prism-purebasic.min.js @@ -1,14 +1,14 @@ (Prism.languages.purebasic = Prism.languages.extend('clike', { comment: /;.*/, keyword: - /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i, + /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|forever|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i, function: /\b\w+(?:\.\w+)?\s*(?=\()/, number: /(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i, operator: - /(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/, + /(?:@\*?|\?|\*)\w+\$?|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/, })), Prism.languages.insertBefore('purebasic', 'keyword', { - tag: /#\w+/, + tag: /#\w+\$?/, asm: { pattern: /(^[\t ]*)!.*/m, lookbehind: !0, diff --git a/public/prism/prism-qsharp.min.js b/public/prism/prism-qsharp.min.js index c17fd61..8d66577 100644 --- a/public/prism/prism-qsharp.min.js +++ b/public/prism/prism-qsharp.min.js @@ -1,44 +1,40 @@ !(function (e) { - function a(e, r) { - return e.replace(/<<(\d+)>>/g, function (e, n) { - return '(?:' + r[+n] + ')'; + function n(e, n) { + return e.replace(/<<(\d+)>>/g, function (e, r) { + return '(?:' + n[+r] + ')'; }); } - function n(e, n, r) { - return RegExp(a(e, n), r || ''); + function r(e, r, a) { + return RegExp(n(e, r), a || ''); } - var r = RegExp( + var a = RegExp( '\\b(?:' + - ( - 'Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero' + - ' ' + - 'Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within' - ) + 'Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within' .trim() .replace(/ /g, '|') + ')\\b' ), - t = a('<<0>>(?:\\s*\\.\\s*<<0>>)*', ['\\b[A-Za-z_]\\w*\\b']), - i = { keyword: r, punctuation: /[<>()?,.:[\]]/ }, + t = n('<<0>>(?:\\s*\\.\\s*<<0>>)*', ['\\b[A-Za-z_]\\w*\\b']), + i = { keyword: a, punctuation: /[<>()?,.:[\]]/ }, s = '"(?:\\\\.|[^\\\\"])*"'; (e.languages.qsharp = e.languages.extend('clike', { comment: /\/\/.*/, string: [ - { pattern: n('(^|[^$\\\\])<<0>>', [s]), lookbehind: !0, greedy: !0 }, + { pattern: r('(^|[^$\\\\])<<0>>', [s]), lookbehind: !0, greedy: !0 }, ], 'class-name': [ { - pattern: n('(\\b(?:as|open)\\s+)<<0>>(?=\\s*(?:;|as\\b))', [t]), + pattern: r('(\\b(?:as|open)\\s+)<<0>>(?=\\s*(?:;|as\\b))', [t]), lookbehind: !0, inside: i, }, { - pattern: n('(\\bnamespace\\s+)<<0>>(?=\\s*\\{)', [t]), + pattern: r('(\\bnamespace\\s+)<<0>>(?=\\s*\\{)', [t]), lookbehind: !0, inside: i, }, ], - keyword: r, + keyword: a, number: /(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i, operator: @@ -49,19 +45,19 @@ range: { pattern: /\.\./, alias: 'operator' }, }); var o = (function (e, n) { - for (var r = 0; r < n; r++) + for (var r = 0; r < 2; r++) e = e.replace(/<>/g, function () { return '(?:' + e + ')'; }); return e.replace(/<>/g, '[^\\s\\S]'); - })(a('\\{(?:[^"{}]|<<0>>|<>)*\\}', [s]), 2); + })(n('\\{(?:[^"{}]|<<0>>|<>)*\\}', [s])); e.languages.insertBefore('qsharp', 'string', { 'interpolation-string': { - pattern: n('\\$"(?:\\\\.|<<0>>|[^\\\\"{])*"', [o]), + pattern: r('\\$"(?:\\\\.|<<0>>|[^\\\\"{])*"', [o]), greedy: !0, inside: { interpolation: { - pattern: n('((?:^|[^\\\\])(?:\\\\\\\\)*)<<0>>', [o]), + pattern: r('((?:^|[^\\\\])(?:\\\\\\\\)*)<<0>>', [o]), lookbehind: !0, inside: { punctuation: /^\{|\}$/, diff --git a/public/prism/prism-rescript.js b/public/prism/prism-rescript.js new file mode 100644 index 0000000..5980483 --- /dev/null +++ b/public/prism/prism-rescript.js @@ -0,0 +1,65 @@ +Prism.languages.rescript = { + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true, + }, + char: { pattern: /'(?:[^\r\n\\]|\\(?:.|\w+))'/, greedy: true }, + string: { + pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, + greedy: true, + }, + 'class-name': /\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/, + function: { + pattern: /[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/, + lookbehind: true, + }, + number: + /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, + boolean: /\b(?:false|true)\b/, + 'attr-value': /[A-Za-z]\w*(?==)/, + constant: { + pattern: /(\btype\s+)[a-z]\w*/, + lookbehind: true, + }, + tag: { + pattern: /(<)[a-z]\w*|(?:<\/)[a-z]\w*/, + lookbehind: true, + inside: { + operator: /<|>|\//, + }, + }, + keyword: + /\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/, + operator: + /\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/, + punctuation: /[(){}[\],;.]/, +}; + +Prism.languages.insertBefore('rescript', 'string', { + 'template-string': { + pattern: + /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: true, + inside: { + 'template-punctuation': { + pattern: /^`|`$/, + alias: 'string', + }, + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'tag', + }, + rest: Prism.languages.rescript, + }, + }, + string: /[\s\S]+/, + }, + }, +}); + +Prism.languages.res = Prism.languages.rescript; diff --git a/public/prism/prism-rescript.min.js b/public/prism/prism-rescript.min.js new file mode 100644 index 0000000..27bedf2 --- /dev/null +++ b/public/prism/prism-rescript.min.js @@ -0,0 +1,43 @@ +(Prism.languages.rescript = { + comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, + char: { pattern: /'(?:[^\r\n\\]|\\(?:.|\w+))'/, greedy: !0 }, + string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, greedy: !0 }, + 'class-name': /\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/, + function: { pattern: /[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/, lookbehind: !0 }, + number: + /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, + boolean: /\b(?:false|true)\b/, + 'attr-value': /[A-Za-z]\w*(?==)/, + constant: { pattern: /(\btype\s+)[a-z]\w*/, lookbehind: !0 }, + tag: { + pattern: /(<)[a-z]\w*|(?:<\/)[a-z]\w*/, + lookbehind: !0, + inside: { operator: /<|>|\// }, + }, + keyword: + /\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/, + operator: + /\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/, + punctuation: /[(){}[\],;.]/, +}), + Prism.languages.insertBefore('rescript', 'string', { + 'template-string': { + pattern: + /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: !0, + inside: { + 'template-punctuation': { pattern: /^`|`$/, alias: 'string' }, + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { pattern: /^\$\{|\}$/, alias: 'tag' }, + rest: Prism.languages.rescript, + }, + }, + string: /[\s\S]+/, + }, + }, + }), + (Prism.languages.res = Prism.languages.rescript); diff --git a/public/prism/prism-robotframework.min.js b/public/prism/prism-robotframework.min.js index 1674f1a..4dd46e7 100644 --- a/public/prism/prism-robotframework.min.js +++ b/public/prism/prism-robotframework.min.js @@ -1,23 +1,23 @@ !(function (t) { - var r = { pattern: /(^[ \t]*| {2}|\t)#.*/m, lookbehind: !0, greedy: !0 }, - o = { + var n = { pattern: /(^[ \t]*| {2}|\t)#.*/m, lookbehind: !0, greedy: !0 }, + e = { pattern: /((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/, lookbehind: !0, inside: { punctuation: /^[$@&%]\{|\}$/ }, }; - function n(t, n) { - var e = { + function a(t, a) { + var r = { 'section-header': { pattern: /^ ?\*{3}.+?\*{3}/, alias: 'keyword' }, }; - for (var a in n) e[a] = n[a]; + for (var o in a) r[o] = a[o]; return ( - (e.tag = { + (r.tag = { pattern: /([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/, lookbehind: !0, inside: { punctuation: /\[|\]/ }, }), - (e.variable = o), - (e.comment = r), + (r.variable = e), + (r.comment = n), { pattern: RegExp( '^ ?\\*{3}[ \t]*[ \t]*\\*{3}(?:.|[\r\n](?!\\*{3}))*'.replace( @@ -29,29 +29,29 @@ 'im' ), alias: 'section', - inside: e, + inside: r, } ); } - var e = { + var r = { pattern: /(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/, lookbehind: !0, alias: 'string', }, - a = { + o = { pattern: /([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/, lookbehind: !0, alias: 'function', - inside: { variable: o }, + inside: { variable: e }, }, i = { pattern: /([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/, lookbehind: !0, - inside: { variable: o }, + inside: { variable: e }, }; (t.languages.robotframework = { - settings: n('Settings', { + settings: a('Settings', { documentation: { pattern: /([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/, @@ -63,19 +63,19 @@ lookbehind: !0, }, }), - variables: n('Variables'), - 'test-cases': n('Test Cases', { - 'test-name': a, - documentation: e, + variables: a('Variables'), + 'test-cases': a('Test Cases', { + 'test-name': o, + documentation: r, property: i, }), - keywords: n('Keywords', { - 'keyword-name': a, - documentation: e, + keywords: a('Keywords', { + 'keyword-name': o, + documentation: r, property: i, }), - tasks: n('Tasks', { 'task-name': a, documentation: e, property: i }), - comment: r, + tasks: a('Tasks', { 'task-name': o, documentation: r, property: i }), + comment: n, }), (t.languages.robot = t.languages.robotframework); })(Prism); diff --git a/public/prism/prism-scala.js b/public/prism/prism-scala.js index 2cb037e..abb6b81 100644 --- a/public/prism/prism-scala.js +++ b/public/prism/prism-scala.js @@ -9,12 +9,46 @@ Prism.languages.scala = Prism.languages.extend('java', { greedy: true, }, keyword: - /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/, + /<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/, number: /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i, builtin: /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/, symbol: /'[^\d\s\\]\w*/, }); + +Prism.languages.insertBefore('scala', 'triple-quoted-string', { + 'string-interpolation': { + pattern: + /\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i, + greedy: true, + inside: { + id: { + pattern: /^\w+/, + greedy: true, + alias: 'function', + }, + escape: { + pattern: /\\\$"|\$[$"]/, + greedy: true, + alias: 'symbol', + }, + interpolation: { + pattern: /\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/, + greedy: true, + inside: { + punctuation: /^\$\{?|\}$/, + expression: { + pattern: /[\s\S]+/, + inside: Prism.languages.scala, + }, + }, + }, + string: /[\s\S]+/, + }, + }, +}); + delete Prism.languages.scala['class-name']; delete Prism.languages.scala['function']; +delete Prism.languages.scala['constant']; diff --git a/public/prism/prism-scala.min.js b/public/prism/prism-scala.min.js index 93a02ba..fcc44b9 100644 --- a/public/prism/prism-scala.min.js +++ b/public/prism/prism-scala.min.js @@ -6,12 +6,33 @@ }, string: { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, keyword: - /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/, + /<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/, number: /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i, builtin: /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/, symbol: /'[^\d\s\\]\w*/, })), + Prism.languages.insertBefore('scala', 'triple-quoted-string', { + 'string-interpolation': { + pattern: + /\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i, + greedy: !0, + inside: { + id: { pattern: /^\w+/, greedy: !0, alias: 'function' }, + escape: { pattern: /\\\$"|\$[$"]/, greedy: !0, alias: 'symbol' }, + interpolation: { + pattern: /\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/, + greedy: !0, + inside: { + punctuation: /^\$\{?|\}$/, + expression: { pattern: /[\s\S]+/, inside: Prism.languages.scala }, + }, + }, + string: /[\s\S]+/, + }, + }, + }), delete Prism.languages.scala['class-name'], - delete Prism.languages.scala.function; + delete Prism.languages.scala.function, + delete Prism.languages.scala.constant; diff --git a/public/prism/prism-scheme.min.js b/public/prism/prism-scheme.min.js index 2bdd0fc..a74a1e8 100644 --- a/public/prism/prism-scheme.min.js +++ b/public/prism/prism-scheme.min.js @@ -1,77 +1,82 @@ -Prism.languages.scheme = { - comment: - /;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/, - string: { pattern: /"(?:[^"\\]|\\.)*"/, greedy: !0 }, - symbol: { pattern: /'[^()\[\]#'\s]+/, greedy: !0 }, - char: { - pattern: - /#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/, - greedy: !0, - }, - 'lambda-parameter': [ - { +!(function (e) { + e.languages.scheme = { + comment: + /;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/, + string: { pattern: /"(?:[^"\\]|\\.)*"/, greedy: !0 }, + symbol: { pattern: /'[^()\[\]#'\s]+/, greedy: !0 }, + char: { pattern: - /((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/, + /#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/, + greedy: !0, + }, + 'lambda-parameter': [ + { + pattern: + /((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/, + lookbehind: !0, + }, + { + pattern: /((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/, + lookbehind: !0, + }, + ], + keyword: { + pattern: + /((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|except|export|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/, + lookbehind: !0, + }, + builtin: { + pattern: + /((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/, + lookbehind: !0, + }, + operator: { + pattern: /((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/, + lookbehind: !0, + }, + number: { + pattern: RegExp( + (function (e) { + for (var r in e) + e[r] = e[r].replace(/<[\w\s]+>/g, function (r) { + return '(?:' + e[r].trim() + ')'; + }); + return e[r]; + })({ + '': + '\\d+(?:/\\d+)|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[esfdl][+-]?\\d+)?', + '': '[+-]?|[+-](?:inf|nan)\\.0', + '': '[+-](?:|(?:inf|nan)\\.0)?i', + '': + '(?:@|)?|', + '': '(?:#d(?:#[ei])?|#[ei](?:#d)?)?', + '': '[0-9a-f]+(?:/[0-9a-f]+)?', + '': '[+-]?|[+-](?:inf|nan)\\.0', + '': '[+-](?:|(?:inf|nan)\\.0)?i', + '': + '(?:@|)?|', + '': '#[box](?:#[ei])?|(?:#[ei])?#[box]', + '': + '(^|[()\\[\\]\\s])(?:|)(?=[()\\[\\]\\s]|$)', + }), + 'i' + ), + lookbehind: !0, + }, + boolean: { + pattern: /(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/, + lookbehind: !0, + }, + function: { + pattern: + /((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/, + lookbehind: !0, + }, + identifier: { + pattern: /(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/, lookbehind: !0, + greedy: !0, }, - { pattern: /((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/, lookbehind: !0 }, - ], - keyword: { - pattern: - /((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|except|export|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/, - lookbehind: !0, - }, - builtin: { - pattern: - /((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/, - lookbehind: !0, - }, - operator: { - pattern: /((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/, - lookbehind: !0, - }, - number: { - pattern: RegExp( - (function (r) { - for (var e in r) - r[e] = r[e].replace(/<[\w\s]+>/g, function (e) { - return '(?:' + r[e].trim() + ')'; - }); - return r[e]; - })({ - '': - '\\d+(?:/\\d+)|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[esfdl][+-]?\\d+)?', - '': '[+-]?|[+-](?:inf|nan)\\.0', - '': '[+-](?:|(?:inf|nan)\\.0)?i', - '': - '(?:@|)?|', - '': '(?:#d(?:#[ei])?|#[ei](?:#d)?)?', - '': '[0-9a-f]+(?:/[0-9a-f]+)?', - '': '[+-]?|[+-](?:inf|nan)\\.0', - '': '[+-](?:|(?:inf|nan)\\.0)?i', - '': - '(?:@|)?|', - '': '#[box](?:#[ei])?|(?:#[ei])?#[box]', - '': - '(^|[()\\[\\]\\s])(?:|)(?=[()\\[\\]\\s]|$)', - }), - 'i' - ), - lookbehind: !0, - }, - boolean: { - pattern: /(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/, - lookbehind: !0, - }, - function: { - pattern: - /((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/, - lookbehind: !0, - }, - identifier: { - pattern: /(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/, - lookbehind: !0, - greedy: !0, - }, - punctuation: /[()\[\]']/, -}; + punctuation: /[()\[\]']/, + }; +})(Prism); diff --git a/public/prism/prism-smarty.min.js b/public/prism/prism-smarty.min.js index 8c85b65..3b877e1 100644 --- a/public/prism/prism-smarty.min.js +++ b/public/prism/prism-smarty.min.js @@ -1,5 +1,5 @@ -!(function (t) { - (t.languages.smarty = { +!(function (e) { + (e.languages.smarty = { comment: { pattern: /^\{\*[\s\S]*?\*\}/, greedy: !0 }, 'embedded-php': { pattern: /^\{php\}[\s\S]*?\{\/php\}/, @@ -9,7 +9,7 @@ php: { pattern: /[\s\S]+/, alias: 'language-php', - inside: t.languages.php, + inside: e.languages.php, }, }, }, @@ -59,36 +59,36 @@ /\b(?:and|eq|gt?e|gt|lt?e|lt|mod|neq?|not|or)\b/, ], }), - (t.languages.smarty['embedded-php'].inside.smarty.inside = - t.languages.smarty), - (t.languages.smarty.string[0].inside.interpolation.inside.expression.inside = - t.languages.smarty); - var e = /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/, - a = RegExp( + (e.languages.smarty['embedded-php'].inside.smarty.inside = + e.languages.smarty), + (e.languages.smarty.string[0].inside.interpolation.inside.expression.inside = + e.languages.smarty); + var n = /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/, + t = RegExp( '\\{\\*[^]*?\\*\\}|\\{php\\}[^]*?\\{/php\\}|' + '\\{(?:[^{}"\']||\\{(?:[^{}"\']||\\{(?:[^{}"\']|)*\\})*\\})*\\}'.replace( //g, function () { - return e.source; + return n.source; } ), 'g' ); - t.hooks.add('before-tokenize', function (e) { - var n = !1; - t.languages['markup-templating'].buildPlaceholders( - e, + e.hooks.add('before-tokenize', function (n) { + var a = !1; + e.languages['markup-templating'].buildPlaceholders( + n, 'smarty', - a, + t, function (e) { return ( - '{/literal}' === e && (n = !1), - !n && ('{literal}' === e && (n = !0), !0) + '{/literal}' === e && (a = !1), + !a && ('{literal}' === e && (a = !0), !0) ); } ); }), - t.hooks.add('after-tokenize', function (e) { - t.languages['markup-templating'].tokenizePlaceholders(e, 'smarty'); + e.hooks.add('after-tokenize', function (n) { + e.languages['markup-templating'].tokenizePlaceholders(n, 'smarty'); }); })(Prism); diff --git a/public/prism/prism-soy.min.js b/public/prism/prism-soy.min.js index 22f1d2a..1e66bc2 100644 --- a/public/prism/prism-soy.min.js +++ b/public/prism/prism-soy.min.js @@ -1,7 +1,7 @@ -!(function (t) { - var e = /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - a = /\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/; - (t.languages.soy = { +!(function (e) { + var a = /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + t = /\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/; + (e.languages.soy = { comment: [ /\/\*[\s\S]*?\*\//, { pattern: /(\s)\/\/.*/, lookbehind: !0, greedy: !0 }, @@ -31,33 +31,33 @@ variable: { pattern: /\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/, inside: { - string: { pattern: e, greedy: !0 }, - number: a, + string: { pattern: a, greedy: !0 }, + number: t, punctuation: /[\[\].?]/, }, }, - string: { pattern: e, greedy: !0 }, + string: { pattern: a, greedy: !0 }, function: [/\w+(?=\()/, { pattern: /(\|[^\S\r\n]*)\w+/, lookbehind: !0 }], boolean: /\b(?:false|true)\b/, - number: a, + number: t, operator: /\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/, punctuation: /[{}()\[\]|.,:]/, }), - t.hooks.add('before-tokenize', function (e) { - var a = !1; - t.languages['markup-templating'].buildPlaceholders( - e, + e.hooks.add('before-tokenize', function (a) { + var t = !1; + e.languages['markup-templating'].buildPlaceholders( + a, 'soy', /\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g, function (e) { return ( - '{/literal}' === e && (a = !1), - !a && ('{literal}' === e && (a = !0), !0) + '{/literal}' === e && (t = !1), + !t && ('{literal}' === e && (t = !0), !0) ); } ); }), - t.hooks.add('after-tokenize', function (e) { - t.languages['markup-templating'].tokenizePlaceholders(e, 'soy'); + e.hooks.add('after-tokenize', function (a) { + e.languages['markup-templating'].tokenizePlaceholders(a, 'soy'); }); })(Prism); diff --git a/public/prism/prism-stata.js b/public/prism/prism-stata.js new file mode 100644 index 0000000..3d9cf2a --- /dev/null +++ b/public/prism/prism-stata.js @@ -0,0 +1,78 @@ +// https://www.stata.com/manuals/u.pdf +// https://www.stata.com/manuals/p.pdf + +Prism.languages.stata = { + comment: [ + { + pattern: /(^[ \t]*)\*.*/m, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|\s)\/\/.*|\/\*[\s\S]*?\*\//, + lookbehind: true, + greedy: true, + }, + ], + 'string-literal': { + pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/, + greedy: true, + inside: { + interpolation: { + pattern: /\$\{[^{}]*\}|[‘`']\w[^’`'\r\n]*[’`']/, + inside: { + punctuation: /^\$\{|\}$/, + expression: { + pattern: /[\s\S]+/, + inside: null, // see below + }, + }, + }, + string: /[\s\S]+/, + }, + }, + + mata: { + pattern: /(^[ \t]*mata[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: true, + greedy: true, + alias: 'language-mata', + inside: Prism.languages.mata, + }, + java: { + pattern: /(^[ \t]*java[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: true, + greedy: true, + alias: 'language-java', + inside: Prism.languages.java, + }, + python: { + pattern: /(^[ \t]*python[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: true, + greedy: true, + alias: 'language-python', + inside: Prism.languages.python, + }, + + command: { + pattern: + /(^[ \t]*(?:\.[ \t]+)?(?:(?:bayes|bootstrap|by|bysort|capture|collect|fmm|fp|frame|jackknife|mfp|mi|nestreg|noisily|permute|quietly|rolling|simulate|statsby|stepwise|svy|version|xi)\b[^:\r\n]*:[ \t]*|(?:capture|noisily|quietly|version)[ \t]+)?)[a-zA-Z]\w*/m, + lookbehind: true, + greedy: true, + alias: 'keyword', + }, + variable: /\$\w+|[‘`']\w[^’`'\r\n]*[’`']/, + keyword: + /\b(?:bayes|bootstrap|by|bysort|capture|clear|collect|fmm|fp|frame|if|in|jackknife|mi[ \t]+estimate|mfp|nestreg|noisily|of|permute|quietly|rolling|simulate|sort|statsby|stepwise|svy|varlist|version|xi)\b/, + + boolean: /\b(?:off|on)\b/, + number: /\b\d+(?:\.\d+)?\b|\B\.\d+/, + function: /\b[a-z_]\w*(?=\()/i, + + operator: /\+\+|--|##?|[<>!=~]=?|[+\-*^&|/]/, + punctuation: /[(){}[\],:]/, +}; + +Prism.languages.stata[ + 'string-literal' +].inside.interpolation.inside.expression.inside = Prism.languages.stata; diff --git a/public/prism/prism-stata.min.js b/public/prism/prism-stata.min.js new file mode 100644 index 0000000..8854f92 --- /dev/null +++ b/public/prism/prism-stata.min.js @@ -0,0 +1,59 @@ +(Prism.languages.stata = { + comment: [ + { pattern: /(^[ \t]*)\*.*/m, lookbehind: !0, greedy: !0 }, + { pattern: /(^|\s)\/\/.*|\/\*[\s\S]*?\*\//, lookbehind: !0, greedy: !0 }, + ], + 'string-literal': { + pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/, + greedy: !0, + inside: { + interpolation: { + pattern: /\$\{[^{}]*\}|[‘`']\w[^’`'\r\n]*[’`']/, + inside: { + punctuation: /^\$\{|\}$/, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }, + string: /[\s\S]+/, + }, + }, + mata: { + pattern: /(^[ \t]*mata[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: !0, + greedy: !0, + alias: 'language-mata', + inside: Prism.languages.mata, + }, + java: { + pattern: /(^[ \t]*java[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: !0, + greedy: !0, + alias: 'language-java', + inside: Prism.languages.java, + }, + python: { + pattern: /(^[ \t]*python[ \t]*:)[\s\S]+?(?=^end\b)/m, + lookbehind: !0, + greedy: !0, + alias: 'language-python', + inside: Prism.languages.python, + }, + command: { + pattern: + /(^[ \t]*(?:\.[ \t]+)?(?:(?:bayes|bootstrap|by|bysort|capture|collect|fmm|fp|frame|jackknife|mfp|mi|nestreg|noisily|permute|quietly|rolling|simulate|statsby|stepwise|svy|version|xi)\b[^:\r\n]*:[ \t]*|(?:capture|noisily|quietly|version)[ \t]+)?)[a-zA-Z]\w*/m, + lookbehind: !0, + greedy: !0, + alias: 'keyword', + }, + variable: /\$\w+|[‘`']\w[^’`'\r\n]*[’`']/, + keyword: + /\b(?:bayes|bootstrap|by|bysort|capture|clear|collect|fmm|fp|frame|if|in|jackknife|mi[ \t]+estimate|mfp|nestreg|noisily|of|permute|quietly|rolling|simulate|sort|statsby|stepwise|svy|varlist|version|xi)\b/, + boolean: /\b(?:off|on)\b/, + number: /\b\d+(?:\.\d+)?\b|\B\.\d+/, + function: /\b[a-z_]\w*(?=\()/i, + operator: /\+\+|--|##?|[<>!=~]=?|[+\-*^&|/]/, + punctuation: /[(){}[\],:]/, +}), + (Prism.languages.stata[ + 'string-literal' + ].inside.interpolation.inside.expression.inside = Prism.languages.stata); diff --git a/public/prism/prism-supercollider.js b/public/prism/prism-supercollider.js new file mode 100644 index 0000000..b31d2ce --- /dev/null +++ b/public/prism/prism-supercollider.js @@ -0,0 +1,39 @@ +Prism.languages.supercollider = { + comment: { + pattern: + /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//, + greedy: true, + }, + string: { + pattern: /(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/, + lookbehind: true, + greedy: true, + }, + char: { + pattern: /\$(?:[^\\\r\n]|\\.)/, + greedy: true, + }, + symbol: { + pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/, + lookbehind: true, + greedy: true, + }, + + keyword: /\b(?:_|arg|classvar|const|nil|var|while)\b/, + boolean: /\b(?:false|true)\b/, + + label: { + pattern: /\b[a-z_]\w*(?=\s*:)/, + alias: 'property', + }, + + number: + /\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/, + 'class-name': /\b[A-Z]\w*\b/, + + operator: + /\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/, + punctuation: /[{}()[\].:,;]|#[[{]/, +}; + +Prism.languages.sclang = Prism.languages.supercollider; diff --git a/public/prism/prism-supercollider.min.js b/public/prism/prism-supercollider.min.js new file mode 100644 index 0000000..2c5d5a9 --- /dev/null +++ b/public/prism/prism-supercollider.min.js @@ -0,0 +1,28 @@ +(Prism.languages.supercollider = { + comment: { + pattern: + /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//, + greedy: !0, + }, + string: { + pattern: /(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/, + lookbehind: !0, + greedy: !0, + }, + char: { pattern: /\$(?:[^\\\r\n]|\\.)/, greedy: !0 }, + symbol: { + pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/, + lookbehind: !0, + greedy: !0, + }, + keyword: /\b(?:_|arg|classvar|const|nil|var|while)\b/, + boolean: /\b(?:false|true)\b/, + label: { pattern: /\b[a-z_]\w*(?=\s*:)/, alias: 'property' }, + number: + /\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/, + 'class-name': /\b[A-Z]\w*\b/, + operator: + /\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/, + punctuation: /[{}()[\].:,;]|#[[{]/, +}), + (Prism.languages.sclang = Prism.languages.supercollider); diff --git a/public/prism/prism-systemd.js b/public/prism/prism-systemd.js index c22232f..9862838 100644 --- a/public/prism/prism-systemd.js +++ b/public/prism/prism-systemd.js @@ -72,6 +72,6 @@ }, }, - operator: /=/, + punctuation: /=/, }; })(Prism); diff --git a/public/prism/prism-systemd.min.js b/public/prism/prism-systemd.min.js index e5b5e53..5ab7147 100644 --- a/public/prism/prism-systemd.min.js +++ b/public/prism/prism-systemd.min.js @@ -1,7 +1,7 @@ !(function (e) { var t = { pattern: /^[;#].*/m, greedy: !0 }, n = '"(?:[^\r\n"\\\\]|\\\\(?:[^\r]|\r\n?))*"(?!\\S)'; - Prism.languages.systemd = { + e.languages.systemd = { comment: t, section: { pattern: /^\[[^\n\r\[\]]*\](?=[ \t]*$)/m, @@ -30,6 +30,6 @@ boolean: { pattern: /^(?:false|no|off|on|true|yes)$/, greedy: !0 }, }, }, - operator: /=/, + punctuation: /=/, }; -})(); +})(Prism); diff --git a/public/prism/prism-t4-templating.min.js b/public/prism/prism-t4-templating.min.js index 4814fbb..3cc423c 100644 --- a/public/prism/prism-t4-templating.min.js +++ b/public/prism/prism-t4-templating.min.js @@ -1,5 +1,5 @@ -!(function (n) { - function i(e, t, a) { +!(function (e) { + function t(e, t, a) { return { pattern: RegExp('<#' + e + '[\\s\\S]*?#>'), alias: 'block', @@ -9,15 +9,15 @@ }, }; } - n.languages['t4-templating'] = Object.defineProperty({}, 'createT4', { - value: function (e) { - var t = n.languages[e], - a = 'language-' + e; + e.languages['t4-templating'] = Object.defineProperty({}, 'createT4', { + value: function (a) { + var n = e.languages[a], + i = 'language-' + a; return { block: { pattern: /<#[\s\S]+?#>/, inside: { - directive: i('@', { + directive: t('@', { 'attr-value': { pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/, inside: { punctuation: /^=|^["']|["']$/ }, @@ -25,9 +25,9 @@ keyword: /\b\w+(?=\s)/, 'attr-name': /\b\w+/, }), - expression: i('=', t, a), - 'class-feature': i('\\+', t, a), - standard: i('', t, a), + expression: t('=', n, i), + 'class-feature': t('\\+', n, i), + standard: t('', n, i), }, }, }; diff --git a/public/prism/prism-tt2.min.js b/public/prism/prism-tt2.min.js index 02a01f8..83b6a7f 100644 --- a/public/prism/prism-tt2.min.js +++ b/public/prism/prism-tt2.min.js @@ -1,18 +1,18 @@ -!(function (t) { - (t.languages.tt2 = t.languages.extend('clike', { +!(function (e) { + (e.languages.tt2 = e.languages.extend('clike', { comment: /#.*|\[%#[\s\S]*?%\]/, keyword: /\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|SWITCH|TAGS|THROW|TRY|UNLESS|USE|WHILE|WRAPPER)\b/, punctuation: /[[\]{},()]/, })), - t.languages.insertBefore('tt2', 'number', { + e.languages.insertBefore('tt2', 'number', { operator: /=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|not|or)\b/, variable: { pattern: /\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i }, }), - t.languages.insertBefore('tt2', 'keyword', { + e.languages.insertBefore('tt2', 'keyword', { delimiter: { pattern: /^(?:\[%|%%)-?|-?%\]$/, alias: 'punctuation' }, }), - t.languages.insertBefore('tt2', 'string', { + e.languages.insertBefore('tt2', 'string', { 'single-quoted-string': { pattern: /'[^\\']*(?:\\[\s\S][^\\']*)*'/, greedy: !0, @@ -27,15 +27,15 @@ }, }, }), - delete t.languages.tt2.string, - t.hooks.add('before-tokenize', function (e) { - t.languages['markup-templating'].buildPlaceholders( - e, + delete e.languages.tt2.string, + e.hooks.add('before-tokenize', function (t) { + e.languages['markup-templating'].buildPlaceholders( + t, 'tt2', /\[%[\s\S]+?%\]/g ); }), - t.hooks.add('after-tokenize', function (e) { - t.languages['markup-templating'].tokenizePlaceholders(e, 'tt2'); + e.hooks.add('after-tokenize', function (t) { + e.languages['markup-templating'].tokenizePlaceholders(t, 'tt2'); }); })(Prism); diff --git a/public/prism/prism-twig.min.js b/public/prism/prism-twig.min.js index 39bd3b4..f27b491 100644 --- a/public/prism/prism-twig.min.js +++ b/public/prism/prism-twig.min.js @@ -20,13 +20,12 @@ punctuation: /[()\[\]{}:.,]/, }), Prism.hooks.add('before-tokenize', function (e) { - if ('twig' === e.language) { + 'twig' === e.language && Prism.languages['markup-templating'].buildPlaceholders( e, 'twig', /\{(?:#[\s\S]*?#|%[\s\S]*?%|\{[\s\S]*?\})\}/g ); - } }), Prism.hooks.add('after-tokenize', function (e) { Prism.languages['markup-templating'].tokenizePlaceholders(e, 'twig'); diff --git a/public/prism/prism-uorazor.js b/public/prism/prism-uorazor.js new file mode 100644 index 0000000..64c7a56 --- /dev/null +++ b/public/prism/prism-uorazor.js @@ -0,0 +1,53 @@ +Prism.languages.uorazor = { + 'comment-hash': { + pattern: /#.*/, + alias: 'comment', + greedy: true, + }, + 'comment-slash': { + pattern: /\/\/.*/, + alias: 'comment', + greedy: true, + }, + string: { + pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + inside: { + punctuation: /^['"]|['"]$/, + }, + greedy: true, + }, + 'source-layers': { + pattern: + /\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i, + alias: 'function', + }, + 'source-commands': { + pattern: + /\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/, + alias: 'function', + }, + 'tag-name': { + pattern: /(^\{%-?\s*)\w+/, + lookbehind: true, + alias: 'keyword', + }, + delimiter: { + pattern: /^\{[{%]-?|-?[%}]\}$/, + alias: 'punctuation', + }, + function: + /\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/, + keyword: + /\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/, + boolean: /\b(?:false|null|true)\b/, + number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/, + operator: [ + { + pattern: + /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/, + lookbehind: true, + }, + /[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/, + ], + punctuation: /[()\[\]{}:.,]/, +}; diff --git a/public/prism/prism-uorazor.min.js b/public/prism/prism-uorazor.min.js new file mode 100644 index 0000000..e67f7ff --- /dev/null +++ b/public/prism/prism-uorazor.min.js @@ -0,0 +1,36 @@ +Prism.languages.uorazor = { + 'comment-hash': { pattern: /#.*/, alias: 'comment', greedy: !0 }, + 'comment-slash': { pattern: /\/\/.*/, alias: 'comment', greedy: !0 }, + string: { + pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + inside: { punctuation: /^['"]|['"]$/ }, + greedy: !0, + }, + 'source-layers': { + pattern: + /\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i, + alias: 'function', + }, + 'source-commands': { + pattern: + /\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/, + alias: 'function', + }, + 'tag-name': { pattern: /(^\{%-?\s*)\w+/, lookbehind: !0, alias: 'keyword' }, + delimiter: { pattern: /^\{[{%]-?|-?[%}]\}$/, alias: 'punctuation' }, + function: + /\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/, + keyword: + /\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/, + boolean: /\b(?:false|null|true)\b/, + number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/, + operator: [ + { + pattern: + /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/, + lookbehind: !0, + }, + /[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/, + ], + punctuation: /[()\[\]{}:.,]/, +}; diff --git a/public/prism/prism-vhdl.js b/public/prism/prism-vhdl.js index 3ec6bce..6ede816 100644 --- a/public/prism/prism-vhdl.js +++ b/public/prism/prism-vhdl.js @@ -11,10 +11,13 @@ Prism.languages.vhdl = { alias: 'function', }, string: /"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/, - constant: /\b(?:library|use)\b/i, + attribute: { + pattern: /\b'\w+/, + alias: 'attr-name', + }, // support for predefined attributes included keyword: - /\b(?:'active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i, + /\b(?:access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|private|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|view|wait|when|while|with)\b/i, boolean: /\b(?:false|true)\b/i, function: /\w+(?=\()/, // decimal, based, physical, and exponential numbers supported diff --git a/public/prism/prism-vhdl.min.js b/public/prism/prism-vhdl.min.js index 8adb6a3..feac1b8 100644 --- a/public/prism/prism-vhdl.min.js +++ b/public/prism/prism-vhdl.min.js @@ -6,9 +6,9 @@ Prism.languages.vhdl = { }, 'quoted-function': { pattern: /"\S+?"(?=\()/, alias: 'function' }, string: /"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/, - constant: /\b(?:library|use)\b/i, + attribute: { pattern: /\b'\w+/, alias: 'attr-name' }, keyword: - /\b(?:'active|'ascending|'base|'delayed|'driving|'driving_value|'event|'high|'image|'instance_name|'last_active|'last_event|'last_value|'left|'leftof|'length|'low|'path_name|'pos|'pred|'quiet|'range|'reverse_range|'right|'rightof|'simple_name|'stable|'succ|'transaction|'val|'value|access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with)\b/i, + /\b(?:access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|private|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|view|wait|when|while|with)\b/i, boolean: /\b(?:false|true)\b/i, function: /\w+(?=\()/, number: /'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i, diff --git a/public/prism/prism-wgsl.js b/public/prism/prism-wgsl.js new file mode 100644 index 0000000..b766501 --- /dev/null +++ b/public/prism/prism-wgsl.js @@ -0,0 +1,74 @@ +Prism.languages.wgsl = { + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true, + }, + 'builtin-attribute': { + pattern: /(@)builtin\(.*?\)/, + lookbehind: true, + inside: { + attribute: { + pattern: /^builtin/, + alias: 'attr-name', + }, + punctuation: /[(),]/, + 'built-in-values': { + pattern: + /\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/, + alias: 'attr-value', + }, + }, + }, + attributes: { + pattern: + /(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i, + lookbehind: true, + alias: 'attr-name', + }, + functions: { + pattern: /\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/, + lookbehind: true, + alias: 'function', + }, + keyword: + /\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/, + builtin: + /\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/, + 'function-calls': { + pattern: /\b[_a-z]\w*(?=\()/i, + alias: 'function', + }, + 'class-name': /\b(?:[A-Z][A-Za-z0-9]*)\b/, + 'bool-literal': { + pattern: /\b(?:false|true)\b/, + alias: 'boolean', + }, + 'hex-int-literal': { + pattern: /\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/, + alias: 'number', + }, + 'hex-float-literal': { + pattern: /\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/, + alias: 'number', + }, + 'decimal-float-literal': [ + { pattern: /\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+[eE](?:\+|-)?\d+[fh]?/, alias: 'number' }, + { pattern: /\b\d+[fh]\b/, alias: 'number' }, + ], + 'int-literal': { + pattern: /\b\d+[iu]?\b/, + alias: 'number', + }, + operator: [ + { pattern: /(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/ }, + { pattern: /&(?![&=])/ }, + { pattern: /(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/ }, + { pattern: /(^|[^<>=!])=(?![=>])/, lookbehind: true }, + { pattern: /(?:==|!=|<=|\+\+|--|(^|[^=])>=)/, lookbehind: true }, + { pattern: /(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/ }, + { pattern: /->/ }, + ], + punctuation: /[@(){}[\],;<>:.]/, +}; diff --git a/public/prism/prism-wgsl.min.js b/public/prism/prism-wgsl.min.js new file mode 100644 index 0000000..1ced010 --- /dev/null +++ b/public/prism/prism-wgsl.min.js @@ -0,0 +1,59 @@ +Prism.languages.wgsl = { + comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, + 'builtin-attribute': { + pattern: /(@)builtin\(.*?\)/, + lookbehind: !0, + inside: { + attribute: { pattern: /^builtin/, alias: 'attr-name' }, + punctuation: /[(),]/, + 'built-in-values': { + pattern: + /\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/, + alias: 'attr-value', + }, + }, + }, + attributes: { + pattern: + /(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i, + lookbehind: !0, + alias: 'attr-name', + }, + functions: { + pattern: /\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/, + lookbehind: !0, + alias: 'function', + }, + keyword: + /\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/, + builtin: + /\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/, + 'function-calls': { pattern: /\b[_a-z]\w*(?=\()/i, alias: 'function' }, + 'class-name': /\b(?:[A-Z][A-Za-z0-9]*)\b/, + 'bool-literal': { pattern: /\b(?:false|true)\b/, alias: 'boolean' }, + 'hex-int-literal': { + pattern: /\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/, + alias: 'number', + }, + 'hex-float-literal': { + pattern: /\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/, + alias: 'number', + }, + 'decimal-float-literal': [ + { pattern: /\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' }, + { pattern: /\d+[eE](?:\+|-)?\d+[fh]?/, alias: 'number' }, + { pattern: /\b\d+[fh]\b/, alias: 'number' }, + ], + 'int-literal': { pattern: /\b\d+[iu]?\b/, alias: 'number' }, + operator: [ + { pattern: /(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/ }, + { pattern: /&(?![&=])/ }, + { pattern: /(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/ }, + { pattern: /(^|[^<>=!])=(?![=>])/, lookbehind: !0 }, + { pattern: /(?:==|!=|<=|\+\+|--|(^|[^=])>=)/, lookbehind: !0 }, + { pattern: /(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/ }, + { pattern: /->/ }, + ], + punctuation: /[@(){}[\],;<>:.]/, +}; diff --git a/public/prism/prism-wolfram.js b/public/prism/prism-wolfram.js index 4b895fd..34892db 100644 --- a/public/prism/prism-wolfram.js +++ b/public/prism/prism-wolfram.js @@ -23,7 +23,7 @@ Prism.languages.wolfram = { number: /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i, operator: - /\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\^|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + /\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/, }; diff --git a/public/prism/prism-wolfram.min.js b/public/prism/prism-wolfram.min.js index fae8acc..56e0942 100644 --- a/public/prism/prism-wolfram.min.js +++ b/public/prism/prism-wolfram.min.js @@ -10,7 +10,7 @@ number: /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i, operator: - /\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\^|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + /\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/, }), (Prism.languages.mathematica = Prism.languages.wolfram), diff --git a/public/prism/prism-xml-doc.min.js b/public/prism/prism-xml-doc.min.js index f880c6e..b1fc70c 100644 --- a/public/prism/prism-xml-doc.min.js +++ b/public/prism/prism-xml-doc.min.js @@ -1,15 +1,15 @@ -!(function (n) { - function a(a, e) { - n.languages[a] && - n.languages.insertBefore(a, 'comment', { 'doc-comment': e }); +!(function (a) { + function e(e, n) { + a.languages[e] && + a.languages.insertBefore(e, 'comment', { 'doc-comment': n }); } - var e = n.languages.markup.tag, + var n = a.languages.markup.tag, t = { pattern: /\/\/\/.*/, greedy: !0, alias: 'comment', - inside: { tag: e }, + inside: { tag: n }, }, - g = { pattern: /'''.*/, greedy: !0, alias: 'comment', inside: { tag: e } }; - a('csharp', t), a('fsharp', t), a('vbnet', g); + g = { pattern: /'''.*/, greedy: !0, alias: 'comment', inside: { tag: n } }; + e('csharp', t), e('fsharp', t), e('vbnet', g); })(Prism); diff --git a/public/prism/prism-xquery.min.js b/public/prism/prism-xquery.min.js index bbc15e6..794bb95 100644 --- a/public/prism/prism-xquery.min.js +++ b/public/prism/prism-xquery.min.js @@ -1,5 +1,5 @@ -!(function (r) { - (r.languages.xquery = r.languages.extend('markup', { +!(function (e) { + (e.languages.xquery = e.languages.extend('markup', { 'xquery-comment': { pattern: /\(:[\s\S]*?:\)/, greedy: !0, @@ -48,76 +48,76 @@ ], punctuation: /[[\](){},;:/]/, })), - (r.languages.xquery.tag.pattern = + (e.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/), - (r.languages.xquery.tag.inside['attr-value'].pattern = + (e.languages.xquery.tag.inside['attr-value'].pattern = /=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/), - (r.languages.xquery.tag.inside['attr-value'].inside.punctuation = /^="|"$/), - (r.languages.xquery.tag.inside['attr-value'].inside.expression = { + (e.languages.xquery.tag.inside['attr-value'].inside.punctuation = /^="|"$/), + (e.languages.xquery.tag.inside['attr-value'].inside.expression = { pattern: /\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/, - inside: r.languages.xquery, + inside: e.languages.xquery, alias: 'language-xquery', }); - var s = function (e) { + var t = function (e) { return 'string' == typeof e ? e : 'string' == typeof e.content ? e.content - : e.content.map(s).join(''); + : e.content.map(t).join(''); }, - l = function (e) { - for (var t = [], n = 0; n < e.length; n++) { - var a = e[n], - o = !1; + n = function (a) { + for (var o = [], i = 0; i < a.length; i++) { + var r = a[i], + s = !1; if ( - ('string' != typeof a && - ('tag' === a.type && a.content[0] && 'tag' === a.content[0].type - ? '' === a.content[a.content.length - 1].content || - t.push({ - tagName: s(a.content[0].content[1]), + ('string' != typeof r && + ('tag' === r.type && r.content[0] && 'tag' === r.content[0].type + ? ' 0 && + o[o.length - 1].tagName === t(r.content[0].content[1]) && + o.pop() + : '/>' === r.content[r.content.length - 1].content || + o.push({ + tagName: t(r.content[0].content[1]), openedBraces: 0, }) : !( - 0 < t.length && - 'punctuation' === a.type && - '{' === a.content + o.length > 0 && + 'punctuation' === r.type && + '{' === r.content ) || - (e[n + 1] && - 'punctuation' === e[n + 1].type && - '{' === e[n + 1].content) || - (e[n - 1] && - 'plain-text' === e[n - 1].type && - '{' === e[n - 1].content) - ? 0 < t.length && - 0 < t[t.length - 1].openedBraces && - 'punctuation' === a.type && - '}' === a.content - ? t[t.length - 1].openedBraces-- - : 'comment' !== a.type && (o = !0) - : t[t.length - 1].openedBraces++), - (o || 'string' == typeof a) && - 0 < t.length && - 0 === t[t.length - 1].openedBraces) + (a[i + 1] && + 'punctuation' === a[i + 1].type && + '{' === a[i + 1].content) || + (a[i - 1] && + 'plain-text' === a[i - 1].type && + '{' === a[i - 1].content) + ? o.length > 0 && + o[o.length - 1].openedBraces > 0 && + 'punctuation' === r.type && + '}' === r.content + ? o[o.length - 1].openedBraces-- + : 'comment' !== r.type && (s = !0) + : o[o.length - 1].openedBraces++), + (s || 'string' == typeof r) && + o.length > 0 && + 0 === o[o.length - 1].openedBraces) ) { - var i = s(a); - n < e.length - 1 && - ('string' == typeof e[n + 1] || 'plain-text' === e[n + 1].type) && - ((i += s(e[n + 1])), e.splice(n + 1, 1)), - 0 < n && - ('string' == typeof e[n - 1] || 'plain-text' === e[n - 1].type) && - ((i = s(e[n - 1]) + i), e.splice(n - 1, 1), n--), - /^\s+$/.test(i) - ? (e[n] = i) - : (e[n] = new r.Token('plain-text', i, null, i)); + var l = t(r); + i < a.length - 1 && + ('string' == typeof a[i + 1] || 'plain-text' === a[i + 1].type) && + ((l += t(a[i + 1])), a.splice(i + 1, 1)), + i > 0 && + ('string' == typeof a[i - 1] || 'plain-text' === a[i - 1].type) && + ((l = t(a[i - 1]) + l), a.splice(i - 1, 1), i--), + /^\s+$/.test(l) + ? (a[i] = l) + : (a[i] = new e.Token('plain-text', l, null, l)); } - a.content && 'string' != typeof a.content && l(a.content); + r.content && 'string' != typeof r.content && n(r.content); } }; - r.hooks.add('after-tokenize', function (e) { - 'xquery' === e.language && l(e.tokens); + e.hooks.add('after-tokenize', function (e) { + 'xquery' === e.language && n(e.tokens); }); })(Prism); diff --git a/public/prism/prism-zig.min.js b/public/prism/prism-zig.min.js index 509b60b..740a44c 100644 --- a/public/prism/prism-zig.min.js +++ b/public/prism/prism-zig.min.js @@ -1,5 +1,5 @@ -!(function (n) { - function e(e) { +!(function (e) { + function n(e) { return function () { return e; }; @@ -12,15 +12,15 @@ '(?!\\s)(?:!?\\s*(?:' + '(?:\\?|\\bpromise->|(?:\\[[^[\\]]*\\]|\\*(?!\\*)|\\*\\*)(?:\\s*|\\s*const\\b|\\s*volatile\\b|\\s*allowzero\\b)*)'.replace( //g, - e(o) + n(o) ) + '\\s*)*' + '(?:\\bpromise\\b|(?:\\berror\\.)?(?:\\.)*(?!\\s+))'.replace( //g, - e(a) + n(a) ) + ')+'; - (n.languages.zig = { + (e.languages.zig = { comment: [{ pattern: /\/\/[/!].*/, alias: 'doc-comment' }, /\/{2}.*/], string: [ { @@ -51,8 +51,8 @@ { pattern: RegExp( '(:\\s*)(?=\\s*(?:\\s*)?[=;,)])|(?=\\s*(?:\\s*)?\\{)' - .replace(//g, e(s)) - .replace(//g, e(o)) + .replace(//g, n(s)) + .replace(//g, n(o)) ), lookbehind: !0, inside: null, @@ -60,8 +60,8 @@ { pattern: RegExp( '(\\)\\s*)(?=\\s*(?:\\s*)?;)' - .replace(//g, e(s)) - .replace(//g, e(o)) + .replace(//g, n(s)) + .replace(//g, n(o)) ), lookbehind: !0, inside: null, @@ -81,7 +81,7 @@ /\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/, punctuation: /[.:,;(){}[\]]/, }), - n.languages.zig['class-name'].forEach(function (e) { - null === e.inside && (e.inside = n.languages.zig); + e.languages.zig['class-name'].forEach(function (n) { + null === n.inside && (n.inside = e.languages.zig); }); })(Prism); diff --git a/src/components/atoms/figure/figure.module.scss b/src/components/atoms/figure/figure.module.scss index e7ba5c2..7722e59 100644 --- a/src/components/atoms/figure/figure.module.scss +++ b/src/components/atoms/figure/figure.module.scss @@ -7,15 +7,13 @@ border: fun.convert-px(1) solid var(--color-border-light); font-size: var(--font-size-sm); font-weight: 500; + text-align: center; } .wrapper { - display: flex; - flex-flow: column; width: fit-content; margin: 0 auto; position: relative; - text-align: center; &--has-borders { padding: fun.convert-px(4); diff --git a/src/components/molecules/code/code.module.scss b/src/components/molecules/code/code.module.scss new file mode 100644 index 0000000..b551040 --- /dev/null +++ b/src/components/molecules/code/code.module.scss @@ -0,0 +1,13 @@ +@use "../../../styles/abstracts/placeholders"; + +.wrapper { + width: 100%; + + :global { + @extend %prism; + } + + figcaption { + margin-top: calc(var(--spacing-sm) * -1); + } +} diff --git a/src/components/molecules/code/code.stories.tsx b/src/components/molecules/code/code.stories.tsx new file mode 100644 index 0000000..1127839 --- /dev/null +++ b/src/components/molecules/code/code.stories.tsx @@ -0,0 +1,192 @@ +import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import { Code } from './code'; + +/** + * Code - Storybook Meta + */ +export default { + title: 'Molecules/Code', + component: Code, + argTypes: { + children: { + control: { + type: 'text', + }, + description: 'The code sample.', + type: { + name: 'string', + required: true, + }, + }, + filterPattern: { + control: { + type: 'text', + }, + description: 'Define a pattern to filter the command line output.', + table: { + category: 'Options', + }, + type: { + name: 'string', + required: false, + }, + }, + language: { + control: { + type: 'text', + }, + description: 'The code sample language.', + type: { + name: 'string', + required: true, + }, + }, + plugins: { + description: 'An array of Prism plugins to activate.', + type: { + name: 'object', + required: false, + value: {}, + }, + }, + }, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ; + +const javascriptCodeSample = ` +const foo = () => { + return 'bar'; +} +`; + +/** + * Code Stories - Code sample + */ +export const CodeSample = Template.bind({}); +CodeSample.args = { + children: javascriptCodeSample, + language: 'javascript', +}; + +/** + * Code Stories - Highlighting + * + * @todo Find a way to make it working: line-highlight plugin is not loaded. + */ +export const Highlighting = Template.bind({}); +Highlighting.args = { + children: javascriptCodeSample, + highlight: '3', + language: 'javascript', +}; + +// cSpell:ignore xinitrc +const commandLineCode = ` +ls -lah +#output#drwxr-x---+ 42 armand armand 4,0K 17 april 11:15 . +#output#drwxr-xr-x 4 root root 4,0K 30 mai 2021 .. +#output#-rw-r--r-- 1 armand armand 2,0K 21 jul. 2021 .xinitrc +`; + +/** + * Code Stories - Command Line + */ +export const CommandLine = Template.bind({}); +CommandLine.args = { + children: commandLineCode, + cmdOutputFilter: '#output#', + isCmd: true, + language: 'bash', +}; + +// cSpell:ignore lcov +const treeSample = ` +. +├── bin +│ └── deploy.sh +├── CHANGELOG.md +├── commitlint.config.cjs +├── coverage +│ ├── clover.xml +│ ├── coverage-final.json +│ ├── lcov-report +│ └── lcov.info +├── cspell.json +├── cypress.config.js +├── docker-compose.yml +├── Dockerfile +├── jest.config.js +├── jest.setup.js +├── lang +│ ├── en.json +│ └── fr.json +├── LICENSE +├── lint-staged.config.js +├── mdx.d.ts +├── next-env.d.ts +├── next-sitemap.config.cjs +├── next.config.js +├── package.json +├── public +│ ├── apple-touch-icon.png +│ ├── armand-philippot.jpg +│ ├── favicon.ico +│ ├── icon-192.png +│ ├── icon-512.png +│ ├── icon.svg +│ ├── manifest.webmanifest +│ ├── prism +│ ├── projects +│ ├── robots.txt +│ ├── sitemap-0.xml +│ ├── sitemap.xml +│ └── vercel.svg +├── README.md +├── src +│ ├── assets +│ ├── components +│ ├── content +│ ├── i18n +│ ├── pages +│ ├── services +│ ├── styles +│ ├── types +│ └── utils +├── tests +│ ├── cypress +│ ├── jest +│ └── utils +├── tsconfig.eslint.json +├── tsconfig.json +├── tsconfig.tsbuildinfo +└── yarn.lock`; + +/** + * Code Stories - Tree view + * + * @todo Find a way to make it working: treeview plugin is not loaded. + */ +export const TreeView = Template.bind({}); +TreeView.args = { + children: treeSample, + language: 'treeview', +}; + +const diffSample = ` +--- file1.js 2023-10-13 19:17:05.540644084 +0200 ++++ file2.js 2023-10-13 19:17:15.310564281 +0200 +@@ -1,2 +1 @@ +-let foo = bar.baz([1, 2, 3]); +-foo = foo + 1; ++const foo = bar.baz([1, 2, 3]) + 1;`; + +/** + * Code Stories - Diff + */ +export const Diff = Template.bind({}); +Diff.args = { + children: diffSample, + isDiff: true, + language: 'diff', +}; diff --git a/src/components/molecules/code/code.test.tsx b/src/components/molecules/code/code.test.tsx new file mode 100644 index 0000000..5b946b3 --- /dev/null +++ b/src/components/molecules/code/code.test.tsx @@ -0,0 +1,14 @@ +import { describe, expect, it } from '@jest/globals'; +import { render, screen as rtlScreen } from '../../../../tests/utils'; +import { Code } from './code'; + +describe('Code', () => { + it('renders a code block', () => { + const language = 'javascript'; + const code = 'nam'; + + render({code}); + + expect(rtlScreen.getByText(code)).toBeInTheDocument(); + }); +}); diff --git a/src/components/molecules/code/code.tsx b/src/components/molecules/code/code.tsx new file mode 100644 index 0000000..0168fd6 --- /dev/null +++ b/src/components/molecules/code/code.tsx @@ -0,0 +1,183 @@ +import { forwardRef, type ForwardRefRenderFunction } from 'react'; +import { + usePrism, + type PrismLanguage, + type PrismAvailablePlugin, +} from '../../../utils/hooks'; +import { Figure, type FigureProps } from '../../atoms'; +import styles from './code.module.scss'; + +export type CodeProps = Omit & { + /** + * The code to highlight. + */ + children: string; + /** + * Define a pattern to automatically present some lines as continuation lines + * when using command line. + * + * @default undefined + */ + cmdContinuationFilter?: string; + /** + * Define the prompt to be displayed when the command has continued beyond + * the first line. Only used with command line. + * + * @default '>' + */ + cmdContinuationPrompt?: string; + /** + * Define the line continuation string or character when using command line. + */ + cmdContinuationStr?: string; + /** + * Define the host when using command line. + */ + cmdHost?: string; + /** + * Define a custom prompt when using command line. By default, `#` will be + * used for the root user and `$` for all other users. + */ + cmdPrompt?: string; + /** + * Define the line(s) that must be presented as output when using command + * line. + * + * @example '6' // a single line + * @example '2-7' // a range + * @example '3,9-11' // multiple lines with a range + * + * @default undefined + */ + cmdOutput?: string; + /** + * Define a pattern to automatically present some lines as output when using + * command line. + * + * @default undefined + */ + cmdOutputFilter?: string; + /** + * Specify the user when using command line. + */ + cmdUser?: string; + /** + * Define the line(s) that must be highlighted. + * + * DON'T USE: it seems the plugin is not correctly loaded. + * + * @example '6' // a single line + * @example '2-7' // a range + * @example '3,9-11' // multiple lines with a range + * + * @default undefined + */ + highlight?: string; + /** + * Should the code be treated as command lines? + * + * @default false + */ + isCmd?: boolean; + /** + * Should the code be treated as a diff block? + * + * @default false + */ + isDiff?: boolean; + /** + * The code language. + */ + language: PrismLanguage; + /** + * Define the starting line number. It will be ignored with command lines. + * + * @default undefined // Starts with 1. + */ + start?: string; +}; + +const CodeWithRef: ForwardRefRenderFunction = ( + { + children, + className = '', + cmdContinuationFilter, + cmdContinuationPrompt, + cmdContinuationStr, + cmdHost, + cmdOutput, + cmdOutputFilter, + cmdPrompt, + cmdUser, + highlight, + isCmd = false, + isDiff = false, + language, + start, + ...props + }, + ref +) => { + const wrapperClass = `${styles.wrapper} ${className}`; + const codeClass = isDiff + ? `language-diff-${language}` + : `language-${language}`; + const plugins: PrismAvailablePlugin[] = [ + 'toolbar', + 'autoloader', + 'show-language', + 'color-scheme', + 'copy-to-clipboard', + 'inline-color', + 'match-braces', + 'normalize-whitespace', + ]; + + if (isDiff || language === 'diff') plugins.push('diff-highlight'); + + if (language.endsWith('treeview')) plugins.push('treeview'); + else plugins.push(isCmd ? 'command-line' : 'line-numbers'); + + const { attributes: prismAttributes, className: prismClass } = usePrism({ + attributes: { + 'data-continuation-prompt': cmdContinuationPrompt, + 'data-continuation-str': cmdContinuationStr, + 'data-filter-continuation': cmdContinuationFilter, + 'data-filter-output': cmdOutputFilter, + 'data-host': cmdHost, + 'data-line': highlight, + 'data-output': cmdOutput, + 'data-prompt': cmdPrompt, + 'data-start': start, + 'data-toolbar-order': 'show-language,copy-to-clipboard,color-scheme', + 'data-user': cmdUser, + }, + language, + plugins, + }); + + return ( +
+
+        {children}
+      
+
+ ); +}; + +/** + * Code component + * + * Render a code block with syntax highlighting. + * + * @todo Find a way to load Prism plugins without Babel (Next uses SWC). It + * seems some plugins are not loaded correctly (`line-highlight` or `treeview` + * for example). + */ +export const Code = forwardRef(CodeWithRef); diff --git a/src/components/molecules/code/index.ts b/src/components/molecules/code/index.ts new file mode 100644 index 0000000..d18a4e0 --- /dev/null +++ b/src/components/molecules/code/index.ts @@ -0,0 +1 @@ +export * from './code'; diff --git a/src/components/molecules/index.ts b/src/components/molecules/index.ts index cb0b7eb..a1e2c7a 100644 --- a/src/components/molecules/index.ts +++ b/src/components/molecules/index.ts @@ -1,5 +1,6 @@ export * from './branding'; export * from './buttons'; +export * from './code'; export * from './collapsible'; export * from './forms'; export * from './images'; diff --git a/src/components/molecules/layout/code.module.scss b/src/components/molecules/layout/code.module.scss deleted file mode 100644 index 2eaf9a2..0000000 --- a/src/components/molecules/layout/code.module.scss +++ /dev/null @@ -1,305 +0,0 @@ -@use "../../../styles/abstracts/functions" as fun; -@use "../../../styles/abstracts/mixins" as mix; - -.wrapper { - :global { - .code-toolbar { - --toolbar-height: #{fun.convert-px(100)}; - - position: relative; - margin-top: calc(var(--toolbar-height) + var(--spacing-sm)); - - @include mix.media("screen") { - @include mix.dimensions("2xs") { - --toolbar-height: #{fun.convert-px(60)}; - } - } - - .toolbar { - display: flex; - flex-flow: row wrap; - justify-content: center; - width: 100%; - height: var(--toolbar-height); - position: absolute; - top: calc(var(--toolbar-height) * -1); - left: 0; - right: 0; - background: var(--color-bg-tertiary); - border: fun.convert-px(1) solid var(--color-border); - } - - .toolbar-item { - display: flex; - align-items: center; - margin: 0 var(--spacing-2xs); - } - - .toolbar-item:nth-child(1) { - flex: 0 0 100%; - justify-content: center; - margin: 0 auto 0 0; - padding: 0 var(--spacing-sm); - background: var(--color-bg-code); - border-bottom: fun.convert-px(1) solid var(--color-border); - color: var(--color-primary-darker); - font-size: var(--font-size-sm); - font-weight: 600; - - @include mix.media("screen") { - @include mix.dimensions("2xs") { - flex: 0 0 auto; - justify-content: left; - border-bottom: none; - border-right: fun.convert-px(1) solid var(--color-border); - } - } - } - } - - .copy-to-clipboard-button, - .prism-color-scheme-button { - display: block; - padding: fun.convert-px(3) var(--spacing-xs); - background: var(--color-bg); - border: 0.4ex solid var(--color-primary); - border-radius: fun.convert-px(30); - box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) - var(--color-shadow), - fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) - var(--color-shadow), - fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) - var(--color-shadow); - color: var(--color-primary); - font-size: var(--font-size-sm); - font-weight: 600; - transition: all 0.35s ease-in-out 0s; - - &:hover, - &:focus { - transform: translateX(#{fun.convert-px(-2)}) - translateY(#{fun.convert-px(-2)}); - box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) - var(--color-shadow-light), - fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) - fun.convert-px(-2) var(--color-shadow-light), - fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) - fun.convert-px(-4) var(--color-shadow-light), - fun.convert-px(4) fun.convert-px(7) fun.convert-px(8) - fun.convert-px(-3) var(--color-shadow-light); - } - - &:focus { - text-decoration: underline var(--color-primary) fun.convert-px(3); - } - - &:active { - text-decoration: none; - transform: translateY(#{fun.convert-px(2)}); - box-shadow: 0 0 0 0 var(--color-shadow); - } - } - - pre[class*="language-"] { - --gutter-size-with-spacing: calc(var(--gutter-size) + var(--spacing-xs)); - - position: relative; - overflow: auto; - background: var(--color-bg-secondary); - border: fun.convert-px(1) solid var(--color-border-light); - color: var(--color-fg); - hyphens: none; - tab-size: 4; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - - &.command-line { - --gutter-size: 19ch; - padding-left: var(--gutter-size-with-spacing); - } - - &.line-numbers { - --gutter-size: 6ch; - - counter-reset: lineNumber; - padding-left: var(--gutter-size-with-spacing); - } - - code { - display: block; - padding: var(--spacing-xs) 0; - position: relative; - } - - .line-numbers-rows, - .command-line-prompt { - display: block; - width: var(--gutter-size); - padding: var(--spacing-xs) 0; - position: absolute; - top: 0; - left: calc(var(--gutter-size-with-spacing) * -1); - background: var(--color-bg); - border-right: fun.convert-px(1) solid var(--color-border); - font-size: 100%; - letter-spacing: -1px; - text-align: right; - pointer-events: none; - user-select: none; - - > span { - &::before { - display: block; - padding-right: var(--spacing-xs); - color: var(--color-fg-light); - } - } - } - - .command-line-prompt { - > span { - &::before { - content: " "; - } - - &[data-user]::before { - content: "[" attr(data-user) "@" attr(data-host) "] $"; - } - - &[data-user="root"]::before { - content: "[" attr(data-user) "@" attr(data-host) "] #"; - } - - &[data-prompt]::before { - content: attr(data-prompt); - } - - &[data-continuation-prompt]::before { - content: attr(data-continuation-prompt); - } - } - } - - .line-numbers-rows { - > span { - counter-increment: lineNumber; - - &::before { - content: counter(lineNumber); - } - } - } - - .token { - &.comment, - &.doc-comment { - color: var(--color-fg-light); - } - - &.punctuation { - color: var(--color-fg); - } - - &.attr-name, - &.hexcode, - &.inserted, - &.string { - color: var(--color-token-green); - } - - &.class, - &.coord, - &.id, - &.function { - color: var(--color-token-purple); - } - - &.builtin, - &.builtin.class-name, - &.property-access, - &.regex, - &.scope { - color: var(--color-token-magenta); - } - - &.class-name, - &.constant, - &.global, - &.interpolation, - &.key, - &.package, - &.this, - &.title, - &.variable { - color: var(--color-token-blue); - } - - &.combinator, - &.keyword, - &.operator, - &.pseudo-class, - &.pseudo-element, - &.rule, - &.selector, - &.unit { - color: var(--color-token-orange); - } - - &.attr-value, - &.boolean, - &.number { - color: var(--color-token-yellow); - } - - &.delimiter, - &.doctype, - &.parameter, - &.parent, - &.property, - &.shebang, - &.tag { - color: var(--color-token-cyan); - } - - &.deleted { - color: var(--color-token-red); - } - - &.punctuation.brace-hover, - &.punctuation.brace-selected { - background: var(--color-bg); - outline: solid fun.convert-px(1) var(--color-primary-light); - } - } - - span.inline-color-wrapper { - background: url(fun.encode-svg( - '' - )); - - // Prevent repeating pattern to be seen. - background-position: center; - background-size: 110%; - - display: inline-block; - height: 1.1ch; - width: 1.1ch; - margin: 0 0.5ch 0 0; - border: fun.convert-px(1) solid var(--color-bg); - outline: fun.convert-px(1) solid var(--color-border-dark); - overflow: hidden; - } - - span.inline-color { - display: block; - - /* To prevent visual glitches again */ - height: 120%; - width: 120%; - } - } - } -} diff --git a/src/components/molecules/layout/code.stories.tsx b/src/components/molecules/layout/code.stories.tsx deleted file mode 100644 index d20cdbe..0000000 --- a/src/components/molecules/layout/code.stories.tsx +++ /dev/null @@ -1,121 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Code } from './code'; - -/** - * Code - Storybook Meta - */ -export default { - title: 'Molecules/Layout/Code', - component: Code, - args: { - filterOutput: false, - outputPattern: '#output#', - }, - argTypes: { - 'aria-label': { - control: { - type: 'text', - }, - description: 'An accessible name for the code sample.', - table: { - category: 'Accessibility', - }, - type: { - name: 'string', - required: false, - }, - }, - children: { - control: { - type: 'text', - }, - description: 'The code sample.', - type: { - name: 'string', - required: true, - }, - }, - filterOutput: { - control: { - type: 'boolean', - }, - description: 'Filter the command line output.', - table: { - category: 'Options', - defaultValue: { summary: false }, - }, - type: { - name: 'boolean', - required: false, - }, - }, - language: { - control: { - type: 'text', - }, - description: 'The code sample language.', - type: { - name: 'string', - required: true, - }, - }, - plugins: { - description: 'An array of Prism plugins to activate.', - type: { - name: 'object', - required: false, - value: {}, - }, - }, - outputPattern: { - control: { - type: 'text', - }, - description: 'The command line output pattern.', - table: { - category: 'Options', - defaultValue: { summary: '#output#' }, - }, - type: { - name: 'string', - required: false, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -const javascriptCodeSample = ` -const foo = () => { - return 'bar'; -} -`; - -/** - * Code Stories - Code sample - */ -export const CodeSample = Template.bind({}); -CodeSample.args = { - children: javascriptCodeSample, - language: 'javascript', - plugins: ['line-numbers'], -}; - -const commandLineCode = ` -ls -lah -#output#drwxr-x---+ 42 armand armand 4,0K 17 avril 11:15 . -#output#drwxr-xr-x 4 root root 4,0K 30 mai 2021 .. -#output#-rw-r--r-- 1 armand armand 2,0K 21 juil. 2021 .xinitrc -`; - -/** - * Code Stories - Command Line - */ -export const CommandLine = Template.bind({}); -CommandLine.args = { - children: commandLineCode, - filterOutput: true, - language: 'bash', - plugins: ['command-line'], -}; diff --git a/src/components/molecules/layout/code.test.tsx b/src/components/molecules/layout/code.test.tsx deleted file mode 100644 index a0e4143..0000000 --- a/src/components/molecules/layout/code.test.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { describe, expect, it } from '@jest/globals'; -import { render } from '../../../../tests/utils'; -import { Code } from './code'; - -const code = ` -function foo() { - return 'bar'; -} -`; - -const language = 'javascript'; - -describe('Code', () => { - it('renders a code block', () => { - render({code}); - }); -}); diff --git a/src/components/molecules/layout/code.tsx b/src/components/molecules/layout/code.tsx deleted file mode 100644 index a1aadd8..0000000 --- a/src/components/molecules/layout/code.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { FC, useRef } from 'react'; -import { - type OptionalPrismPlugin, - type PrismLanguage, - usePrism, -} from '../../../utils/hooks'; -import styles from './code.module.scss'; - -export type CodeProps = { - /** - * An accessible name. - */ - 'aria-label'?: string; - /** - * The code to highlight. - */ - children: string; - /** - * Filter command line output. Default: false. - */ - filterOutput?: boolean; - /** - * The code language. - */ - language: PrismLanguage; - /** - * The optional Prism plugins. - */ - plugins?: OptionalPrismPlugin[]; - /** - * Filter command line output using the given string. Default: #output# - */ - outputPattern?: string; -}; - -/** - * Code component - * - * Render a code block with syntax highlighting. - */ -export const Code: FC = ({ - children, - filterOutput = false, - language, - plugins = [], - outputPattern = '#output#', - ...props -}) => { - const wrapperRef = useRef(null); - const { attributes, className } = usePrism({ language, plugins }); - - const outputAttribute = filterOutput - ? { 'data-filter-output': outputPattern } - : {}; - - return ( -
-
-        {children}
-      
-
- ); -}; diff --git a/src/components/molecules/layout/index.ts b/src/components/molecules/layout/index.ts index 58d5442..80db10a 100644 --- a/src/components/molecules/layout/index.ts +++ b/src/components/molecules/layout/index.ts @@ -1,5 +1,4 @@ export * from './card'; -export * from './code'; export * from './columns'; export * from './page-footer'; export * from './page-header'; diff --git a/src/content b/src/content index 0a5267c..c6be8a1 160000 --- a/src/content +++ b/src/content @@ -1 +1 @@ -Subproject commit 0a5267ca7df1b6600741aa172ffdfe7b4f762d9a +Subproject commit c6be8a1c511e5848a0317f825a29d07d09c47318 diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index dea240f..d1e680c 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -33,7 +33,6 @@ import { } from '../../utils/helpers'; import { loadTranslation, type Messages } from '../../utils/helpers/server'; import { - type OptionalPrismPlugin, useArticle, useBreadcrumb, useComments, @@ -70,8 +69,23 @@ const ArticlePage: NextPageWithLayout = ({ }); const readingTime = useReadingTime(article?.meta.wordsCount ?? 0, true); const { website } = useSettings(); - const prismPlugins: OptionalPrismPlugin[] = ['command-line', 'line-numbers']; - const { attributes, className } = usePrism({ plugins: prismPlugins }); + const { attributes, className } = usePrism({ + attributes: { + 'data-toolbar-order': 'show-language,copy-to-clipboard,color-scheme', + }, + plugins: [ + 'toolbar', + 'autoloader', + 'show-language', + 'color-scheme', + 'copy-to-clipboard', + 'inline-color', + 'match-braces', + 'normalize-whitespace', + 'command-line', + 'line-numbers', + ], + }); const loadingArticle = intl.formatMessage({ defaultMessage: 'Loading the requested article...', description: 'ArticlePage: loading article message', @@ -231,10 +245,10 @@ const ArticlePage: NextPageWithLayout = ({ str.includes('command-line') || (!str.includes('command-line') && str.includes('language-bash')) ) { - return `class="${wpBlockClassName} ${commandLineClassName}${languageClassName}" tabindex="0" data-filter-output="#output#`; + return `class="${wpBlockClassName} ${commandLineClassName} ${languageClassName}" tabindex="0" data-filter-output="#output#`; } - return `class="${wpBlockClassName} ${lineNumbersClassName}${languageClassName}" tabindex="0`; + return `class="${wpBlockClassName} ${lineNumbersClassName} ${languageClassName}" tabindex="0`; }; const contentWithPrismClasses = content.replaceAll( @@ -265,9 +279,7 @@ const ArticlePage: NextPageWithLayout = ({ /> ), - }} + bodyAttributes={attributes as HTMLAttributes} bodyClassName={styles.body} breadcrumb={breadcrumbItems} breadcrumbSchema={breadcrumbSchema} diff --git a/src/styles/abstracts/_placeholders.scss b/src/styles/abstracts/_placeholders.scss index 04522d7..4070730 100644 --- a/src/styles/abstracts/_placeholders.scss +++ b/src/styles/abstracts/_placeholders.scss @@ -5,3 +5,4 @@ @forward "./placeholders/layout"; @forward "./placeholders/links"; @forward "./placeholders/lists"; +@forward "./placeholders/prism"; diff --git a/src/styles/abstracts/placeholders/_prism.scss b/src/styles/abstracts/placeholders/_prism.scss new file mode 100644 index 0000000..97f28b6 --- /dev/null +++ b/src/styles/abstracts/placeholders/_prism.scss @@ -0,0 +1,309 @@ +@use "../functions" as fun; +@use "../mixins" as mix; + +%prism { + .code-toolbar { + --toolbar-height: #{fun.convert-px(100)}; + + position: relative; + margin-top: calc(var(--toolbar-height) + var(--spacing-sm)); + + @include mix.media("screen") { + @include mix.dimensions("2xs") { + --toolbar-height: #{fun.convert-px(60)}; + } + } + + .toolbar { + display: flex; + flex-flow: row wrap; + justify-content: center; + width: 100%; + height: var(--toolbar-height); + position: absolute; + top: calc(var(--toolbar-height) * -1); + left: 0; + right: 0; + background: var(--color-bg-tertiary); + border: fun.convert-px(1) solid var(--color-border); + } + + .toolbar-item { + display: flex; + align-items: center; + margin: 0 var(--spacing-2xs); + } + + .toolbar-item:nth-child(1) { + flex: 0 0 100%; + justify-content: center; + margin: 0 auto 0 0; + padding: 0 var(--spacing-sm); + background: var(--color-bg-code); + border-bottom: fun.convert-px(1) solid var(--color-border); + color: var(--color-primary-darker); + font-size: var(--font-size-sm); + font-weight: 600; + + @include mix.media("screen") { + @include mix.dimensions("2xs") { + flex: 0 0 auto; + justify-content: left; + border-bottom: none; + border-right: fun.convert-px(1) solid var(--color-border); + } + } + } + } + + .copy-to-clipboard-button, + .prism-color-scheme-button { + display: block; + padding: fun.convert-px(3) var(--spacing-xs); + background: var(--color-bg); + border: 0.4ex solid var(--color-primary); + border-radius: fun.convert-px(30); + box-shadow: + fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) var(--color-shadow), + fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) + var(--color-shadow), + fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) + var(--color-shadow); + color: var(--color-primary); + font-size: var(--font-size-sm); + font-weight: 600; + transition: all 0.35s ease-in-out 0s; + + &:hover, + &:focus { + transform: translateX(#{fun.convert-px(-2)}) + translateY(#{fun.convert-px(-2)}); + box-shadow: + fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) + var(--color-shadow-light), + fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) + var(--color-shadow-light), + fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) + var(--color-shadow-light), + fun.convert-px(4) fun.convert-px(7) fun.convert-px(8) fun.convert-px(-3) + var(--color-shadow-light); + } + + &:focus { + text-decoration: underline var(--color-primary) fun.convert-px(3); + } + + &:active { + text-decoration: none; + transform: translateY(#{fun.convert-px(2)}); + box-shadow: 0 0 0 0 var(--color-shadow); + } + } + + pre[class*="language-"] { + --gutter-size-with-spacing: calc(var(--gutter-size) + var(--spacing-xs)); + + padding: 0; + position: relative; + overflow: auto; + background: var(--color-bg-secondary); + border: fun.convert-px(1) solid var(--color-border-light); + color: var(--color-fg); + hyphens: none; + tab-size: 4; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + + &.command-line { + --gutter-size: 19ch; + padding-left: var(--gutter-size-with-spacing); + } + + &.line-numbers { + --gutter-size: 6ch; + + counter-reset: linenumber; + padding-left: var(--gutter-size-with-spacing); + } + + code { + display: block; + padding: var(--spacing-xs) 0; + position: relative; + } + + .line-numbers-rows, + .command-line-prompt { + display: block; + width: var(--gutter-size); + padding: var(--spacing-xs) 0; + position: absolute; + top: 0; + left: calc(var(--gutter-size-with-spacing) * -1); + background: var(--color-bg); + border-right: fun.convert-px(1) solid var(--color-border); + font-size: 100%; + letter-spacing: -1px; + text-align: right; + pointer-events: none; + user-select: none; + + > span { + &::before { + display: block; + padding-right: var(--spacing-xs); + color: var(--color-fg-light); + } + } + } + + .command-line-prompt { + > span { + &::before { + content: " "; + } + + &[data-user]::before { + content: "[" attr(data-user) "@" attr(data-host) "] $"; + } + + &[data-user="root"]::before { + content: "[" attr(data-user) "@" attr(data-host) "] #"; + } + + &[data-prompt]::before { + content: attr(data-prompt); + } + + &[data-continuation-prompt]::before { + content: attr(data-continuation-prompt); + } + } + } + + .line-numbers-rows { + > span { + counter-increment: linenumber; + + &::before { + content: counter(linenumber); + } + } + } + + .token { + &.comment, + &.doc-comment { + color: var(--color-fg-light); + } + + &.punctuation { + color: var(--color-fg); + } + + &.attr-name, + &.hexcode, + &.inserted, + &.string { + color: var(--color-token-green); + } + + &.class, + &.coord, + &.id, + &.function { + color: var(--color-token-purple); + } + + &.builtin, + &.builtin.class-name, + &.property-access, + &.regex, + &.scope { + color: var(--color-token-magenta); + } + + &.class-name, + &.constant, + &.global, + &.interpolation, + &.key, + &.package, + &.this, + &.title, + &.variable { + color: var(--color-token-blue); + } + + &.combinator, + &.keyword, + &.operator, + &.pseudo-class, + &.pseudo-element, + &.rule, + &.selector, + &.unit { + color: var(--color-token-orange); + } + + &.attr-value, + &.boolean, + &.number { + color: var(--color-token-yellow); + } + + &.delimiter, + &.doctype, + &.parameter, + &.parent, + &.property, + &.shebang, + &.tag { + color: var(--color-token-cyan); + } + + &.deleted { + color: var(--color-token-red); + } + + &.punctuation.brace-hover, + &.punctuation.brace-selected { + background: var(--color-bg); + outline: solid fun.convert-px(1) var(--color-primary-light); + } + + &.output { + user-select: none; + } + } + + span.inline-color-wrapper { + background: url(fun.encode-svg( + '' + )); + + /* Prevent glitches where 1px from the repeating pattern could be seen. */ + background-position: center; + background-size: 110%; + + display: inline-block; + height: 1.1ch; + width: 1.1ch; + margin: 0 0.5ch 0 0; + border: fun.convert-px(1) solid var(--color-bg); + outline: fun.convert-px(1) solid var(--color-border-dark); + overflow: hidden; + } + + span.inline-color { + display: block; + + /* To prevent visual glitches again */ + height: 120%; + width: 120%; + } + } +} diff --git a/src/styles/pages/article.module.scss b/src/styles/pages/article.module.scss index d2e7822..5e7d520 100644 --- a/src/styles/pages/article.module.scss +++ b/src/styles/pages/article.module.scss @@ -5,7 +5,6 @@ @use "partials/article-links"; @use "partials/article-lists"; @use "partials/article-media"; -@use "partials/article-prism"; @use "partials/article-wp-blocks"; .btn { @@ -23,8 +22,8 @@ @include article-links.styles; @include article-lists.styles; @include article-media.styles; - @include article-prism.styles; @include article-wp-blocks.styles; + @extend %prism; } } diff --git a/src/styles/pages/partials/_article-prism.scss b/src/styles/pages/partials/_article-prism.scss deleted file mode 100644 index 7d23e38..0000000 --- a/src/styles/pages/partials/_article-prism.scss +++ /dev/null @@ -1,302 +0,0 @@ -@use "../../abstracts/functions" as fun; -@use "../../abstracts/mixins" as mix; - -@mixin styles { - .code-toolbar { - --toolbar-height: #{fun.convert-px(100)}; - - position: relative; - margin-top: calc(var(--toolbar-height) + var(--spacing-sm)); - - @include mix.media("screen") { - @include mix.dimensions("2xs") { - --toolbar-height: #{fun.convert-px(60)}; - } - } - - .toolbar { - display: flex; - flex-flow: row wrap; - justify-content: center; - width: 100%; - height: var(--toolbar-height); - position: absolute; - top: calc(var(--toolbar-height) * -1); - left: 0; - right: 0; - background: var(--color-bg-tertiary); - border: fun.convert-px(1) solid var(--color-border); - } - - .toolbar-item { - display: flex; - align-items: center; - margin: 0 var(--spacing-2xs); - } - - .toolbar-item:nth-child(1) { - flex: 0 0 100%; - justify-content: center; - margin: 0 auto 0 0; - padding: 0 var(--spacing-sm); - background: var(--color-bg-code); - border-bottom: fun.convert-px(1) solid var(--color-border); - color: var(--color-primary-darker); - font-size: var(--font-size-sm); - font-weight: 600; - - @include mix.media("screen") { - @include mix.dimensions("2xs") { - flex: 0 0 auto; - justify-content: left; - border-bottom: none; - border-right: fun.convert-px(1) solid var(--color-border); - } - } - } - } - - .copy-to-clipboard-button, - .prism-color-scheme-button { - display: block; - padding: fun.convert-px(3) var(--spacing-xs); - background: var(--color-bg); - border: 0.4ex solid var(--color-primary); - border-radius: fun.convert-px(30); - box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) - var(--color-shadow), - fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) - var(--color-shadow), - fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) - var(--color-shadow); - color: var(--color-primary); - font-size: var(--font-size-sm); - font-weight: 600; - transition: all 0.35s ease-in-out 0s; - - &:hover, - &:focus { - transform: translateX(#{fun.convert-px(-2)}) - translateY(#{fun.convert-px(-2)}); - box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) - var(--color-shadow-light), - fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) - var(--color-shadow-light), - fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) - var(--color-shadow-light), - fun.convert-px(4) fun.convert-px(7) fun.convert-px(8) fun.convert-px(-3) - var(--color-shadow-light); - } - - &:focus { - text-decoration: underline var(--color-primary) fun.convert-px(3); - } - - &:active { - text-decoration: none; - transform: translateY(#{fun.convert-px(2)}); - box-shadow: 0 0 0 0 var(--color-shadow); - } - } - - pre[class*="language-"] { - --gutter-size-with-spacing: calc(var(--gutter-size) + var(--spacing-xs)); - - padding: 0; - position: relative; - overflow: auto; - border: fun.convert-px(1) solid var(--color-border-light); - hyphens: none; - tab-size: 4; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - - &.command-line { - --gutter-size: 19ch; - padding-left: var(--gutter-size-with-spacing); - } - - &.line-numbers { - --gutter-size: 6ch; - - counter-reset: lineNumber; - padding-left: var(--gutter-size-with-spacing); - } - - code { - display: block; - padding: var(--spacing-xs) 0; - position: relative; - } - - .line-numbers-rows, - .command-line-prompt { - display: block; - width: var(--gutter-size); - padding: var(--spacing-xs) 0; - position: absolute; - top: 0; - left: calc(var(--gutter-size-with-spacing) * -1); - background: var(--color-bg); - border-right: fun.convert-px(1) solid var(--color-border); - font-size: 100%; - letter-spacing: -1px; - text-align: right; - pointer-events: none; - user-select: none; - - > span { - &::before { - display: block; - padding-right: var(--spacing-xs); - color: var(--color-fg-light); - } - } - } - - .command-line-prompt { - > span { - &::before { - content: " "; - } - - &[data-user]::before { - content: "[" attr(data-user) "@" attr(data-host) "] $"; - } - - &[data-user="root"]::before { - content: "[" attr(data-user) "@" attr(data-host) "] #"; - } - - &[data-prompt]::before { - content: attr(data-prompt); - } - - &[data-continuation-prompt]::before { - content: attr(data-continuation-prompt); - } - } - } - - .line-numbers-rows { - > span { - counter-increment: lineNumber; - - &::before { - content: counter(lineNumber); - } - } - } - - .token { - &.comment, - &.doc-comment { - color: var(--color-fg-light); - } - - &.punctuation { - color: var(--color-fg); - } - - &.attr-name, - &.hexcode, - &.inserted, - &.string { - color: var(--color-token-green); - } - - &.class, - &.coord, - &.id, - &.function { - color: var(--color-token-purple); - } - - &.builtin, - &.builtin.class-name, - &.property-access, - &.regex, - &.scope { - color: var(--color-token-magenta); - } - - &.class-name, - &.constant, - &.global, - &.interpolation, - &.key, - &.package, - &.this, - &.title, - &.variable { - color: var(--color-token-blue); - } - - &.combinator, - &.keyword, - &.operator, - &.pseudo-class, - &.pseudo-element, - &.rule, - &.selector, - &.unit { - color: var(--color-token-orange); - } - - &.attr-value, - &.boolean, - &.number { - color: var(--color-token-yellow); - } - - &.delimiter, - &.doctype, - &.parameter, - &.parent, - &.property, - &.shebang, - &.tag { - color: var(--color-token-cyan); - } - - &.deleted { - color: var(--color-token-red); - } - - &.punctuation.brace-hover, - &.punctuation.brace-selected { - background: var(--color-bg); - outline: solid fun.convert-px(1) var(--color-primary-light); - } - } - - span.inline-color-wrapper { - background: url(fun.encode-svg( - '' - )); - - /* Prevent glitches where 1px from the repeating pattern could be seen. */ - background-position: center; - background-size: 110%; - - display: inline-block; - height: 1.1ch; - width: 1.1ch; - margin: 0 0.5ch 0 0; - border: fun.convert-px(1) solid var(--color-bg); - outline: fun.convert-px(1) solid var(--color-border-dark); - overflow: hidden; - } - - span.inline-color { - display: block; - - /* To prevent visual glitches again */ - height: 120%; - width: 120%; - } - } -} diff --git a/src/utils/hooks/use-prism.tsx b/src/utils/hooks/use-prism.tsx deleted file mode 100644 index 429808f..0000000 --- a/src/utils/hooks/use-prism.tsx +++ /dev/null @@ -1,183 +0,0 @@ -import Prism from 'prismjs'; -import { useEffect, useMemo } from 'react'; -import { useIntl } from 'react-intl'; - -const PRISM_PLUGINS = [ - 'autoloader', - 'color-scheme', - 'command-line', - 'copy-to-clipboard', - 'diff-highlight', - 'inline-color', - 'line-highlight', - 'line-numbers', - 'match-braces', - 'normalize-whitespace', - 'show-language', - 'toolbar', -] as const; - -export type PrismPlugin = (typeof PRISM_PLUGINS)[number]; - -export type DefaultPrismPlugin = Extract< - PrismPlugin, - | 'autoloader' - | 'color-scheme' - | 'copy-to-clipboard' - | 'match-braces' - | 'normalize-whitespace' - | 'show-language' - | 'toolbar' ->; - -export type OptionalPrismPlugin = Exclude; - -export type PrismLanguage = - | 'apacheconf' - | 'bash' - | 'css' - | 'diff' - | 'docker' - | 'editorconfig' - | 'ejs' - | 'git' - | 'graphql' - | 'html' - | 'ignore' - | 'ini' - | 'javascript' - | 'jsdoc' - | 'json' - | 'jsx' - | 'makefile' - | 'markup' - | 'php' - | 'phpdoc' - | 'regex' - | 'scss' - | 'shell-session' - | 'smarty' - | 'tcl' - | 'toml' - | 'tsx' - | 'twig' - | 'yaml'; - -export type PrismAttributes = { - 'data-prismjs-copy': string; - 'data-prismjs-copy-success': string; - 'data-prismjs-copy-error': string; - 'data-prismjs-color-scheme-dark': string; - 'data-prismjs-color-scheme-light': string; -}; - -export type UsePrismProps = { - language?: PrismLanguage; - plugins: OptionalPrismPlugin[]; -}; - -export type UsePrismReturn = { - attributes: PrismAttributes; - className: string; -}; - -/** - * Import and configure all given Prism plugins. - * - * @param {PrismPlugin[]} plugins - The Prism plugins to activate. - */ -const loadPrismPlugins = async (plugins: PrismPlugin[]) => { - for (const plugin of plugins) { - try { - if (plugin === 'color-scheme') { - await import(`../plugins/prism-${plugin}`); - } else { - await import(`prismjs/plugins/${plugin}/prism-${plugin}.min.js`); - } - - if (plugin === 'autoloader') { - Prism.plugins.autoloader.languages_path = '/prism/'; - } - } catch (error) { - console.error('usePrism: an error occurred while loading Prism plugins.'); - console.error(error); - } - } -}; - -/** - * Use Prism and its plugins. - * - * @param {UsePrismProps} props - An object of options. - * @returns {UsePrismReturn} An object of data. - */ -export const usePrism = ({ - language, - plugins, -}: UsePrismProps): UsePrismReturn => { - /** - * The order matter. Toolbar must be loaded before some other plugins. - */ - const defaultPlugins: DefaultPrismPlugin[] = useMemo( - () => [ - 'toolbar', - 'autoloader', - 'show-language', - 'copy-to-clipboard', - 'color-scheme', - 'match-braces', - 'normalize-whitespace', - ], - [] - ); - - useEffect(() => { - loadPrismPlugins([...defaultPlugins, ...plugins]).then(() => { - Prism.highlightAll(); - }); - }, [defaultPlugins, plugins]); - - const defaultClassName = 'match-braces'; - const languageClassName = language ? `language-${language}` : ''; - const pluginsClassName = plugins.join(' '); - const className = `${defaultClassName} ${pluginsClassName} ${languageClassName}`; - - const intl = useIntl(); - const copyText = intl.formatMessage({ - defaultMessage: 'Copy', - description: 'usePrism: copy button text (not clicked)', - id: '6GySNl', - }); - const copiedText = intl.formatMessage({ - defaultMessage: 'Copied!', - description: 'usePrism: copy button text (clicked)', - id: 'nsw6Th', - }); - const errorText = intl.formatMessage({ - defaultMessage: 'Use Ctrl+c to copy', - description: 'usePrism: copy button error text', - id: 'lKhTGM', - }); - const darkTheme = intl.formatMessage({ - defaultMessage: 'Dark Theme 🌙', - description: 'usePrism: toggle dark theme button text', - id: 'QLisK6', - }); - const lightTheme = intl.formatMessage({ - defaultMessage: 'Light Theme 🌞', - description: 'usePrism: toggle light theme button text', - id: 'hHVgW3', - }); - const attributes = { - 'data-prismjs-copy': copyText, - 'data-prismjs-copy-success': copiedText, - 'data-prismjs-copy-error': errorText, - 'data-prismjs-color-scheme-dark': darkTheme, - 'data-prismjs-color-scheme-light': lightTheme, - }; - - return { - attributes, - className, - }; -}; diff --git a/src/utils/hooks/use-prism/index.ts b/src/utils/hooks/use-prism/index.ts new file mode 100644 index 0000000..751cde7 --- /dev/null +++ b/src/utils/hooks/use-prism/index.ts @@ -0,0 +1 @@ +export * from './use-prism'; diff --git a/src/utils/hooks/use-prism/use-prism.test.tsx b/src/utils/hooks/use-prism/use-prism.test.tsx new file mode 100644 index 0000000..f7e83a2 --- /dev/null +++ b/src/utils/hooks/use-prism/use-prism.test.tsx @@ -0,0 +1,91 @@ +import { describe, expect, it } from '@jest/globals'; +import { renderHook } from '@testing-library/react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import { type IntlConfig, IntlProvider } from 'react-intl'; +import { + type PrismLanguage, + usePrism, + type PrismAvailablePlugin, + type PrismAttributes, + type PrismToolbarAttributes, +} from './use-prism'; + +type WrapperProps = { + children: ReactElement; +}; + +const createWrapper = ( + Wrapper: typeof IntlProvider, + props: PropsWithChildren +) => + function CreatedWrapper({ children }: WrapperProps) { + return {children}; + }; + +const toolbarAttributes: PrismToolbarAttributes = { + 'data-prismjs-color-scheme-dark': 'Dark Theme 🌙', + 'data-prismjs-color-scheme-light': 'Light Theme 🌞', + 'data-prismjs-copy': 'Copy', + 'data-prismjs-copy-error': 'Use Ctrl+c to copy', + 'data-prismjs-copy-success': 'Copied!', +}; + +describe('usePrism', () => { + it('returns the className and the attributes', () => { + const { result } = renderHook(() => usePrism({}), { + wrapper: createWrapper(IntlProvider, { locale: 'en' }), + }); + + expect(result.current.className).toStrictEqual(''); + expect(result.current.attributes).toStrictEqual(toolbarAttributes); + }); + + it('can return a className based on the given language', () => { + const language: PrismLanguage = 'docker'; + const { result } = renderHook(() => usePrism({ language }), { + wrapper: createWrapper(IntlProvider, { locale: 'en' }), + }); + + expect(result.current.className).toStrictEqual(`language-${language}`); + }); + + it('can return a className based on the given plugins', () => { + const pluginWithClass: PrismAvailablePlugin = 'diff-highlight'; + const { result } = renderHook( + () => usePrism({ plugins: [pluginWithClass] }), + { + wrapper: createWrapper(IntlProvider, { locale: 'en' }), + } + ); + + expect(result.current.className).toMatch(pluginWithClass); + }); + + it('can return a className based on the given language and plugins', () => { + const language: PrismLanguage = 'javascript'; + const pluginWithClass: PrismAvailablePlugin = 'diff-highlight'; + const { result } = renderHook( + () => usePrism({ language, plugins: [pluginWithClass] }), + { + wrapper: createWrapper(IntlProvider, { locale: 'en' }), + } + ); + + expect(result.current.className).toMatch(`language-diff-${language}`); + expect(result.current.className).toMatch(pluginWithClass); + }); + + it('can return the default attributes with the given owns', () => { + const attributes: Partial = { + 'data-filter-output': '(out)', + }; + const { result } = renderHook(() => usePrism({ attributes }), { + wrapper: createWrapper(IntlProvider, { locale: 'en' }), + }); + + expect(result.current.attributes).toStrictEqual({ + ...toolbarAttributes, + ...attributes, + }); + }); +}); diff --git a/src/utils/hooks/use-prism/use-prism.ts b/src/utils/hooks/use-prism/use-prism.ts new file mode 100644 index 0000000..7f8330b --- /dev/null +++ b/src/utils/hooks/use-prism/use-prism.ts @@ -0,0 +1,217 @@ +import Prism from 'prismjs'; +import { useEffect } from 'react'; +import { useIntl } from 'react-intl'; + +export type PrismToolbarAttributes = { + 'data-prismjs-copy': string; + 'data-prismjs-copy-success': string; + 'data-prismjs-copy-error': string; + 'data-prismjs-color-scheme-dark': string; + 'data-prismjs-color-scheme-light': string; +}; + +export type PrismAttributes = PrismToolbarAttributes & { + 'data-continuation-prompt'?: string; + 'data-continuation-str'?: string; + 'data-filter-output'?: string; + 'data-filter-continuation'?: string; + 'data-host'?: string; + 'data-line'?: string; + 'data-prompt'?: string; + 'data-output'?: string; + 'data-start'?: string; + 'data-toolbar-order'?: string; + 'data-user'?: string; +}; + +export type PrismLanguage = + | 'apacheconf' + | 'bash' + | 'css' + | 'diff' + | 'docker' + | 'editorconfig' + | 'ejs' + | 'git' + | 'graphql' + | 'html' + | 'ignore' + | 'ini' + | 'javascript' + | 'jsdoc' + | 'json' + | 'jsx' + | 'makefile' + | 'markup' + | 'php' + | 'phpdoc' + | 'regex' + | 'scss' + | 'shell-session' + | 'smarty' + | 'tcl' + | 'toml' + | 'treeview' + | 'tsx' + | 'twig' + | 'yaml'; + +export type PrismAvailablePlugin = + | 'autoloader' + | 'color-scheme' + | 'command-line' + | 'copy-to-clipboard' + | 'diff-highlight' + | 'inline-color' + | 'line-highlight' + | 'line-numbers' + | 'match-braces' + | 'normalize-whitespace' + | 'show-language' + | 'toolbar' + | 'treeview'; + +type PrismPlugin = { + name: PrismAvailablePlugin; + hasClassName: boolean; +}; + +const prismPlugins: PrismPlugin[] = [ + { name: 'toolbar', hasClassName: false }, + { name: 'autoloader', hasClassName: false }, + { name: 'show-language', hasClassName: false }, + { name: 'color-scheme', hasClassName: false }, + { name: 'copy-to-clipboard', hasClassName: false }, + { name: 'command-line', hasClassName: true }, + { name: 'diff-highlight', hasClassName: true }, + { name: 'inline-color', hasClassName: false }, + { name: 'line-highlight', hasClassName: false }, + { name: 'line-numbers', hasClassName: true }, + { name: 'match-braces', hasClassName: true }, + { name: 'normalize-whitespace', hasClassName: false }, + { name: 'treeview', hasClassName: false }, +]; + +/** + * Reorder the given plugins. + * + * The toolbar plugin must be loaded before some other plugins, so we need to + * ensure it is at the beginning of the array. + * + * @param {PrismAvailablePlugin[]} plugins - An array of Prism plugins. + * @returns {PrismAvailablePlugin[]} The sorted plugins. + */ +const sortPlugins = ( + plugins: PrismAvailablePlugin[] +): PrismAvailablePlugin[] => { + if (!plugins.includes('toolbar')) return plugins; + + const remainingPlugins = plugins.filter((plugin) => plugin !== 'toolbar'); + + return ['toolbar', ...remainingPlugins]; +}; + +/** + * Import and configure all given Prism plugins. + * + * @param {PrismAvailablePlugin[]} plugins - The plugins to activate. + */ +const loadPrismPlugins = async (plugins: PrismAvailablePlugin[]) => { + if (!plugins.length) return; + + const orderedPlugins = sortPlugins(plugins); + + try { + const importPromises = orderedPlugins.map(async (plugin) => { + if (plugin === 'color-scheme') { + return import('../../plugins/prism-color-scheme.cjs'); + } + + return import(`prismjs/plugins/${plugin}/prism-${plugin}.min.js`); + }); + + await importPromises.reduce(async (currImport, nextImport) => + currImport.then(await nextImport) + ); + + if (orderedPlugins.includes('autoloader')) + // cSpell:ignore camelcase + // eslint-disable-next-line camelcase -- Case is coming from Prism + Prism.plugins.autoloader.languages_path = '/prism/'; + } catch (error) { + console.error('usePrism: an error occurred while loading Prism plugins.'); + console.error(error); + } +}; + +export type UsePrismProps = { + attributes?: Omit; + language?: PrismLanguage; + plugins?: PrismAvailablePlugin[]; +}; + +/** + * Use Prism and its plugins. + * + * @param {UsePrismProps} props - An object of options. + * @returns An object with attributes and className. + */ +export const usePrism = ({ attributes, language, plugins }: UsePrismProps) => { + const intl = useIntl(); + const pluginsToLoad = prismPlugins.filter( + (plugin) => plugins?.includes(plugin.name) + ); + + const pluginClasses = pluginsToLoad + .map((plugin) => { + if (plugin.hasClassName) return plugin.name; + return undefined; + }) + .filter((maybeStr): maybeStr is PrismAvailablePlugin => !!maybeStr); + + const diffClass = language ? `language-diff-${language}` : 'language-diff'; + const languageClass = plugins?.includes('diff-highlight') + ? diffClass + : `language-${language}`; + + const className = [language ? languageClass : '', ...pluginClasses].join(' '); + + const toolbarAttributes: PrismToolbarAttributes = { + 'data-prismjs-color-scheme-dark': intl.formatMessage({ + defaultMessage: 'Dark Theme 🌙', + description: 'usePrism: toggle dark theme button text', + id: 'QLisK6', + }), + 'data-prismjs-color-scheme-light': intl.formatMessage({ + defaultMessage: 'Light Theme 🌞', + description: 'usePrism: toggle light theme button text', + id: 'hHVgW3', + }), + 'data-prismjs-copy': intl.formatMessage({ + defaultMessage: 'Copy', + description: 'usePrism: copy button text (not clicked)', + id: '6GySNl', + }), + 'data-prismjs-copy-error': intl.formatMessage({ + defaultMessage: 'Use Ctrl+c to copy', + description: 'usePrism: copy button error text', + id: 'lKhTGM', + }), + 'data-prismjs-copy-success': intl.formatMessage({ + defaultMessage: 'Copied!', + description: 'usePrism: copy button text (clicked)', + id: 'nsw6Th', + }), + }; + + useEffect(() => { + loadPrismPlugins(pluginsToLoad.map((plugin) => plugin.name)).then(() => { + Prism.highlightAll(); + }); + }, [pluginsToLoad]); + + return { + attributes: { ...toolbarAttributes, ...attributes }, + className, + }; +}; diff --git a/src/utils/plugins/prism-color-scheme.cjs b/src/utils/plugins/prism-color-scheme.cjs new file mode 100644 index 0000000..2632dd3 --- /dev/null +++ b/src/utils/plugins/prism-color-scheme.cjs @@ -0,0 +1,246 @@ +(function () { + if (typeof Prism === 'undefined' || typeof document === 'undefined') { + return; + } + + if (!Prism.plugins.toolbar) { + console.warn('Color scheme plugin loaded before Toolbar plugin.'); + + return; + } + + /** + * + * @typedef {"dark" | "light" | "system"} Theme + * @typedef {Record<"current", Theme> & Record<"dark" | "light", string>} Settings + */ + + var storage = { + /** + * Get a deserialized value from local storage. + * + * @param {string} key - The local storage key. + * @returns {string | undefined} The value of the given key. + */ + get: function (key) { + var serializedItem = localStorage.getItem(key); + return serializedItem ? JSON.parse(serializedItem) : undefined; + }, + /** + * Set or update a local storage key with a new serialized value. + * + * @param {string} key - The local storage key. + * @param {string} value - The value of the given key. + */ + set: function (key, value) { + var serializedValue = JSON.stringify(value); + localStorage.setItem(key, serializedValue); + }, + }; + + /** + * Check if user has set its color scheme preference. + * + * @returns {boolean} True if user prefers dark color scheme. + */ + function prefersDarkScheme() { + return ( + window.matchMedia && + window.matchMedia('(prefers-color-scheme: dark)').matches + ); + } + + /** + * Get the theme that matches the system theme. + * + * @returns {Theme} The theme to use. + */ + function getThemeFromSystem() { + return prefersDarkScheme() ? 'dark' : 'light'; + } + + /** + * Check if the provided string is a valid theme. + * + * @param {string} theme - A theme to check. + * @returns {boolean} True if it is a valid theme. + */ + function isValidTheme(theme) { + return theme === 'dark' || theme === 'light' || theme === 'system'; + } + + /** + * Set the default theme depending on user preferences. + * + * @returns {Theme} The default theme. + */ + function setDefaultTheme() { + var theme = storage.get('prismjs-color-scheme'); + + return theme && isValidTheme(theme) ? theme : 'system'; + } + + /** + * Traverses up the DOM tree to find data attributes that override the + * default plugin settings. + * + * @param {Element} startElement - An element to start from. + * @returns {Settings} The plugin settings. + */ + function getSettings(startElement) { + /** @type Settings */ + var settings = { + current: setDefaultTheme(), + dark: 'Toggle Dark Theme', + light: 'Toggle Light Theme', + }; + var prefix = 'data-prismjs-color-scheme-'; + + for (var key in settings) { + var attr = prefix + key; + var element = startElement; + + while (element && !element.hasAttribute(attr)) { + element = element.parentElement; + } + + if (element) { + settings[key] = element.getAttribute(attr); + } + } + + return settings; + } + + /** + * Retrieve the new theme depending on current theme value. + * + * @param {Theme} currentTheme - The current theme. + * @returns {Theme} The new theme. + */ + function getNewTheme(currentTheme) { + switch (currentTheme) { + case 'light': + return 'dark'; + case 'dark': + return 'light'; + case 'system': + default: + return getNewTheme(getThemeFromSystem()); + } + } + + /** + * Get the button content depending on current theme. + * + * @param {Theme} theme - The current theme. + * @param {Settings} settings - The plugin settings. + * @returns {string} The button text. + */ + function getButtonContent(theme, settings) { + return theme === 'dark' ? settings['light'] : settings['dark']; + } + + /** + * Update the button text depending on the current theme. + * + * @param {HTMLButtonElement} button - The color scheme button. + * @param {Settings} settings - The plugin settings. + */ + function updateButtonText(button, settings) { + var theme = + settings['current'] === 'system' + ? getThemeFromSystem() + : settings['current']; + + button.textContent = getButtonContent(theme, settings); + } + + /** + * Update pre data-prismjs-color-scheme attribute. + * + * @param {HTMLPreElement} pre - The pre element wrapping the code. + * @param {Theme} theme - The current theme. + */ + function updatePreAttribute(pre, theme) { + pre.setAttribute('data-prismjs-color-scheme-current', theme); + } + + /** + * Update pre attribute for all code blocks. + * + * @param {Theme} theme - The new theme. + */ + function switchTheme(theme) { + var allPre = document.querySelectorAll( + 'pre[data-prismjs-color-scheme-current]' + ); + allPre.forEach((pre) => { + updatePreAttribute(pre, theme); + }); + } + + /** + * Set current theme on pre attribute change. + * + * @param {HTMLPreElement} pre - The pre element wrapping the code. + * @param {Settings} settings - The plugin settings. + */ + function listenAttributeChange(pre, settings) { + var observer = new MutationObserver(function (mutations) { + mutations.forEach((record) => { + var mutatedPre = record.target; + var button = mutatedPre.parentElement.querySelector( + '.prism-color-scheme-button' + ); + var newTheme = mutatedPre.getAttribute( + 'data-prismjs-color-scheme-current' + ); + settings['current'] = newTheme; + updateButtonText(button, settings); + }); + }); + observer.observe(pre, { + attributes: true, + attributeFilter: ['data-prismjs-color-scheme-current'], + }); + } + + /** + * Create a color scheme button. + * + * @param {Object} env - The environment variables of the hook. + * @returns {HTMLButtonElement} The color scheme button. + */ + function getColorSchemeButton(env) { + var element = env.element; + var pre = element.parentElement; + var settings = getSettings(element); + var themeButton = document.createElement('button'); + themeButton.className = 'prism-color-scheme-button'; + themeButton.setAttribute('type', 'button'); + updateButtonText(themeButton, settings); + updatePreAttribute(pre, settings['current']); + listenAttributeChange(pre, settings); + + themeButton.addEventListener('click', () => { + var newTheme = getNewTheme(settings['current']); + switchTheme(newTheme); + storage.set('prismjs-color-scheme', newTheme); + }); + + window.addEventListener('storage', (e) => { + if (e.key === 'prismjs-color-scheme') { + var newTheme = JSON.parse(e.newValue); + if (isValidTheme(newTheme)) updatePreAttribute(pre, newTheme); + } + }); + + return themeButton; + } + + /** + * Register a new button in Prism toolbar plugin. + */ + Prism.plugins.toolbar.registerButton('color-scheme', getColorSchemeButton); +})(); diff --git a/src/utils/plugins/prism-color-scheme.js b/src/utils/plugins/prism-color-scheme.js deleted file mode 100644 index 2632dd3..0000000 --- a/src/utils/plugins/prism-color-scheme.js +++ /dev/null @@ -1,246 +0,0 @@ -(function () { - if (typeof Prism === 'undefined' || typeof document === 'undefined') { - return; - } - - if (!Prism.plugins.toolbar) { - console.warn('Color scheme plugin loaded before Toolbar plugin.'); - - return; - } - - /** - * - * @typedef {"dark" | "light" | "system"} Theme - * @typedef {Record<"current", Theme> & Record<"dark" | "light", string>} Settings - */ - - var storage = { - /** - * Get a deserialized value from local storage. - * - * @param {string} key - The local storage key. - * @returns {string | undefined} The value of the given key. - */ - get: function (key) { - var serializedItem = localStorage.getItem(key); - return serializedItem ? JSON.parse(serializedItem) : undefined; - }, - /** - * Set or update a local storage key with a new serialized value. - * - * @param {string} key - The local storage key. - * @param {string} value - The value of the given key. - */ - set: function (key, value) { - var serializedValue = JSON.stringify(value); - localStorage.setItem(key, serializedValue); - }, - }; - - /** - * Check if user has set its color scheme preference. - * - * @returns {boolean} True if user prefers dark color scheme. - */ - function prefersDarkScheme() { - return ( - window.matchMedia && - window.matchMedia('(prefers-color-scheme: dark)').matches - ); - } - - /** - * Get the theme that matches the system theme. - * - * @returns {Theme} The theme to use. - */ - function getThemeFromSystem() { - return prefersDarkScheme() ? 'dark' : 'light'; - } - - /** - * Check if the provided string is a valid theme. - * - * @param {string} theme - A theme to check. - * @returns {boolean} True if it is a valid theme. - */ - function isValidTheme(theme) { - return theme === 'dark' || theme === 'light' || theme === 'system'; - } - - /** - * Set the default theme depending on user preferences. - * - * @returns {Theme} The default theme. - */ - function setDefaultTheme() { - var theme = storage.get('prismjs-color-scheme'); - - return theme && isValidTheme(theme) ? theme : 'system'; - } - - /** - * Traverses up the DOM tree to find data attributes that override the - * default plugin settings. - * - * @param {Element} startElement - An element to start from. - * @returns {Settings} The plugin settings. - */ - function getSettings(startElement) { - /** @type Settings */ - var settings = { - current: setDefaultTheme(), - dark: 'Toggle Dark Theme', - light: 'Toggle Light Theme', - }; - var prefix = 'data-prismjs-color-scheme-'; - - for (var key in settings) { - var attr = prefix + key; - var element = startElement; - - while (element && !element.hasAttribute(attr)) { - element = element.parentElement; - } - - if (element) { - settings[key] = element.getAttribute(attr); - } - } - - return settings; - } - - /** - * Retrieve the new theme depending on current theme value. - * - * @param {Theme} currentTheme - The current theme. - * @returns {Theme} The new theme. - */ - function getNewTheme(currentTheme) { - switch (currentTheme) { - case 'light': - return 'dark'; - case 'dark': - return 'light'; - case 'system': - default: - return getNewTheme(getThemeFromSystem()); - } - } - - /** - * Get the button content depending on current theme. - * - * @param {Theme} theme - The current theme. - * @param {Settings} settings - The plugin settings. - * @returns {string} The button text. - */ - function getButtonContent(theme, settings) { - return theme === 'dark' ? settings['light'] : settings['dark']; - } - - /** - * Update the button text depending on the current theme. - * - * @param {HTMLButtonElement} button - The color scheme button. - * @param {Settings} settings - The plugin settings. - */ - function updateButtonText(button, settings) { - var theme = - settings['current'] === 'system' - ? getThemeFromSystem() - : settings['current']; - - button.textContent = getButtonContent(theme, settings); - } - - /** - * Update pre data-prismjs-color-scheme attribute. - * - * @param {HTMLPreElement} pre - The pre element wrapping the code. - * @param {Theme} theme - The current theme. - */ - function updatePreAttribute(pre, theme) { - pre.setAttribute('data-prismjs-color-scheme-current', theme); - } - - /** - * Update pre attribute for all code blocks. - * - * @param {Theme} theme - The new theme. - */ - function switchTheme(theme) { - var allPre = document.querySelectorAll( - 'pre[data-prismjs-color-scheme-current]' - ); - allPre.forEach((pre) => { - updatePreAttribute(pre, theme); - }); - } - - /** - * Set current theme on pre attribute change. - * - * @param {HTMLPreElement} pre - The pre element wrapping the code. - * @param {Settings} settings - The plugin settings. - */ - function listenAttributeChange(pre, settings) { - var observer = new MutationObserver(function (mutations) { - mutations.forEach((record) => { - var mutatedPre = record.target; - var button = mutatedPre.parentElement.querySelector( - '.prism-color-scheme-button' - ); - var newTheme = mutatedPre.getAttribute( - 'data-prismjs-color-scheme-current' - ); - settings['current'] = newTheme; - updateButtonText(button, settings); - }); - }); - observer.observe(pre, { - attributes: true, - attributeFilter: ['data-prismjs-color-scheme-current'], - }); - } - - /** - * Create a color scheme button. - * - * @param {Object} env - The environment variables of the hook. - * @returns {HTMLButtonElement} The color scheme button. - */ - function getColorSchemeButton(env) { - var element = env.element; - var pre = element.parentElement; - var settings = getSettings(element); - var themeButton = document.createElement('button'); - themeButton.className = 'prism-color-scheme-button'; - themeButton.setAttribute('type', 'button'); - updateButtonText(themeButton, settings); - updatePreAttribute(pre, settings['current']); - listenAttributeChange(pre, settings); - - themeButton.addEventListener('click', () => { - var newTheme = getNewTheme(settings['current']); - switchTheme(newTheme); - storage.set('prismjs-color-scheme', newTheme); - }); - - window.addEventListener('storage', (e) => { - if (e.key === 'prismjs-color-scheme') { - var newTheme = JSON.parse(e.newValue); - if (isValidTheme(newTheme)) updatePreAttribute(pre, newTheme); - } - }); - - return themeButton; - } - - /** - * Register a new button in Prism toolbar plugin. - */ - Prism.plugins.toolbar.registerButton('color-scheme', getColorSchemeButton); -})(); -- cgit v1.2.3