@cosense-toolbox/textmate 0.1.0-beta.2 → 0.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +13 -6
- package/dist/index.mjs.map +1 -1
- package/grammars/cosense-x.tmLanguage.json +43 -31
- package/grammars/cosense.tmLanguage.json +43 -31
- package/package.json +2 -3
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/grammar.ts","../src/scopes.ts","../src/index.ts"],"mappings":";;UAoBiB;EACf;EACA;EACA;EACA;EACA,WAAW,eAAe;EAC1B,gBAAgB,eAAe;EAC/B,cAAc,eAAe;EAC7B,WAAW;EACX;EACA;;;UAIe;EACf,MAAM;EACN;EACA,mBAAmB;EACnB;EACA;EACA,UAAU;EACV,YAAY,eAAe;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/grammar.ts","../src/scopes.ts","../src/index.ts"],"mappings":";;UAoBiB;EACf;EACA;EACA;EACA;EACA,WAAW,eAAe;EAC1B,gBAAgB,eAAe;EAC/B,cAAc,eAAe;EAC7B,WAAW;EACX;EACA;;;UAIe;EACf,MAAM;EACN;EACA,mBAAmB;EACnB;EACA;EACA,UAAU;EACV,YAAY,eAAe;;;KA8cjB;;;;;;;;;;;cCzeC;;;;;;;;;;;;;;;;;;;;;;;;;KA+BD,wBAAwB;;;cClCvB,SAAS;cAET,UAAU"}
|
package/dist/index.mjs
CHANGED
|
@@ -70,8 +70,12 @@ const URL = re`(?i:https?)://[^\s\[\]]+`;
|
|
|
70
70
|
const CLOSES = re`(?=.*\])`;
|
|
71
71
|
/** A bracket closes on its own line or not at all. */
|
|
72
72
|
const CLOSE_ON_LINE = re`\]|(?=$)`;
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
/**
|
|
74
|
+
* A decoration marker: any of Cosense's, as the parser reads them. Only `* / - _` have a look
|
|
75
|
+
* of their own; the rest (`[! 注意]`) still make the bracket a decoration and not a link.
|
|
76
|
+
*/
|
|
77
|
+
const MARKERS = re`[!"#%&'()*+,\-./{|}<>_~=]`;
|
|
78
|
+
const NOT_STAR = re`[!"#%&'()+,\-./{|}<>_~=]`;
|
|
75
79
|
/**
|
|
76
80
|
* A line that opens with a component tag (`.csnx`), as the language server tells one:
|
|
77
81
|
* `<` or `</`, a capitalised name, then a space or the end of the tag.
|
|
@@ -117,7 +121,10 @@ const WEIGHTS = [
|
|
|
117
121
|
3
|
|
118
122
|
];
|
|
119
123
|
const SWITCHES = [false, true];
|
|
120
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Every combination of markers. The one with none of `* / - _` is a run of the others alone
|
|
126
|
+
* (`[! x]`), which colours nothing but still keeps the bracket from reading as a link.
|
|
127
|
+
*/
|
|
121
128
|
const MARKER_SETS = pipe(WEIGHTS, Array.flatMap((stars) => Array.map(SWITCHES, (italic) => ({
|
|
122
129
|
stars,
|
|
123
130
|
italic
|
|
@@ -156,12 +163,12 @@ const markerConditions = (emphasis) => Regex([
|
|
|
156
163
|
* `[<markers> body]`, one rule per combination. The body is read again for links and icons
|
|
157
164
|
* but not for emphasis, which does not nest in Cosense (`[* [* x]]` is bold around a link).
|
|
158
165
|
*/
|
|
159
|
-
const emphasisRules = Array.
|
|
160
|
-
scopes,
|
|
166
|
+
const emphasisRules = Array.map(MARKER_SETS, (emphasis) => region({
|
|
167
|
+
scopes: emphasisScopes(emphasis),
|
|
161
168
|
begin: re`\[${markerConditions(emphasis)}(?=${MARKERS}+\s.*\])${MARKERS}+\s+`,
|
|
162
169
|
end: CLOSE_ON_LINE,
|
|
163
170
|
patterns: [include("inline-in-emphasis"), include("nested-bracket")]
|
|
164
|
-
}))
|
|
171
|
+
}));
|
|
165
172
|
/** Anything up to, but not over, a `]]`. */
|
|
166
173
|
const UNTIL_DOUBLE_CLOSE = re`(?:(?!\]\]).)`;
|
|
167
174
|
/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Arr","Rec"],"sources":["../src/scopes.ts","../src/grammar.ts","../src/index.ts"],"sourcesContent":["/**\n * A scope this grammar gives. Every one ends in `.cosense`, which is how a theme or a\n * reader tells them from the scopes of a language embedded next to Cosense.\n */\nexport type Scope = `${string}.cosense`\n\n/**\n * The TextMate scope each Cosense notation is drawn as.\n *\n * Keys are the token names @cosense-toolbox/lsp reasons in, so the two\n * highlighters describe the same things; the parity test holds them to it. Each scope\n * starts with a name themes already colour (`markup.bold`, `string.other.link`, ...), so\n * any Shiki or VS Code theme draws Cosense without knowing about it.\n */\nexport const SCOPES = {\n title: \"markup.heading.cosense\",\n link: \"string.other.link.internal.cosense\",\n projectLink: \"string.other.link.project.cosense\",\n externalLink: \"markup.underline.link.external.cosense\",\n hashtag: \"entity.name.tag.hashtag.cosense\",\n code: \"markup.inline.raw.cosense\",\n codeBlock: \"markup.raw.block.cosense\",\n formula: \"constant.other.formula.cosense\",\n icon: \"string.other.link.icon.cosense\",\n // Only the `>` marker, as the language server marks it. The whole line also carries\n // `markup.quote.cosense` so themes can tint it.\n quote: \"punctuation.definition.quote.begin.cosense\",\n bold: \"markup.bold.cosense\",\n italic: \"markup.italic.cosense\",\n strike: \"markup.strikethrough.cosense\",\n underline: \"markup.underline.cosense\",\n image: \"markup.underline.link.image.cosense\",\n table: \"markup.other.table.cosense\",\n // `[** x]` and louder: still bold to a theme, but a level apart for anyone who wants it.\n bold2: \"markup.bold.level2.cosense\",\n bold3: \"markup.bold.level3.cosense\",\n // `.csnx` only: the tag that opens a component line, read as JSX. The whole line also\n // carries `meta.tag.component.cosense`.\n component: \"support.class.component.cosense\",\n attribute: \"entity.other.attribute-name.cosense\",\n attributeValue: \"string.quoted.attribute-value.cosense\",\n expression: \"meta.embedded.expression.cosense\",\n frontmatter: \"comment.block.frontmatter.cosense\",\n} as const satisfies Record<string, Scope>\n\nexport type Notation = keyof typeof SCOPES\n","/**\n * The Cosense grammar, built from code rather than written as JSON: emphasis alone takes\n * one rule per combination of markers, and those are generated.\n *\n * The rules follow @cosense-toolbox/parser, and where they cannot (TextMate reads line by\n * line with regexes, the parser reads the whole page) they approximate it. The parity test\n * measures how close that is against the language server.\n *\n * Rules are first built as a tagged union (`Pattern`) and only then encoded as TextMate\n * JSON. The union is what keeps the grammar honest: a rule is a match or a region and never\n * half of each, every `include` names a repository entry that exists, and every scope ends\n * in `.cosense`. A typo in any of those fails to compile instead of silently colouring nothing.\n */\nimport { Array as Arr, Brand, Match, Option, pipe, Record as Rec } from \"effect\"\n\nimport { type Scope, SCOPES } from \"./scopes\"\n\n// --- The output: what Shiki and VS Code read ------------------------------------------\n\n/** A TextMate rule as JSON. Assignable to Shiki's and VS Code's own types. */\nexport interface Rule {\n name?: string\n match?: string\n begin?: string\n end?: string\n captures?: Record<string, Rule>\n beginCaptures?: Record<string, Rule>\n endCaptures?: Record<string, Rule>\n patterns?: Rule[]\n include?: string\n applyEndPatternLast?: boolean\n}\n\n/** A grammar as Shiki takes it (`LanguageRegistration`), which is also a `.tmLanguage.json`. */\nexport interface Grammar {\n name: Dialect\n displayName: string\n scopeName: `text.${Dialect}`\n aliases: string[]\n fileTypes: string[]\n patterns: Rule[]\n repository: Record<string, Rule>\n}\n\n// --- Regexes ----------------------------------------------------------------------------\n\n/** A regex in Oniguruma syntax. Branded so a scope or a label cannot be passed as one. */\ntype Regex = string & Brand.Brand<\"Regex\">\nconst Regex = Brand.nominal<Regex>()\n\n/** A regex written raw: backslashes are the regex's, not the string literal's. */\nconst re = (strings: TemplateStringsArray, ...parts: ReadonlyArray<Regex | number>): Regex =>\n Regex(String.raw(strings, ...parts))\n\nconst oneOf = (alternatives: Arr.NonEmptyReadonlyArray<Regex>): Regex =>\n Regex(alternatives.map((alternative) => `(?:${alternative})`).join(\"|\"))\n\n/** Indentation, as the parser counts it: full-width spaces (U+3000) indent too. */\nconst INDENT = re`[ \\t\\u3000]*`\n\nconst IMAGE_EXT = re`\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)`\n\n/**\n * A URL that is drawn as an image, inside a bracket (so without `[`, `]` or spaces):\n * a Gyazo page, a path ending in an image extension before any query, or a fragment\n * ending in one (`#.svg`, Cosense's way of saying \"this is an image\").\n */\nconst IMAGE_URL = oneOf([\n re`(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*`,\n re`(?i:https?)://[^\\s\\[\\]?#]*${IMAGE_EXT}(?:[?#][^\\s\\[\\]]*)?`,\n re`(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*${IMAGE_EXT}`,\n])\n\nconst URL = re`(?i:https?)://[^\\s\\[\\]]+`\n\n/** What a bracket must end with somewhere, or it is plain text and not worth a rule. */\nconst CLOSES = re`(?=.*\\])`\n\n/** A bracket closes on its own line or not at all. */\nconst CLOSE_ON_LINE = re`\\]|(?=$)`\n\nconst MARKERS = re`[*/\\-_]`\n\nconst NOT_STAR = re`[/\\-_]`\n\n/**\n * A line that opens with a component tag (`.csnx`), as the language server tells one:\n * `<` or `</`, a capitalised name, then a space or the end of the tag.\n */\nconst COMPONENT_LINE = re`\\s*</?[A-Z][A-Za-z0-9_.]*(?:[^\\S\\n]|/?>)`\n\n// --- Rules, typed -----------------------------------------------------------------------\n\ntype RepositoryKey =\n | \"head\"\n | \"frontmatter\"\n | \"code-block\"\n | \"table-block\"\n | \"component\"\n | \"component-tag\"\n | \"expression\"\n | \"quote\"\n | \"inline\"\n | \"inline-in-emphasis\"\n | \"nested-bracket\"\n | \"bare-bracket\"\n\n/** `0` is the whole match; this grammar never needs more than three groups. */\ntype CaptureGroup = \"0\" | \"1\" | \"2\" | \"3\"\n\ninterface Capture {\n readonly scopes: ReadonlyArray<Scope>\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Captures = Readonly<Partial<Record<CaptureGroup, Capture>>>\n\ninterface Include {\n readonly _tag: \"Include\"\n readonly key: RepositoryKey\n}\n\n/** A single-line match. */\ninterface Single {\n readonly _tag: \"Single\"\n readonly scopes: ReadonlyArray<Scope>\n readonly regex: Regex\n readonly captures: Captures\n}\n\n/** From `begin` to `end`, with `patterns` tried in between. */\ninterface Region {\n readonly _tag: \"Region\"\n readonly scopes: ReadonlyArray<Scope>\n readonly begin: Regex\n readonly end: Regex\n readonly beginCaptures: Captures\n readonly endCaptures: Captures\n readonly patterns: ReadonlyArray<Pattern>\n /** Try `patterns` before `end` when both match at the same place. */\n readonly endPatternLast: boolean\n}\n\n/** Several patterns tried in order, with no scope of their own. */\ninterface Group {\n readonly _tag: \"Group\"\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Pattern = Include | Single | Region | Group\n\nconst include = (key: RepositoryKey): Pattern => ({ _tag: \"Include\", key })\n\nconst single = (\n regex: Regex,\n options: { readonly scopes?: ReadonlyArray<Scope>; readonly captures?: Captures } = {},\n): Pattern => ({\n _tag: \"Single\",\n regex,\n scopes: options.scopes ?? [],\n captures: options.captures ?? {},\n})\n\nconst region = (options: {\n readonly begin: Regex\n readonly end: Regex\n readonly scopes?: ReadonlyArray<Scope>\n readonly beginCaptures?: Captures\n readonly endCaptures?: Captures\n readonly patterns?: ReadonlyArray<Pattern>\n readonly endPatternLast?: boolean\n}): Pattern => ({\n _tag: \"Region\",\n begin: options.begin,\n end: options.end,\n scopes: options.scopes ?? [],\n beginCaptures: options.beginCaptures ?? {},\n endCaptures: options.endCaptures ?? {},\n patterns: options.patterns ?? [],\n endPatternLast: options.endPatternLast ?? false,\n})\n\nconst group = (patterns: ReadonlyArray<Pattern>): Pattern => ({ _tag: \"Group\", patterns })\n\nconst scoped = (...scopes: ReadonlyArray<Scope>): Capture => ({ scopes, patterns: [] })\n\nconst readAs = (...patterns: ReadonlyArray<Pattern>): Capture => ({ scopes: [], patterns })\n\nconst onlyIf = <A>(condition: boolean, value: A): Option.Option<A> =>\n condition ? Option.some(value) : Option.none()\n\n// --- Inline notation --------------------------------------------------------------------\n\ntype Weight = 0 | 1 | 2 | 3\n\n/** One combination of emphasis markers: how many `*`, and which of `/`, `-`, `_`. */\ninterface Emphasis {\n readonly stars: Weight\n readonly italic: boolean\n readonly strike: boolean\n readonly underline: boolean\n}\n\nconst WEIGHTS: ReadonlyArray<Weight> = [0, 1, 2, 3]\n\nconst SWITCHES = [false, true] as const\n\n/** Every combination of markers, including none at all (which `emphasisRules` drops). */\nconst MARKER_SETS: ReadonlyArray<Emphasis> = pipe(\n WEIGHTS,\n Arr.flatMap((stars) => Arr.map(SWITCHES, (italic) => ({ stars, italic }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (strike) => ({ ...set, strike }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (underline) => ({ ...set, underline }))),\n)\n\n/** `[*** x]` and louder are one size: Cosense caps the size, and so does the parser. */\nconst WEIGHT_SCOPE: { readonly [W in Weight]: Option.Option<Scope> } = {\n 0: Option.none(),\n 1: Option.some(SCOPES.bold),\n 2: Option.some(SCOPES.bold2),\n 3: Option.some(SCOPES.bold3),\n}\n\n/** All the scopes a run carries, since Cosense applies every marker: `[-* x]` is both. */\nconst emphasisScopes = (emphasis: Emphasis): ReadonlyArray<Scope> =>\n Arr.getSomes([\n onlyIf(emphasis.underline, SCOPES.underline),\n onlyIf(emphasis.strike, SCOPES.strike),\n onlyIf(emphasis.italic, SCOPES.italic),\n WEIGHT_SCOPE[emphasis.stars],\n ])\n\n/** A lookahead over the marker run (`[-** x]` -> `-**`) that holds for exactly this many `*`. */\nconst starCondition = (stars: Weight): Regex =>\n Match.value(stars).pipe(\n Match.when(0, () => re`(?!${MARKERS}*?\\*)`),\n Match.when(3, () => re`(?=(?:${NOT_STAR}*\\*){3})`),\n Match.orElse((count) => re`(?=(?:${NOT_STAR}*\\*){${count}}${NOT_STAR}*\\s)`),\n )\n\nconst markerCondition = (marker: Regex, wanted: boolean): Regex =>\n wanted ? re`(?=${MARKERS}*?${marker})` : re`(?!${MARKERS}*?${marker})`\n\n/** Lookaheads over the marker run that hold only for this combination. */\nconst markerConditions = (emphasis: Emphasis): Regex =>\n Regex(\n [\n starCondition(emphasis.stars),\n markerCondition(re`/`, emphasis.italic),\n markerCondition(re`\\-`, emphasis.strike),\n markerCondition(re`_`, emphasis.underline),\n ].join(\"\"),\n )\n\n/**\n * `[<markers> body]`, one rule per combination. The body is read again for links and icons\n * but not for emphasis, which does not nest in Cosense (`[* [* x]]` is bold around a link).\n */\nconst emphasisRules: ReadonlyArray<Pattern> = Arr.filterMap(MARKER_SETS, (emphasis) =>\n pipe(\n emphasisScopes(emphasis),\n Option.liftPredicate((scopes) => scopes.length > 0),\n Option.map((scopes) =>\n region({\n scopes,\n begin: re`\\[${markerConditions(emphasis)}(?=${MARKERS}+\\s.*\\])${MARKERS}+\\s+`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n ),\n ),\n)\n\n/** Anything up to, but not over, a `]]`. */\nconst UNTIL_DOUBLE_CLOSE = re`(?:(?!\\]\\]).)`\n\n/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */\nconst strongRules: ReadonlyArray<Pattern> = [\n single(\n re`\\[\\[(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\\]\\]`,\n { scopes: [SCOPES.image] },\n ),\n single(re`\\[\\[(${UNTIL_DOUBLE_CLOSE}+)\\]\\]`, {\n scopes: [SCOPES.bold],\n captures: { 1: readAs(include(\"inline-in-emphasis\")) },\n }),\n]\n\n/** `[$ x^2]`. Its body is TeX, not notation, and may hold brackets of its own. */\nconst formulaRule: Pattern = region({\n scopes: [SCOPES.formula],\n begin: re`\\[(?=\\$)${CLOSES}`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n})\n\n/**\n * Brackets whose body holds no brackets, tried in the parser's order: an icon before a\n * URL before an image path before a project link, and anything left is a page link.\n */\nconst simpleTargetRules = (allowImagePath: boolean): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(single(re`\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]`, { scopes: [SCOPES.icon] })),\n // Only URLs, and one of them an image: the image, linking to another URL if there is one.\n Option.some(\n single(re`\\[\\s*(?:${URL}\\s+)*(?:${IMAGE_URL})(?=[\\s\\]])(?:\\s+${URL})*\\s*\\]`, {\n scopes: [SCOPES.image],\n }),\n ),\n // Any other URL makes a link, labelled or not.\n Option.some(single(re`\\[[^\\[\\]]*${URL}[^\\[\\]]*\\]`, { scopes: [SCOPES.externalLink] })),\n // `[a.png]`, but not inside emphasis: there Cosense links to a page of that name.\n onlyIf(allowImagePath, single(re`\\[[^\\[\\]]*${IMAGE_EXT}\\]`, { scopes: [SCOPES.image] })),\n Option.some(single(re`\\[/[^\\[\\]]*\\]`, { scopes: [SCOPES.projectLink] })),\n Option.some(single(re`\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]`, { scopes: [SCOPES.link] })),\n ])\n\n/** What follows the bracketed notation in both contexts, in the parser's order. */\nconst unbracketedRules: ReadonlyArray<Pattern> = [\n single(Regex(\"`[^`]*`\"), { scopes: [SCOPES.code] }),\n // `#tag`, only at the start or after a space: a `#` inside a word is just a character.\n single(re`(?:^|(?<=[ \\t\\u3000]))#[^\\s\\[\\]#]+`, { scopes: [SCOPES.hashtag] }),\n // A URL outside brackets is always a link, even to an image.\n single(re`(?i:https?)://[^\\s\\]]+`, { scopes: [SCOPES.externalLink] }),\n]\n\n// --- Lines and blocks -------------------------------------------------------------------\n\n/**\n * A block is its header and every line indented deeper. Deeper is approximated as\n * \"the header's indentation, then more\", which is exact when a page indents one way.\n */\nconst block = (keyword: \"code\" | \"table\", scope: Scope, patterns: ReadonlyArray<Pattern>) =>\n region({\n scopes: [scope],\n begin: re`^(${INDENT})(${Regex(keyword)}:)(.+)$`,\n beginCaptures: {\n 2: scoped(\"keyword.other.block.cosense\"),\n 3: scoped(\"entity.name.section.block.cosense\"),\n },\n end: re`^(?!\\1[ \\t\\u3000])`,\n patterns,\n })\n\n/**\n * The first line is the title, unless the file opens with YAML: then it is the first line\n * after the fence. Nothing on the title line is notation. In `.csnx` a first line that is\n * a component tag is that tag, and the page has no title line.\n */\nconst head = (dialect: DialectInfo): Pattern => {\n const notComponent = dialect.components ? re`(?!${COMPONENT_LINE})` : re``\n return group([\n region({\n begin: re`\\A(?=---[ \\t]*$)`,\n patterns: [include(\"frontmatter\")],\n // Ends on the line after the fence either way; only a title line is captured.\n end: dialect.components ? re`^(?:(?=${COMPONENT_LINE})|(.*)$)` : re`^(.*)$`,\n endCaptures: { 1: scoped(SCOPES.title) },\n // At the very start the fence and the title line both match: the fence wins.\n endPatternLast: true,\n }),\n single(re`\\A${notComponent}.*$`, { scopes: [SCOPES.title] }),\n ])\n}\n\n/** Every other entry the grammar can `include`. The mapped type makes a missing one an error. */\nconst REPOSITORY: { readonly [K in Exclude<RepositoryKey, \"head\">]: Pattern } = {\n frontmatter: region({\n scopes: [SCOPES.frontmatter],\n begin: re`\\A---[ \\t]*$`,\n end: re`^---[ \\t]*$`,\n }),\n \"code-block\": block(\"code\", SCOPES.codeBlock, []),\n \"table-block\": block(\"table\", SCOPES.table, [\n single(re`\\t`, { scopes: [\"punctuation.separator.table-cell.cosense\"] }),\n ]),\n // A component tag owns its line: nothing on it is Cosense notation, and the text after\n // the tag is plain.\n component: region({\n scopes: [\"meta.tag.component.cosense\"],\n begin: re`^(?=${COMPONENT_LINE})`,\n end: re`$`,\n patterns: [include(\"component-tag\")],\n }),\n // The tag itself, read as JSX.\n \"component-tag\": region({\n begin: re`^(\\s*)(</?)([A-Z][A-Za-z0-9_.]*)`,\n beginCaptures: {\n 2: scoped(\"punctuation.definition.tag.begin.cosense\"),\n 3: scoped(SCOPES.component),\n },\n end: re`(/?>)|(?=$)`,\n endCaptures: { 1: scoped(\"punctuation.definition.tag.end.cosense\") },\n patterns: [\n single(re`[A-Za-z_:][A-Za-z0-9_:.\\-]*`, { scopes: [SCOPES.attribute] }),\n single(re`=`, { scopes: [\"punctuation.separator.key-value.cosense\"] }),\n single(re`\"[^\"]*(?:\"|$)|'[^']*(?:'|$)`, { scopes: [SCOPES.attributeValue] }),\n include(\"expression\"),\n ],\n }),\n // `{...}`: a JavaScript expression. Braces nest; a few literals are told apart.\n expression: region({\n scopes: [SCOPES.expression],\n begin: re`\\{`,\n end: re`\\}|(?=$)`,\n beginCaptures: { 0: scoped(\"punctuation.section.embedded.begin.cosense\") },\n endCaptures: { 0: scoped(\"punctuation.section.embedded.end.cosense\") },\n patterns: [\n include(\"expression\"),\n single(re`\"[^\"]*\"|'[^']*'`, { scopes: [\"string.quoted.cosense\"] }),\n single(re`\\b\\d+(?:\\.\\d+)?\\b`, { scopes: [\"constant.numeric.cosense\"] }),\n single(re`\\b(?:true|false|null|undefined)\\b`, { scopes: [\"constant.language.cosense\"] }),\n ],\n }),\n quote: region({\n scopes: [\"markup.quote.cosense\"],\n begin: re`^${INDENT}(>[> ]*)`,\n beginCaptures: { 1: scoped(SCOPES.quote) },\n end: re`$`,\n patterns: [include(\"inline\")],\n }),\n inline: group([\n ...strongRules,\n formulaRule,\n ...emphasisRules,\n ...simpleTargetRules(true),\n ...unbracketedRules,\n ]),\n \"inline-in-emphasis\": group([\n ...strongRules,\n formulaRule,\n ...simpleTargetRules(false),\n ...unbracketedRules,\n ]),\n // A bracket that is no notation, but whose `]` must not close the one around it:\n // in `[* a [] b]` the emphasis runs to the last `]`, as the parser counts depth.\n \"nested-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n \"bare-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n }),\n}\n\n// --- Encoding ---------------------------------------------------------------------------\n\n/** A field only when there is something to put in it: TextMate reads absent and empty alike. */\nconst field = <K extends keyof Rule>(key: K, value: Option.Option<Rule[K]>): Partial<Rule> =>\n Option.match(value, { onNone: () => ({}), onSome: (v) => ({ [key]: v }) })\n\nconst nonEmpty = <A>(items: ReadonlyArray<A>): Option.Option<ReadonlyArray<A>> =>\n Option.liftPredicate(items, (list) => list.length > 0)\n\n/** TextMate gives a rule several scopes by separating them with spaces. */\nconst nameField = (scopes: ReadonlyArray<Scope>): Partial<Rule> =>\n field(\n \"name\",\n Option.map(nonEmpty(scopes), (list) => list.join(\" \")),\n )\n\nconst patternsField = (patterns: ReadonlyArray<Pattern>): Partial<Rule> =>\n field(\"patterns\", Option.map(nonEmpty(patterns), Arr.map(encode)))\n\nconst encodeCaptures = (captures: Captures): Option.Option<Record<string, Rule>> =>\n pipe(\n Object.entries(captures),\n Arr.map(\n ([group, capture]) =>\n [group, { ...nameField(capture.scopes), ...patternsField(capture.patterns) }] as const,\n ),\n nonEmpty,\n Option.map(Rec.fromEntries),\n )\n\nconst encode = (pattern: Pattern): Rule =>\n Match.value(pattern).pipe(\n Match.tag(\"Include\", ({ key }) => ({ include: `#${key}` })),\n Match.tag(\"Group\", ({ patterns }) => patternsField(patterns)),\n Match.tag(\"Single\", (rule) => ({\n ...nameField(rule.scopes),\n match: rule.regex,\n ...field(\"captures\", encodeCaptures(rule.captures)),\n })),\n Match.tag(\"Region\", (rule) => ({\n ...nameField(rule.scopes),\n begin: rule.begin,\n end: rule.end,\n ...field(\"beginCaptures\", encodeCaptures(rule.beginCaptures)),\n ...field(\"endCaptures\", encodeCaptures(rule.endCaptures)),\n ...patternsField(rule.patterns),\n ...field(\"applyEndPatternLast\", onlyIf(rule.endPatternLast, true)),\n })),\n Match.exhaustive,\n )\n\n// --- Dialects ---------------------------------------------------------------------------\n\n/** `.csn`, and `.csnx`, which also reads a line that is one component tag. */\nexport type Dialect = \"cosense\" | \"cosense-x\"\n\ninterface DialectInfo {\n readonly displayName: string\n readonly extension: string\n readonly components: boolean\n}\n\nconst DIALECTS: { readonly [D in Dialect]: DialectInfo } = {\n cosense: { displayName: \"Cosense\", extension: \"csn\", components: false },\n \"cosense-x\": { displayName: \"Cosense X\", extension: \"csnx\", components: true },\n}\n\n/** What a line can be, in the order the parser decides it. */\nconst linePatterns = (dialect: DialectInfo): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(include(\"head\")),\n Option.some(include(\"code-block\")),\n Option.some(include(\"table-block\")),\n onlyIf(dialect.components, include(\"component\")),\n Option.some(include(\"quote\")),\n Option.some(include(\"inline\")),\n ])\n\nexport const buildGrammar = (dialect: Dialect): Grammar => {\n const info = DIALECTS[dialect]\n return {\n name: dialect,\n displayName: info.displayName,\n scopeName: `text.${dialect}`,\n aliases: [info.extension],\n fileTypes: [info.extension],\n patterns: Arr.map(linePatterns(info), encode),\n repository: Rec.map({ head: head(info), ...REPOSITORY }, encode),\n }\n}\n","/**\n * TextMate grammars for Cosense notation: `.csn` and, with component lines, `.csnx`.\n *\n * Each export is a Shiki `LanguageRegistration` as it stands, and the same objects are\n * published as `.tmLanguage.json` for editors that read TextMate grammars.\n */\nimport { buildGrammar, type Grammar } from \"./grammar\"\n\nexport type { Dialect, Grammar, Rule } from \"./grammar\"\nexport { type Notation, SCOPES } from \"./scopes\"\n\nexport const cosense: Grammar = buildGrammar(\"cosense\")\n\nexport const cosenseX: Grammar = buildGrammar(\"cosense-x\")\n"],"mappings":";;;;;;;;;;AAcA,MAAa,SAAS;CACpB,OAAO;CACP,MAAM;CACN,aAAa;CACb,cAAc;CACd,SAAS;CACT,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;CAGN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,OAAO;CACP,OAAO;CAEP,OAAO;CACP,OAAO;CAGP,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,YAAY;CACZ,aAAa;AACf;;;;;;;;;;;;;;;;ACK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AAa,SAAS;AAEtD,MAAa,WAAoB,aAAa,WAAW"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Arr","Rec"],"sources":["../src/scopes.ts","../src/grammar.ts","../src/index.ts"],"sourcesContent":["/**\n * A scope this grammar gives. Every one ends in `.cosense`, which is how a theme or a\n * reader tells them from the scopes of a language embedded next to Cosense.\n */\nexport type Scope = `${string}.cosense`\n\n/**\n * The TextMate scope each Cosense notation is drawn as.\n *\n * Keys are the token names @cosense-toolbox/lsp reasons in, so the two\n * highlighters describe the same things; the parity test holds them to it. Each scope\n * starts with a name themes already colour (`markup.bold`, `string.other.link`, ...), so\n * any Shiki or VS Code theme draws Cosense without knowing about it.\n */\nexport const SCOPES = {\n title: \"markup.heading.cosense\",\n link: \"string.other.link.internal.cosense\",\n projectLink: \"string.other.link.project.cosense\",\n externalLink: \"markup.underline.link.external.cosense\",\n hashtag: \"entity.name.tag.hashtag.cosense\",\n code: \"markup.inline.raw.cosense\",\n codeBlock: \"markup.raw.block.cosense\",\n formula: \"constant.other.formula.cosense\",\n icon: \"string.other.link.icon.cosense\",\n // Only the `>` marker, as the language server marks it. The whole line also carries\n // `markup.quote.cosense` so themes can tint it.\n quote: \"punctuation.definition.quote.begin.cosense\",\n bold: \"markup.bold.cosense\",\n italic: \"markup.italic.cosense\",\n strike: \"markup.strikethrough.cosense\",\n underline: \"markup.underline.cosense\",\n image: \"markup.underline.link.image.cosense\",\n table: \"markup.other.table.cosense\",\n // `[** x]` and louder: still bold to a theme, but a level apart for anyone who wants it.\n bold2: \"markup.bold.level2.cosense\",\n bold3: \"markup.bold.level3.cosense\",\n // `.csnx` only: the tag that opens a component line, read as JSX. The whole line also\n // carries `meta.tag.component.cosense`.\n component: \"support.class.component.cosense\",\n attribute: \"entity.other.attribute-name.cosense\",\n attributeValue: \"string.quoted.attribute-value.cosense\",\n expression: \"meta.embedded.expression.cosense\",\n frontmatter: \"comment.block.frontmatter.cosense\",\n} as const satisfies Record<string, Scope>\n\nexport type Notation = keyof typeof SCOPES\n","/**\n * The Cosense grammar, built from code rather than written as JSON: emphasis alone takes\n * one rule per combination of markers, and those are generated.\n *\n * The rules follow @cosense-toolbox/parser, and where they cannot (TextMate reads line by\n * line with regexes, the parser reads the whole page) they approximate it. The parity test\n * measures how close that is against the language server.\n *\n * Rules are first built as a tagged union (`Pattern`) and only then encoded as TextMate\n * JSON. The union is what keeps the grammar honest: a rule is a match or a region and never\n * half of each, every `include` names a repository entry that exists, and every scope ends\n * in `.cosense`. A typo in any of those fails to compile instead of silently colouring nothing.\n */\nimport { Array as Arr, Brand, Match, Option, pipe, Record as Rec } from \"effect\"\n\nimport { type Scope, SCOPES } from \"./scopes\"\n\n// --- The output: what Shiki and VS Code read ------------------------------------------\n\n/** A TextMate rule as JSON. Assignable to Shiki's and VS Code's own types. */\nexport interface Rule {\n name?: string\n match?: string\n begin?: string\n end?: string\n captures?: Record<string, Rule>\n beginCaptures?: Record<string, Rule>\n endCaptures?: Record<string, Rule>\n patterns?: Rule[]\n include?: string\n applyEndPatternLast?: boolean\n}\n\n/** A grammar as Shiki takes it (`LanguageRegistration`), which is also a `.tmLanguage.json`. */\nexport interface Grammar {\n name: Dialect\n displayName: string\n scopeName: `text.${Dialect}`\n aliases: string[]\n fileTypes: string[]\n patterns: Rule[]\n repository: Record<string, Rule>\n}\n\n// --- Regexes ----------------------------------------------------------------------------\n\n/** A regex in Oniguruma syntax. Branded so a scope or a label cannot be passed as one. */\ntype Regex = string & Brand.Brand<\"Regex\">\nconst Regex = Brand.nominal<Regex>()\n\n/** A regex written raw: backslashes are the regex's, not the string literal's. */\nconst re = (strings: TemplateStringsArray, ...parts: ReadonlyArray<Regex | number>): Regex =>\n Regex(String.raw(strings, ...parts))\n\nconst oneOf = (alternatives: Arr.NonEmptyReadonlyArray<Regex>): Regex =>\n Regex(alternatives.map((alternative) => `(?:${alternative})`).join(\"|\"))\n\n/** Indentation, as the parser counts it: full-width spaces (U+3000) indent too. */\nconst INDENT = re`[ \\t\\u3000]*`\n\nconst IMAGE_EXT = re`\\.(?i:png|jpe?g|gif|webp|svg|bmp|avif)`\n\n/**\n * A URL that is drawn as an image, inside a bracket (so without `[`, `]` or spaces):\n * a Gyazo page, a path ending in an image extension before any query, or a fragment\n * ending in one (`#.svg`, Cosense's way of saying \"this is an image\").\n */\nconst IMAGE_URL = oneOf([\n re`(?i:https?://(?:i\\.)?gyazo\\.com/[0-9a-f]{20,})[^\\s\\[\\]]*`,\n re`(?i:https?)://[^\\s\\[\\]?#]*${IMAGE_EXT}(?:[?#][^\\s\\[\\]]*)?`,\n re`(?i:https?)://[^\\s\\[\\]#]*#[^\\s\\[\\]]*${IMAGE_EXT}`,\n])\n\nconst URL = re`(?i:https?)://[^\\s\\[\\]]+`\n\n/** What a bracket must end with somewhere, or it is plain text and not worth a rule. */\nconst CLOSES = re`(?=.*\\])`\n\n/** A bracket closes on its own line or not at all. */\nconst CLOSE_ON_LINE = re`\\]|(?=$)`\n\n/**\n * A decoration marker: any of Cosense's, as the parser reads them. Only `* / - _` have a look\n * of their own; the rest (`[! 注意]`) still make the bracket a decoration and not a link.\n */\nconst MARKERS = re`[!\"#%&'()*+,\\-./{|}<>_~=]`\n\nconst NOT_STAR = re`[!\"#%&'()+,\\-./{|}<>_~=]`\n\n/**\n * A line that opens with a component tag (`.csnx`), as the language server tells one:\n * `<` or `</`, a capitalised name, then a space or the end of the tag.\n */\nconst COMPONENT_LINE = re`\\s*</?[A-Z][A-Za-z0-9_.]*(?:[^\\S\\n]|/?>)`\n\n// --- Rules, typed -----------------------------------------------------------------------\n\ntype RepositoryKey =\n | \"head\"\n | \"frontmatter\"\n | \"code-block\"\n | \"table-block\"\n | \"component\"\n | \"component-tag\"\n | \"expression\"\n | \"quote\"\n | \"inline\"\n | \"inline-in-emphasis\"\n | \"nested-bracket\"\n | \"bare-bracket\"\n\n/** `0` is the whole match; this grammar never needs more than three groups. */\ntype CaptureGroup = \"0\" | \"1\" | \"2\" | \"3\"\n\ninterface Capture {\n readonly scopes: ReadonlyArray<Scope>\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Captures = Readonly<Partial<Record<CaptureGroup, Capture>>>\n\ninterface Include {\n readonly _tag: \"Include\"\n readonly key: RepositoryKey\n}\n\n/** A single-line match. */\ninterface Single {\n readonly _tag: \"Single\"\n readonly scopes: ReadonlyArray<Scope>\n readonly regex: Regex\n readonly captures: Captures\n}\n\n/** From `begin` to `end`, with `patterns` tried in between. */\ninterface Region {\n readonly _tag: \"Region\"\n readonly scopes: ReadonlyArray<Scope>\n readonly begin: Regex\n readonly end: Regex\n readonly beginCaptures: Captures\n readonly endCaptures: Captures\n readonly patterns: ReadonlyArray<Pattern>\n /** Try `patterns` before `end` when both match at the same place. */\n readonly endPatternLast: boolean\n}\n\n/** Several patterns tried in order, with no scope of their own. */\ninterface Group {\n readonly _tag: \"Group\"\n readonly patterns: ReadonlyArray<Pattern>\n}\n\ntype Pattern = Include | Single | Region | Group\n\nconst include = (key: RepositoryKey): Pattern => ({ _tag: \"Include\", key })\n\nconst single = (\n regex: Regex,\n options: { readonly scopes?: ReadonlyArray<Scope>; readonly captures?: Captures } = {},\n): Pattern => ({\n _tag: \"Single\",\n regex,\n scopes: options.scopes ?? [],\n captures: options.captures ?? {},\n})\n\nconst region = (options: {\n readonly begin: Regex\n readonly end: Regex\n readonly scopes?: ReadonlyArray<Scope>\n readonly beginCaptures?: Captures\n readonly endCaptures?: Captures\n readonly patterns?: ReadonlyArray<Pattern>\n readonly endPatternLast?: boolean\n}): Pattern => ({\n _tag: \"Region\",\n begin: options.begin,\n end: options.end,\n scopes: options.scopes ?? [],\n beginCaptures: options.beginCaptures ?? {},\n endCaptures: options.endCaptures ?? {},\n patterns: options.patterns ?? [],\n endPatternLast: options.endPatternLast ?? false,\n})\n\nconst group = (patterns: ReadonlyArray<Pattern>): Pattern => ({ _tag: \"Group\", patterns })\n\nconst scoped = (...scopes: ReadonlyArray<Scope>): Capture => ({ scopes, patterns: [] })\n\nconst readAs = (...patterns: ReadonlyArray<Pattern>): Capture => ({ scopes: [], patterns })\n\nconst onlyIf = <A>(condition: boolean, value: A): Option.Option<A> =>\n condition ? Option.some(value) : Option.none()\n\n// --- Inline notation --------------------------------------------------------------------\n\ntype Weight = 0 | 1 | 2 | 3\n\n/** One combination of emphasis markers: how many `*`, and which of `/`, `-`, `_`. */\ninterface Emphasis {\n readonly stars: Weight\n readonly italic: boolean\n readonly strike: boolean\n readonly underline: boolean\n}\n\nconst WEIGHTS: ReadonlyArray<Weight> = [0, 1, 2, 3]\n\nconst SWITCHES = [false, true] as const\n\n/**\n * Every combination of markers. The one with none of `* / - _` is a run of the others alone\n * (`[! x]`), which colours nothing but still keeps the bracket from reading as a link.\n */\nconst MARKER_SETS: ReadonlyArray<Emphasis> = pipe(\n WEIGHTS,\n Arr.flatMap((stars) => Arr.map(SWITCHES, (italic) => ({ stars, italic }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (strike) => ({ ...set, strike }))),\n Arr.flatMap((set) => Arr.map(SWITCHES, (underline) => ({ ...set, underline }))),\n)\n\n/** `[*** x]` and louder are one size: Cosense caps the size, and so does the parser. */\nconst WEIGHT_SCOPE: { readonly [W in Weight]: Option.Option<Scope> } = {\n 0: Option.none(),\n 1: Option.some(SCOPES.bold),\n 2: Option.some(SCOPES.bold2),\n 3: Option.some(SCOPES.bold3),\n}\n\n/** All the scopes a run carries, since Cosense applies every marker: `[-* x]` is both. */\nconst emphasisScopes = (emphasis: Emphasis): ReadonlyArray<Scope> =>\n Arr.getSomes([\n onlyIf(emphasis.underline, SCOPES.underline),\n onlyIf(emphasis.strike, SCOPES.strike),\n onlyIf(emphasis.italic, SCOPES.italic),\n WEIGHT_SCOPE[emphasis.stars],\n ])\n\n/** A lookahead over the marker run (`[-** x]` -> `-**`) that holds for exactly this many `*`. */\nconst starCondition = (stars: Weight): Regex =>\n Match.value(stars).pipe(\n Match.when(0, () => re`(?!${MARKERS}*?\\*)`),\n Match.when(3, () => re`(?=(?:${NOT_STAR}*\\*){3})`),\n Match.orElse((count) => re`(?=(?:${NOT_STAR}*\\*){${count}}${NOT_STAR}*\\s)`),\n )\n\nconst markerCondition = (marker: Regex, wanted: boolean): Regex =>\n wanted ? re`(?=${MARKERS}*?${marker})` : re`(?!${MARKERS}*?${marker})`\n\n/** Lookaheads over the marker run that hold only for this combination. */\nconst markerConditions = (emphasis: Emphasis): Regex =>\n Regex(\n [\n starCondition(emphasis.stars),\n markerCondition(re`/`, emphasis.italic),\n markerCondition(re`\\-`, emphasis.strike),\n markerCondition(re`_`, emphasis.underline),\n ].join(\"\"),\n )\n\n/**\n * `[<markers> body]`, one rule per combination. The body is read again for links and icons\n * but not for emphasis, which does not nest in Cosense (`[* [* x]]` is bold around a link).\n */\nconst emphasisRules: ReadonlyArray<Pattern> = Arr.map(MARKER_SETS, (emphasis) =>\n region({\n scopes: emphasisScopes(emphasis),\n begin: re`\\[${markerConditions(emphasis)}(?=${MARKERS}+\\s.*\\])${MARKERS}+\\s+`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n)\n\n/** Anything up to, but not over, a `]]`. */\nconst UNTIL_DOUBLE_CLOSE = re`(?:(?!\\]\\]).)`\n\n/** `[[x]]`: an image when x is one, bold otherwise. Closes on the first `]]`, depth or not. */\nconst strongRules: ReadonlyArray<Pattern> = [\n single(\n re`\\[\\[(?:${IMAGE_URL}|${UNTIL_DOUBLE_CLOSE}*?${IMAGE_EXT}(?:[?#]${UNTIL_DOUBLE_CLOSE}*)?)\\]\\]`,\n { scopes: [SCOPES.image] },\n ),\n single(re`\\[\\[(${UNTIL_DOUBLE_CLOSE}+)\\]\\]`, {\n scopes: [SCOPES.bold],\n captures: { 1: readAs(include(\"inline-in-emphasis\")) },\n }),\n]\n\n/** `[$ x^2]`. Its body is TeX, not notation, and may hold brackets of its own. */\nconst formulaRule: Pattern = region({\n scopes: [SCOPES.formula],\n begin: re`\\[(?=\\$)${CLOSES}`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n})\n\n/**\n * Brackets whose body holds no brackets, tried in the parser's order: an icon before a\n * URL before an image path before a project link, and anything left is a page link.\n */\nconst simpleTargetRules = (allowImagePath: boolean): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(single(re`\\[[^\\[\\]]+\\.icon(?:\\*\\d+)?\\]`, { scopes: [SCOPES.icon] })),\n // Only URLs, and one of them an image: the image, linking to another URL if there is one.\n Option.some(\n single(re`\\[\\s*(?:${URL}\\s+)*(?:${IMAGE_URL})(?=[\\s\\]])(?:\\s+${URL})*\\s*\\]`, {\n scopes: [SCOPES.image],\n }),\n ),\n // Any other URL makes a link, labelled or not.\n Option.some(single(re`\\[[^\\[\\]]*${URL}[^\\[\\]]*\\]`, { scopes: [SCOPES.externalLink] })),\n // `[a.png]`, but not inside emphasis: there Cosense links to a page of that name.\n onlyIf(allowImagePath, single(re`\\[[^\\[\\]]*${IMAGE_EXT}\\]`, { scopes: [SCOPES.image] })),\n Option.some(single(re`\\[/[^\\[\\]]*\\]`, { scopes: [SCOPES.projectLink] })),\n Option.some(single(re`\\[(?=[^\\[\\]]*[^\\s\\[\\]])[^\\[\\]]+\\]`, { scopes: [SCOPES.link] })),\n ])\n\n/** What follows the bracketed notation in both contexts, in the parser's order. */\nconst unbracketedRules: ReadonlyArray<Pattern> = [\n single(Regex(\"`[^`]*`\"), { scopes: [SCOPES.code] }),\n // `#tag`, only at the start or after a space: a `#` inside a word is just a character.\n single(re`(?:^|(?<=[ \\t\\u3000]))#[^\\s\\[\\]#]+`, { scopes: [SCOPES.hashtag] }),\n // A URL outside brackets is always a link, even to an image.\n single(re`(?i:https?)://[^\\s\\]]+`, { scopes: [SCOPES.externalLink] }),\n]\n\n// --- Lines and blocks -------------------------------------------------------------------\n\n/**\n * A block is its header and every line indented deeper. Deeper is approximated as\n * \"the header's indentation, then more\", which is exact when a page indents one way.\n */\nconst block = (keyword: \"code\" | \"table\", scope: Scope, patterns: ReadonlyArray<Pattern>) =>\n region({\n scopes: [scope],\n begin: re`^(${INDENT})(${Regex(keyword)}:)(.+)$`,\n beginCaptures: {\n 2: scoped(\"keyword.other.block.cosense\"),\n 3: scoped(\"entity.name.section.block.cosense\"),\n },\n end: re`^(?!\\1[ \\t\\u3000])`,\n patterns,\n })\n\n/**\n * The first line is the title, unless the file opens with YAML: then it is the first line\n * after the fence. Nothing on the title line is notation. In `.csnx` a first line that is\n * a component tag is that tag, and the page has no title line.\n */\nconst head = (dialect: DialectInfo): Pattern => {\n const notComponent = dialect.components ? re`(?!${COMPONENT_LINE})` : re``\n return group([\n region({\n begin: re`\\A(?=---[ \\t]*$)`,\n patterns: [include(\"frontmatter\")],\n // Ends on the line after the fence either way; only a title line is captured.\n end: dialect.components ? re`^(?:(?=${COMPONENT_LINE})|(.*)$)` : re`^(.*)$`,\n endCaptures: { 1: scoped(SCOPES.title) },\n // At the very start the fence and the title line both match: the fence wins.\n endPatternLast: true,\n }),\n single(re`\\A${notComponent}.*$`, { scopes: [SCOPES.title] }),\n ])\n}\n\n/** Every other entry the grammar can `include`. The mapped type makes a missing one an error. */\nconst REPOSITORY: { readonly [K in Exclude<RepositoryKey, \"head\">]: Pattern } = {\n frontmatter: region({\n scopes: [SCOPES.frontmatter],\n begin: re`\\A---[ \\t]*$`,\n end: re`^---[ \\t]*$`,\n }),\n \"code-block\": block(\"code\", SCOPES.codeBlock, []),\n \"table-block\": block(\"table\", SCOPES.table, [\n single(re`\\t`, { scopes: [\"punctuation.separator.table-cell.cosense\"] }),\n ]),\n // A component tag owns its line: nothing on it is Cosense notation, and the text after\n // the tag is plain.\n component: region({\n scopes: [\"meta.tag.component.cosense\"],\n begin: re`^(?=${COMPONENT_LINE})`,\n end: re`$`,\n patterns: [include(\"component-tag\")],\n }),\n // The tag itself, read as JSX.\n \"component-tag\": region({\n begin: re`^(\\s*)(</?)([A-Z][A-Za-z0-9_.]*)`,\n beginCaptures: {\n 2: scoped(\"punctuation.definition.tag.begin.cosense\"),\n 3: scoped(SCOPES.component),\n },\n end: re`(/?>)|(?=$)`,\n endCaptures: { 1: scoped(\"punctuation.definition.tag.end.cosense\") },\n patterns: [\n single(re`[A-Za-z_:][A-Za-z0-9_:.\\-]*`, { scopes: [SCOPES.attribute] }),\n single(re`=`, { scopes: [\"punctuation.separator.key-value.cosense\"] }),\n single(re`\"[^\"]*(?:\"|$)|'[^']*(?:'|$)`, { scopes: [SCOPES.attributeValue] }),\n include(\"expression\"),\n ],\n }),\n // `{...}`: a JavaScript expression. Braces nest; a few literals are told apart.\n expression: region({\n scopes: [SCOPES.expression],\n begin: re`\\{`,\n end: re`\\}|(?=$)`,\n beginCaptures: { 0: scoped(\"punctuation.section.embedded.begin.cosense\") },\n endCaptures: { 0: scoped(\"punctuation.section.embedded.end.cosense\") },\n patterns: [\n include(\"expression\"),\n single(re`\"[^\"]*\"|'[^']*'`, { scopes: [\"string.quoted.cosense\"] }),\n single(re`\\b\\d+(?:\\.\\d+)?\\b`, { scopes: [\"constant.numeric.cosense\"] }),\n single(re`\\b(?:true|false|null|undefined)\\b`, { scopes: [\"constant.language.cosense\"] }),\n ],\n }),\n quote: region({\n scopes: [\"markup.quote.cosense\"],\n begin: re`^${INDENT}(>[> ]*)`,\n beginCaptures: { 1: scoped(SCOPES.quote) },\n end: re`$`,\n patterns: [include(\"inline\")],\n }),\n inline: group([\n ...strongRules,\n formulaRule,\n ...emphasisRules,\n ...simpleTargetRules(true),\n ...unbracketedRules,\n ]),\n \"inline-in-emphasis\": group([\n ...strongRules,\n formulaRule,\n ...simpleTargetRules(false),\n ...unbracketedRules,\n ]),\n // A bracket that is no notation, but whose `]` must not close the one around it:\n // in `[* a [] b]` the emphasis runs to the last `]`, as the parser counts depth.\n \"nested-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"inline-in-emphasis\"), include(\"nested-bracket\")],\n }),\n \"bare-bracket\": region({\n begin: re`\\[`,\n end: CLOSE_ON_LINE,\n patterns: [include(\"bare-bracket\")],\n }),\n}\n\n// --- Encoding ---------------------------------------------------------------------------\n\n/** A field only when there is something to put in it: TextMate reads absent and empty alike. */\nconst field = <K extends keyof Rule>(key: K, value: Option.Option<Rule[K]>): Partial<Rule> =>\n Option.match(value, { onNone: () => ({}), onSome: (v) => ({ [key]: v }) })\n\nconst nonEmpty = <A>(items: ReadonlyArray<A>): Option.Option<ReadonlyArray<A>> =>\n Option.liftPredicate(items, (list) => list.length > 0)\n\n/** TextMate gives a rule several scopes by separating them with spaces. */\nconst nameField = (scopes: ReadonlyArray<Scope>): Partial<Rule> =>\n field(\n \"name\",\n Option.map(nonEmpty(scopes), (list) => list.join(\" \")),\n )\n\nconst patternsField = (patterns: ReadonlyArray<Pattern>): Partial<Rule> =>\n field(\"patterns\", Option.map(nonEmpty(patterns), Arr.map(encode)))\n\nconst encodeCaptures = (captures: Captures): Option.Option<Record<string, Rule>> =>\n pipe(\n Object.entries(captures),\n Arr.map(\n ([group, capture]) =>\n [group, { ...nameField(capture.scopes), ...patternsField(capture.patterns) }] as const,\n ),\n nonEmpty,\n Option.map(Rec.fromEntries),\n )\n\nconst encode = (pattern: Pattern): Rule =>\n Match.value(pattern).pipe(\n Match.tag(\"Include\", ({ key }) => ({ include: `#${key}` })),\n Match.tag(\"Group\", ({ patterns }) => patternsField(patterns)),\n Match.tag(\"Single\", (rule) => ({\n ...nameField(rule.scopes),\n match: rule.regex,\n ...field(\"captures\", encodeCaptures(rule.captures)),\n })),\n Match.tag(\"Region\", (rule) => ({\n ...nameField(rule.scopes),\n begin: rule.begin,\n end: rule.end,\n ...field(\"beginCaptures\", encodeCaptures(rule.beginCaptures)),\n ...field(\"endCaptures\", encodeCaptures(rule.endCaptures)),\n ...patternsField(rule.patterns),\n ...field(\"applyEndPatternLast\", onlyIf(rule.endPatternLast, true)),\n })),\n Match.exhaustive,\n )\n\n// --- Dialects ---------------------------------------------------------------------------\n\n/** `.csn`, and `.csnx`, which also reads a line that is one component tag. */\nexport type Dialect = \"cosense\" | \"cosense-x\"\n\ninterface DialectInfo {\n readonly displayName: string\n readonly extension: string\n readonly components: boolean\n}\n\nconst DIALECTS: { readonly [D in Dialect]: DialectInfo } = {\n cosense: { displayName: \"Cosense\", extension: \"csn\", components: false },\n \"cosense-x\": { displayName: \"Cosense X\", extension: \"csnx\", components: true },\n}\n\n/** What a line can be, in the order the parser decides it. */\nconst linePatterns = (dialect: DialectInfo): ReadonlyArray<Pattern> =>\n Arr.getSomes([\n Option.some(include(\"head\")),\n Option.some(include(\"code-block\")),\n Option.some(include(\"table-block\")),\n onlyIf(dialect.components, include(\"component\")),\n Option.some(include(\"quote\")),\n Option.some(include(\"inline\")),\n ])\n\nexport const buildGrammar = (dialect: Dialect): Grammar => {\n const info = DIALECTS[dialect]\n return {\n name: dialect,\n displayName: info.displayName,\n scopeName: `text.${dialect}`,\n aliases: [info.extension],\n fileTypes: [info.extension],\n patterns: Arr.map(linePatterns(info), encode),\n repository: Rec.map({ head: head(info), ...REPOSITORY }, encode),\n }\n}\n","/**\n * TextMate grammars for Cosense notation: `.csn` and, with component lines, `.csnx`.\n *\n * Each export is a Shiki `LanguageRegistration` as it stands, and the same objects are\n * published as `.tmLanguage.json` for editors that read TextMate grammars.\n */\nimport { buildGrammar, type Grammar } from \"./grammar\"\n\nexport type { Dialect, Grammar, Rule } from \"./grammar\"\nexport { type Notation, SCOPES } from \"./scopes\"\n\nexport const cosense: Grammar = buildGrammar(\"cosense\")\n\nexport const cosenseX: Grammar = buildGrammar(\"cosense-x\")\n"],"mappings":";;;;;;;;;;AAcA,MAAa,SAAS;CACpB,OAAO;CACP,MAAM;CACN,aAAa;CACb,cAAc;CACd,SAAS;CACT,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;CAGN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,WAAW;CACX,OAAO;CACP,OAAO;CAEP,OAAO;CACP,OAAO;CAGP,WAAW;CACX,WAAW;CACX,gBAA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AAS;AAEtD,MAAa,WAAoB,aAAa,WAAW"}
|
|
@@ -209,9 +209,21 @@
|
|
|
209
209
|
}
|
|
210
210
|
]
|
|
211
211
|
},
|
|
212
|
+
{
|
|
213
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
214
|
+
"end": "\\]|(?=$)",
|
|
215
|
+
"patterns": [
|
|
216
|
+
{
|
|
217
|
+
"include": "#inline-in-emphasis"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"include": "#nested-bracket"
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
},
|
|
212
224
|
{
|
|
213
225
|
"name": "markup.underline.cosense",
|
|
214
|
-
"begin": "\\[(?![
|
|
226
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
215
227
|
"end": "\\]|(?=$)",
|
|
216
228
|
"patterns": [
|
|
217
229
|
{
|
|
@@ -224,7 +236,7 @@
|
|
|
224
236
|
},
|
|
225
237
|
{
|
|
226
238
|
"name": "markup.strikethrough.cosense",
|
|
227
|
-
"begin": "\\[(?![
|
|
239
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
228
240
|
"end": "\\]|(?=$)",
|
|
229
241
|
"patterns": [
|
|
230
242
|
{
|
|
@@ -237,7 +249,7 @@
|
|
|
237
249
|
},
|
|
238
250
|
{
|
|
239
251
|
"name": "markup.underline.cosense markup.strikethrough.cosense",
|
|
240
|
-
"begin": "\\[(?![
|
|
252
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
241
253
|
"end": "\\]|(?=$)",
|
|
242
254
|
"patterns": [
|
|
243
255
|
{
|
|
@@ -250,7 +262,7 @@
|
|
|
250
262
|
},
|
|
251
263
|
{
|
|
252
264
|
"name": "markup.italic.cosense",
|
|
253
|
-
"begin": "\\[(?![
|
|
265
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
254
266
|
"end": "\\]|(?=$)",
|
|
255
267
|
"patterns": [
|
|
256
268
|
{
|
|
@@ -263,7 +275,7 @@
|
|
|
263
275
|
},
|
|
264
276
|
{
|
|
265
277
|
"name": "markup.underline.cosense markup.italic.cosense",
|
|
266
|
-
"begin": "\\[(?![
|
|
278
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
267
279
|
"end": "\\]|(?=$)",
|
|
268
280
|
"patterns": [
|
|
269
281
|
{
|
|
@@ -276,7 +288,7 @@
|
|
|
276
288
|
},
|
|
277
289
|
{
|
|
278
290
|
"name": "markup.strikethrough.cosense markup.italic.cosense",
|
|
279
|
-
"begin": "\\[(?![
|
|
291
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
280
292
|
"end": "\\]|(?=$)",
|
|
281
293
|
"patterns": [
|
|
282
294
|
{
|
|
@@ -289,7 +301,7 @@
|
|
|
289
301
|
},
|
|
290
302
|
{
|
|
291
303
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense",
|
|
292
|
-
"begin": "\\[(?![
|
|
304
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
293
305
|
"end": "\\]|(?=$)",
|
|
294
306
|
"patterns": [
|
|
295
307
|
{
|
|
@@ -302,7 +314,7 @@
|
|
|
302
314
|
},
|
|
303
315
|
{
|
|
304
316
|
"name": "markup.bold.cosense",
|
|
305
|
-
"begin": "\\[(?=(?:[
|
|
317
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
306
318
|
"end": "\\]|(?=$)",
|
|
307
319
|
"patterns": [
|
|
308
320
|
{
|
|
@@ -315,7 +327,7 @@
|
|
|
315
327
|
},
|
|
316
328
|
{
|
|
317
329
|
"name": "markup.underline.cosense markup.bold.cosense",
|
|
318
|
-
"begin": "\\[(?=(?:[
|
|
330
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
319
331
|
"end": "\\]|(?=$)",
|
|
320
332
|
"patterns": [
|
|
321
333
|
{
|
|
@@ -328,7 +340,7 @@
|
|
|
328
340
|
},
|
|
329
341
|
{
|
|
330
342
|
"name": "markup.strikethrough.cosense markup.bold.cosense",
|
|
331
|
-
"begin": "\\[(?=(?:[
|
|
343
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
332
344
|
"end": "\\]|(?=$)",
|
|
333
345
|
"patterns": [
|
|
334
346
|
{
|
|
@@ -341,7 +353,7 @@
|
|
|
341
353
|
},
|
|
342
354
|
{
|
|
343
355
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.cosense",
|
|
344
|
-
"begin": "\\[(?=(?:[
|
|
356
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
345
357
|
"end": "\\]|(?=$)",
|
|
346
358
|
"patterns": [
|
|
347
359
|
{
|
|
@@ -354,7 +366,7 @@
|
|
|
354
366
|
},
|
|
355
367
|
{
|
|
356
368
|
"name": "markup.italic.cosense markup.bold.cosense",
|
|
357
|
-
"begin": "\\[(?=(?:[
|
|
369
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
358
370
|
"end": "\\]|(?=$)",
|
|
359
371
|
"patterns": [
|
|
360
372
|
{
|
|
@@ -367,7 +379,7 @@
|
|
|
367
379
|
},
|
|
368
380
|
{
|
|
369
381
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.cosense",
|
|
370
|
-
"begin": "\\[(?=(?:[
|
|
382
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
371
383
|
"end": "\\]|(?=$)",
|
|
372
384
|
"patterns": [
|
|
373
385
|
{
|
|
@@ -380,7 +392,7 @@
|
|
|
380
392
|
},
|
|
381
393
|
{
|
|
382
394
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
383
|
-
"begin": "\\[(?=(?:[
|
|
395
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
384
396
|
"end": "\\]|(?=$)",
|
|
385
397
|
"patterns": [
|
|
386
398
|
{
|
|
@@ -393,7 +405,7 @@
|
|
|
393
405
|
},
|
|
394
406
|
{
|
|
395
407
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
396
|
-
"begin": "\\[(?=(?:[
|
|
408
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
397
409
|
"end": "\\]|(?=$)",
|
|
398
410
|
"patterns": [
|
|
399
411
|
{
|
|
@@ -406,7 +418,7 @@
|
|
|
406
418
|
},
|
|
407
419
|
{
|
|
408
420
|
"name": "markup.bold.level2.cosense",
|
|
409
|
-
"begin": "\\[(?=(?:[
|
|
421
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
410
422
|
"end": "\\]|(?=$)",
|
|
411
423
|
"patterns": [
|
|
412
424
|
{
|
|
@@ -419,7 +431,7 @@
|
|
|
419
431
|
},
|
|
420
432
|
{
|
|
421
433
|
"name": "markup.underline.cosense markup.bold.level2.cosense",
|
|
422
|
-
"begin": "\\[(?=(?:[
|
|
434
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
423
435
|
"end": "\\]|(?=$)",
|
|
424
436
|
"patterns": [
|
|
425
437
|
{
|
|
@@ -432,7 +444,7 @@
|
|
|
432
444
|
},
|
|
433
445
|
{
|
|
434
446
|
"name": "markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
435
|
-
"begin": "\\[(?=(?:[
|
|
447
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
436
448
|
"end": "\\]|(?=$)",
|
|
437
449
|
"patterns": [
|
|
438
450
|
{
|
|
@@ -445,7 +457,7 @@
|
|
|
445
457
|
},
|
|
446
458
|
{
|
|
447
459
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
448
|
-
"begin": "\\[(?=(?:[
|
|
460
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
449
461
|
"end": "\\]|(?=$)",
|
|
450
462
|
"patterns": [
|
|
451
463
|
{
|
|
@@ -458,7 +470,7 @@
|
|
|
458
470
|
},
|
|
459
471
|
{
|
|
460
472
|
"name": "markup.italic.cosense markup.bold.level2.cosense",
|
|
461
|
-
"begin": "\\[(?=(?:[
|
|
473
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
462
474
|
"end": "\\]|(?=$)",
|
|
463
475
|
"patterns": [
|
|
464
476
|
{
|
|
@@ -471,7 +483,7 @@
|
|
|
471
483
|
},
|
|
472
484
|
{
|
|
473
485
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
474
|
-
"begin": "\\[(?=(?:[
|
|
486
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
475
487
|
"end": "\\]|(?=$)",
|
|
476
488
|
"patterns": [
|
|
477
489
|
{
|
|
@@ -484,7 +496,7 @@
|
|
|
484
496
|
},
|
|
485
497
|
{
|
|
486
498
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
487
|
-
"begin": "\\[(?=(?:[
|
|
499
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
488
500
|
"end": "\\]|(?=$)",
|
|
489
501
|
"patterns": [
|
|
490
502
|
{
|
|
@@ -497,7 +509,7 @@
|
|
|
497
509
|
},
|
|
498
510
|
{
|
|
499
511
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
500
|
-
"begin": "\\[(?=(?:[
|
|
512
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
501
513
|
"end": "\\]|(?=$)",
|
|
502
514
|
"patterns": [
|
|
503
515
|
{
|
|
@@ -510,7 +522,7 @@
|
|
|
510
522
|
},
|
|
511
523
|
{
|
|
512
524
|
"name": "markup.bold.level3.cosense",
|
|
513
|
-
"begin": "\\[(?=(?:[
|
|
525
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
514
526
|
"end": "\\]|(?=$)",
|
|
515
527
|
"patterns": [
|
|
516
528
|
{
|
|
@@ -523,7 +535,7 @@
|
|
|
523
535
|
},
|
|
524
536
|
{
|
|
525
537
|
"name": "markup.underline.cosense markup.bold.level3.cosense",
|
|
526
|
-
"begin": "\\[(?=(?:[
|
|
538
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
527
539
|
"end": "\\]|(?=$)",
|
|
528
540
|
"patterns": [
|
|
529
541
|
{
|
|
@@ -536,7 +548,7 @@
|
|
|
536
548
|
},
|
|
537
549
|
{
|
|
538
550
|
"name": "markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
539
|
-
"begin": "\\[(?=(?:[
|
|
551
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
540
552
|
"end": "\\]|(?=$)",
|
|
541
553
|
"patterns": [
|
|
542
554
|
{
|
|
@@ -549,7 +561,7 @@
|
|
|
549
561
|
},
|
|
550
562
|
{
|
|
551
563
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
552
|
-
"begin": "\\[(?=(?:[
|
|
564
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
553
565
|
"end": "\\]|(?=$)",
|
|
554
566
|
"patterns": [
|
|
555
567
|
{
|
|
@@ -562,7 +574,7 @@
|
|
|
562
574
|
},
|
|
563
575
|
{
|
|
564
576
|
"name": "markup.italic.cosense markup.bold.level3.cosense",
|
|
565
|
-
"begin": "\\[(?=(?:[
|
|
577
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
566
578
|
"end": "\\]|(?=$)",
|
|
567
579
|
"patterns": [
|
|
568
580
|
{
|
|
@@ -575,7 +587,7 @@
|
|
|
575
587
|
},
|
|
576
588
|
{
|
|
577
589
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
578
|
-
"begin": "\\[(?=(?:[
|
|
590
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
579
591
|
"end": "\\]|(?=$)",
|
|
580
592
|
"patterns": [
|
|
581
593
|
{
|
|
@@ -588,7 +600,7 @@
|
|
|
588
600
|
},
|
|
589
601
|
{
|
|
590
602
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
591
|
-
"begin": "\\[(?=(?:[
|
|
603
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
592
604
|
"end": "\\]|(?=$)",
|
|
593
605
|
"patterns": [
|
|
594
606
|
{
|
|
@@ -601,7 +613,7 @@
|
|
|
601
613
|
},
|
|
602
614
|
{
|
|
603
615
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
604
|
-
"begin": "\\[(?=(?:[
|
|
616
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
605
617
|
"end": "\\]|(?=$)",
|
|
606
618
|
"patterns": [
|
|
607
619
|
{
|
|
@@ -206,9 +206,21 @@
|
|
|
206
206
|
}
|
|
207
207
|
]
|
|
208
208
|
},
|
|
209
|
+
{
|
|
210
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
211
|
+
"end": "\\]|(?=$)",
|
|
212
|
+
"patterns": [
|
|
213
|
+
{
|
|
214
|
+
"include": "#inline-in-emphasis"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"include": "#nested-bracket"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
209
221
|
{
|
|
210
222
|
"name": "markup.underline.cosense",
|
|
211
|
-
"begin": "\\[(?![
|
|
223
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
212
224
|
"end": "\\]|(?=$)",
|
|
213
225
|
"patterns": [
|
|
214
226
|
{
|
|
@@ -221,7 +233,7 @@
|
|
|
221
233
|
},
|
|
222
234
|
{
|
|
223
235
|
"name": "markup.strikethrough.cosense",
|
|
224
|
-
"begin": "\\[(?![
|
|
236
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
225
237
|
"end": "\\]|(?=$)",
|
|
226
238
|
"patterns": [
|
|
227
239
|
{
|
|
@@ -234,7 +246,7 @@
|
|
|
234
246
|
},
|
|
235
247
|
{
|
|
236
248
|
"name": "markup.underline.cosense markup.strikethrough.cosense",
|
|
237
|
-
"begin": "\\[(?![
|
|
249
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
238
250
|
"end": "\\]|(?=$)",
|
|
239
251
|
"patterns": [
|
|
240
252
|
{
|
|
@@ -247,7 +259,7 @@
|
|
|
247
259
|
},
|
|
248
260
|
{
|
|
249
261
|
"name": "markup.italic.cosense",
|
|
250
|
-
"begin": "\\[(?![
|
|
262
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
251
263
|
"end": "\\]|(?=$)",
|
|
252
264
|
"patterns": [
|
|
253
265
|
{
|
|
@@ -260,7 +272,7 @@
|
|
|
260
272
|
},
|
|
261
273
|
{
|
|
262
274
|
"name": "markup.underline.cosense markup.italic.cosense",
|
|
263
|
-
"begin": "\\[(?![
|
|
275
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
264
276
|
"end": "\\]|(?=$)",
|
|
265
277
|
"patterns": [
|
|
266
278
|
{
|
|
@@ -273,7 +285,7 @@
|
|
|
273
285
|
},
|
|
274
286
|
{
|
|
275
287
|
"name": "markup.strikethrough.cosense markup.italic.cosense",
|
|
276
|
-
"begin": "\\[(?![
|
|
288
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
277
289
|
"end": "\\]|(?=$)",
|
|
278
290
|
"patterns": [
|
|
279
291
|
{
|
|
@@ -286,7 +298,7 @@
|
|
|
286
298
|
},
|
|
287
299
|
{
|
|
288
300
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense",
|
|
289
|
-
"begin": "\\[(?![
|
|
301
|
+
"begin": "\\[(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\*)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
290
302
|
"end": "\\]|(?=$)",
|
|
291
303
|
"patterns": [
|
|
292
304
|
{
|
|
@@ -299,7 +311,7 @@
|
|
|
299
311
|
},
|
|
300
312
|
{
|
|
301
313
|
"name": "markup.bold.cosense",
|
|
302
|
-
"begin": "\\[(?=(?:[
|
|
314
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
303
315
|
"end": "\\]|(?=$)",
|
|
304
316
|
"patterns": [
|
|
305
317
|
{
|
|
@@ -312,7 +324,7 @@
|
|
|
312
324
|
},
|
|
313
325
|
{
|
|
314
326
|
"name": "markup.underline.cosense markup.bold.cosense",
|
|
315
|
-
"begin": "\\[(?=(?:[
|
|
327
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
316
328
|
"end": "\\]|(?=$)",
|
|
317
329
|
"patterns": [
|
|
318
330
|
{
|
|
@@ -325,7 +337,7 @@
|
|
|
325
337
|
},
|
|
326
338
|
{
|
|
327
339
|
"name": "markup.strikethrough.cosense markup.bold.cosense",
|
|
328
|
-
"begin": "\\[(?=(?:[
|
|
340
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
329
341
|
"end": "\\]|(?=$)",
|
|
330
342
|
"patterns": [
|
|
331
343
|
{
|
|
@@ -338,7 +350,7 @@
|
|
|
338
350
|
},
|
|
339
351
|
{
|
|
340
352
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.cosense",
|
|
341
|
-
"begin": "\\[(?=(?:[
|
|
353
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
342
354
|
"end": "\\]|(?=$)",
|
|
343
355
|
"patterns": [
|
|
344
356
|
{
|
|
@@ -351,7 +363,7 @@
|
|
|
351
363
|
},
|
|
352
364
|
{
|
|
353
365
|
"name": "markup.italic.cosense markup.bold.cosense",
|
|
354
|
-
"begin": "\\[(?=(?:[
|
|
366
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
355
367
|
"end": "\\]|(?=$)",
|
|
356
368
|
"patterns": [
|
|
357
369
|
{
|
|
@@ -364,7 +376,7 @@
|
|
|
364
376
|
},
|
|
365
377
|
{
|
|
366
378
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.cosense",
|
|
367
|
-
"begin": "\\[(?=(?:[
|
|
379
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
368
380
|
"end": "\\]|(?=$)",
|
|
369
381
|
"patterns": [
|
|
370
382
|
{
|
|
@@ -377,7 +389,7 @@
|
|
|
377
389
|
},
|
|
378
390
|
{
|
|
379
391
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
380
|
-
"begin": "\\[(?=(?:[
|
|
392
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
381
393
|
"end": "\\]|(?=$)",
|
|
382
394
|
"patterns": [
|
|
383
395
|
{
|
|
@@ -390,7 +402,7 @@
|
|
|
390
402
|
},
|
|
391
403
|
{
|
|
392
404
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.cosense",
|
|
393
|
-
"begin": "\\[(?=(?:[
|
|
405
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){1}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
394
406
|
"end": "\\]|(?=$)",
|
|
395
407
|
"patterns": [
|
|
396
408
|
{
|
|
@@ -403,7 +415,7 @@
|
|
|
403
415
|
},
|
|
404
416
|
{
|
|
405
417
|
"name": "markup.bold.level2.cosense",
|
|
406
|
-
"begin": "\\[(?=(?:[
|
|
418
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
407
419
|
"end": "\\]|(?=$)",
|
|
408
420
|
"patterns": [
|
|
409
421
|
{
|
|
@@ -416,7 +428,7 @@
|
|
|
416
428
|
},
|
|
417
429
|
{
|
|
418
430
|
"name": "markup.underline.cosense markup.bold.level2.cosense",
|
|
419
|
-
"begin": "\\[(?=(?:[
|
|
431
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
420
432
|
"end": "\\]|(?=$)",
|
|
421
433
|
"patterns": [
|
|
422
434
|
{
|
|
@@ -429,7 +441,7 @@
|
|
|
429
441
|
},
|
|
430
442
|
{
|
|
431
443
|
"name": "markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
432
|
-
"begin": "\\[(?=(?:[
|
|
444
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
433
445
|
"end": "\\]|(?=$)",
|
|
434
446
|
"patterns": [
|
|
435
447
|
{
|
|
@@ -442,7 +454,7 @@
|
|
|
442
454
|
},
|
|
443
455
|
{
|
|
444
456
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level2.cosense",
|
|
445
|
-
"begin": "\\[(?=(?:[
|
|
457
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
446
458
|
"end": "\\]|(?=$)",
|
|
447
459
|
"patterns": [
|
|
448
460
|
{
|
|
@@ -455,7 +467,7 @@
|
|
|
455
467
|
},
|
|
456
468
|
{
|
|
457
469
|
"name": "markup.italic.cosense markup.bold.level2.cosense",
|
|
458
|
-
"begin": "\\[(?=(?:[
|
|
470
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
459
471
|
"end": "\\]|(?=$)",
|
|
460
472
|
"patterns": [
|
|
461
473
|
{
|
|
@@ -468,7 +480,7 @@
|
|
|
468
480
|
},
|
|
469
481
|
{
|
|
470
482
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
471
|
-
"begin": "\\[(?=(?:[
|
|
483
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
472
484
|
"end": "\\]|(?=$)",
|
|
473
485
|
"patterns": [
|
|
474
486
|
{
|
|
@@ -481,7 +493,7 @@
|
|
|
481
493
|
},
|
|
482
494
|
{
|
|
483
495
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
484
|
-
"begin": "\\[(?=(?:[
|
|
496
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
485
497
|
"end": "\\]|(?=$)",
|
|
486
498
|
"patterns": [
|
|
487
499
|
{
|
|
@@ -494,7 +506,7 @@
|
|
|
494
506
|
},
|
|
495
507
|
{
|
|
496
508
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level2.cosense",
|
|
497
|
-
"begin": "\\[(?=(?:[
|
|
509
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){2}[!\"#%&'()+,\\-./{|}<>_~=]*\\s)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
498
510
|
"end": "\\]|(?=$)",
|
|
499
511
|
"patterns": [
|
|
500
512
|
{
|
|
@@ -507,7 +519,7 @@
|
|
|
507
519
|
},
|
|
508
520
|
{
|
|
509
521
|
"name": "markup.bold.level3.cosense",
|
|
510
|
-
"begin": "\\[(?=(?:[
|
|
522
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
511
523
|
"end": "\\]|(?=$)",
|
|
512
524
|
"patterns": [
|
|
513
525
|
{
|
|
@@ -520,7 +532,7 @@
|
|
|
520
532
|
},
|
|
521
533
|
{
|
|
522
534
|
"name": "markup.underline.cosense markup.bold.level3.cosense",
|
|
523
|
-
"begin": "\\[(?=(?:[
|
|
535
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
524
536
|
"end": "\\]|(?=$)",
|
|
525
537
|
"patterns": [
|
|
526
538
|
{
|
|
@@ -533,7 +545,7 @@
|
|
|
533
545
|
},
|
|
534
546
|
{
|
|
535
547
|
"name": "markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
536
|
-
"begin": "\\[(?=(?:[
|
|
548
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
537
549
|
"end": "\\]|(?=$)",
|
|
538
550
|
"patterns": [
|
|
539
551
|
{
|
|
@@ -546,7 +558,7 @@
|
|
|
546
558
|
},
|
|
547
559
|
{
|
|
548
560
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.bold.level3.cosense",
|
|
549
|
-
"begin": "\\[(?=(?:[
|
|
561
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?![!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
550
562
|
"end": "\\]|(?=$)",
|
|
551
563
|
"patterns": [
|
|
552
564
|
{
|
|
@@ -559,7 +571,7 @@
|
|
|
559
571
|
},
|
|
560
572
|
{
|
|
561
573
|
"name": "markup.italic.cosense markup.bold.level3.cosense",
|
|
562
|
-
"begin": "\\[(?=(?:[
|
|
574
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
563
575
|
"end": "\\]|(?=$)",
|
|
564
576
|
"patterns": [
|
|
565
577
|
{
|
|
@@ -572,7 +584,7 @@
|
|
|
572
584
|
},
|
|
573
585
|
{
|
|
574
586
|
"name": "markup.underline.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
575
|
-
"begin": "\\[(?=(?:[
|
|
587
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
576
588
|
"end": "\\]|(?=$)",
|
|
577
589
|
"patterns": [
|
|
578
590
|
{
|
|
@@ -585,7 +597,7 @@
|
|
|
585
597
|
},
|
|
586
598
|
{
|
|
587
599
|
"name": "markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
588
|
-
"begin": "\\[(?=(?:[
|
|
600
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?![!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
589
601
|
"end": "\\]|(?=$)",
|
|
590
602
|
"patterns": [
|
|
591
603
|
{
|
|
@@ -598,7 +610,7 @@
|
|
|
598
610
|
},
|
|
599
611
|
{
|
|
600
612
|
"name": "markup.underline.cosense markup.strikethrough.cosense markup.italic.cosense markup.bold.level3.cosense",
|
|
601
|
-
"begin": "\\[(?=(?:[
|
|
613
|
+
"begin": "\\[(?=(?:[!\"#%&'()+,\\-./{|}<>_~=]*\\*){3})(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?/)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?\\-)(?=[!\"#%&'()*+,\\-./{|}<>_~=]*?_)(?=[!\"#%&'()*+,\\-./{|}<>_~=]+\\s.*\\])[!\"#%&'()*+,\\-./{|}<>_~=]+\\s+",
|
|
602
614
|
"end": "\\]|(?=$)",
|
|
603
615
|
"patterns": [
|
|
604
616
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosense-toolbox/textmate",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TextMate grammars for Cosense notation (.csn / .csnx), ready for Shiki and VS Code.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"effect": "^3.22.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@cosense-toolbox/lsp": "0.1.0-beta.
|
|
45
|
+
"@cosense-toolbox/lsp": "0.1.0-beta.3",
|
|
46
46
|
"shiki": "^4.4.3",
|
|
47
47
|
"tsdown": "^0.22.14",
|
|
48
48
|
"typescript": "^6.0.0",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public",
|
|
53
|
-
"tag": "beta",
|
|
54
53
|
"registry": "https://registry.npmjs.org/"
|
|
55
54
|
}
|
|
56
55
|
}
|