CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
nestedtext.js84 linesDownload Raw Back to languages
1/*2Language: NestedText3Description: NestedText is a file format for holding data that is to be entered, edited, or viewed by people.4Website: https://nestedtext.org/5Category: config6*/7 8/** @type LanguageFn */9function nestedtext(hljs) {10  const NESTED = {11    match: [12      /^\s*(?=\S)/, // have to look forward here to avoid polynomial backtracking13      /[^:]+/,14      /:\s*/,15      /$/16    ],17    className: {18      2: "attribute",19      3: "punctuation"20    }21  };22  const DICTIONARY_ITEM = {23    match: [24      /^\s*(?=\S)/, // have to look forward here to avoid polynomial backtracking25      /[^:]*[^: ]/,26      /[ ]*:/,27      /[ ]/,28      /.*$/29    ],30    className: {31      2: "attribute",32      3: "punctuation",33      5: "string"34    }35  };36  const STRING = {37    match: [38      /^\s*/,39      />/,40      /[ ]/,41      /.*$/42    ],43    className: {44      2: "punctuation",45      4: "string"46    }47  };48  const LIST_ITEM = {49    variants: [50      { match: [51        /^\s*/,52        /-/,53        /[ ]/,54        /.*$/55      ] },56      { match: [57        /^\s*/,58        /-$/59      ] }60    ],61    className: {62      2: "bullet",63      4: "string"64    }65  };66 67  return {68    name: 'Nested Text',69    aliases: [ 'nt' ],70    contains: [71      hljs.inherit(hljs.HASH_COMMENT_MODE, {72        begin: /^\s*(?=#)/,73        excludeBegin: true74      }),75      LIST_ITEM,76      STRING,77      NESTED,78      DICTIONARY_ITEM79    ]80  };81}82 83export { nestedtext as default };84 
basant307/AI_Governance_Project · CoolFace