diff --git a/nix/renderMarkdown/default.nix b/nix/renderMarkdown/default.nix deleted file mode 100644 index 8759ada0f..000000000 --- a/nix/renderMarkdown/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -# Render a Markdown file to HTML. -{ depot, pkgs, ... }: - -with depot.nix.yants; - -let - args = struct "args" { - path = path; - tagfilter = option bool; - }; -in -defun [ (either path args) drv ] - (arg: pkgs.runCommand "${arg.path or arg}.rendered.html" { } - ( - let - tagfilter = if (arg.tagfilter or true) then "" else "--no-tagfilter"; - in - '' - cat ${arg.path or arg} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${tagfilter} ${arg.path or arg} > $out - '' - )) diff --git a/nix/utils/tests/default.nix b/nix/utils/tests/default.nix index 344a1771d..32dc11f3a 100644 --- a/nix/utils/tests/default.nix +++ b/nix/utils/tests/default.nix @@ -13,7 +13,6 @@ let isDirectory isRegularFile isSymlink - pathType storePathName ; @@ -71,20 +70,20 @@ let (isSymlink ./does-not-exist)) ]); - cheddarStorePath = - builtins.unsafeDiscardStringContext depot.tools.cheddar.outPath; + magratheaStorePath = + builtins.unsafeDiscardStringContext depot.tools.magrathea.outPath; cleanedSource = lib.cleanSource ./.; storePathNameTests = it "correctly gets the basename of a store path" [ (assertEq "base name of a derivation" - (storePathName depot.tools.cheddar) - depot.tools.cheddar.name) + (storePathName depot.tools.magrathea) + depot.tools.magrathea.name) (assertEq "base name of a store path string" - (storePathName cheddarStorePath) - depot.tools.cheddar.name) + (storePathName magratheaStorePath) + depot.tools.magrathea.name) (assertEq "base name of a path within a store path" - (storePathName "${cheddarStorePath}/bin/cheddar") "cheddar") + (storePathName "${magratheaStorePath}/bin/mg") "mg") (assertEq "base name of a path" (storePathName ../default.nix) "default.nix") (assertEq "base name of a cleanSourced path" diff --git a/third_party/bat_syntaxes/Prolog.sublime-syntax b/third_party/bat_syntaxes/Prolog.sublime-syntax deleted file mode 100644 index b03066ac0..000000000 --- a/third_party/bat_syntaxes/Prolog.sublime-syntax +++ /dev/null @@ -1,1319 +0,0 @@ -# SPDX-License-Identifier: MIT -# Generated from code at https://github.com/BenjaminSchaaf/swi-prolog-sublime-syntax ---- -# http://www.sublimetext.com/docs/3/syntax.html -name: Prolog -file_extensions: - - pl - - pro -first_line_match: '^#!.*\bswipl\b' -scope: source.prolog -contexts: - atom-entity|meta: - - meta_content_scope: entity.name.predicate.prolog - - match: '' - pop: true - atom-functor|meta: - - meta_content_scope: meta.path.prolog variable.function.functor.prolog - - match: '' - pop: true - atom-string|0: - - meta_include_prototype: false - - match: '\\([abcefnrstv''\"`\n\\]|x\h\h+\\?|u\h{4}|U\h{8})' - scope: constant.character.escape.prolog - - match: '''' - pop: true - compound-term|0: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [compound-term|1, value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [compound-term|1, value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [compound-term|1, value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [compound-term|1, value-without-comma|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [compound-term|1, value-without-comma|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [compound-term|1, value-without-comma|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [compound-term|1, value-without-comma|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [compound-term|1, value-without-comma|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [compound-term|1, value-without-comma|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [compound-term|1, value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [compound-term|1, value-without-comma|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [compound-term|1, value-without-comma|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [compound-term|1, value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [compound-term|1, value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [compound-term|1, value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [compound-term|1, value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [compound-term|1, value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [compound-term|1, value-without-comma|0, single-value|2] - - match: '\)' - scope: punctuation.section.parens.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - compound-term|1: - - match: ',' - scope: punctuation.separator.sequence.prolog - push: compound-term|2 - - match: '\)' - scope: punctuation.section.parens.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - compound-term|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: value-without-comma|0 - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: value-without-comma|0 - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: value-without-comma|0 - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: value-without-comma|0 - - match: '_' - scope: language.constant.underscore.prolog - set: value-without-comma|0 - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [value-without-comma|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - fact|0: - - match: ':-' - scope: keyword.operator.definition.begin.prolog - set: fact|1 - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [fact|2, value|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [fact|2, value|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [fact|2, value|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [fact|2, value|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [fact|2, value|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [fact|2, value|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [fact|2, value|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [fact|2, value|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [fact|2, value|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [fact|2, value|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [fact|2, value|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [fact|2, value|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [fact|2, value|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [fact|2, value|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [fact|2, value|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - fact|1: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [fact|2, value|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [fact|2, value|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [fact|2, value|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [fact|2, value|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [fact|2, value|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [fact|2, value|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [fact|2, value|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [fact|2, value|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [fact|2, value|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [fact|2, value|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [fact|2, value|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [fact|2, value|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [fact|2, value|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [fact|2, value|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [fact|2, value|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [fact|2, value|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - fact|2: - - match: '\.' - scope: keyword.operator.definition.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - list|0: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [list|1, value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [list|1, value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [list|1, value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [list|1, value-without-comma|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|1, value-without-comma|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|1, value-without-comma|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|1, value-without-comma|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [list|1, value-without-comma|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [list|1, value-without-comma|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [list|1, value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [list|1, value-without-comma|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [list|1, value-without-comma|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [list|1, value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [list|1, value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [list|1, value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [list|1, value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [list|1, value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [list|1, value-without-comma|0, single-value|2] - - match: '\]' - scope: punctuation.section.brackets.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - list|1: - - match: ',' - scope: punctuation.separator.sequence.prolog - push: list|2 - - match: '\|' - scope: punctuation.separator.sequence.prolog - set: list|3 - - match: '\]' - scope: punctuation.section.brackets.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - list|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: value-without-comma|0 - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: value-without-comma|0 - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: value-without-comma|0 - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: value-without-comma|0 - - match: '_' - scope: language.constant.underscore.prolog - set: value-without-comma|0 - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [value-without-comma|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - list|3: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [list|4, value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [list|4, value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [list|4, value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [list|4, value-without-comma|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|4, value-without-comma|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|4, value-without-comma|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [list|4, value-without-comma|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [list|4, value-without-comma|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [list|4, value-without-comma|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [list|4, value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [list|4, value-without-comma|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [list|4, value-without-comma|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [list|4, value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [list|4, value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [list|4, value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [list|4, value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [list|4, value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [list|4, value-without-comma|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - list|4: - - match: '\]' - scope: punctuation.section.brackets.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - main: - - match: '^#!' - scope: comment.line.number-sign.prolog punctuation.definition.comment.number-sign.prolog - push: shebang|0 - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: entity.name.predicate.prolog - push: rule|0 - - match: '''' - scope: entity.name.predicate.prolog - push: [rule|0, atom-entity|meta, atom-string|0] - - match: '(?=\S)' - push: fact|0 - - match: '\S' - scope: invalid.illegal.prolog - nested-comment|0: - - meta_content_scope: comment.block.nested.prolog - - match: '/\*(\*(?!/))?' - scope: comment.block.nested.prolog punctuation.definition.comment.prolog - push: nested-comment|0 - - match: '\*/' - scope: comment.block.nested.prolog punctuation.definition.comment.prolog - pop: true - number|0: - - match: '[0-9_]+' - scope: constant.numeric.integer.prolog - - match: '(?=\S)' - pop: true - operator-compound-term|0: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [operator-compound-term|1, value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [operator-compound-term|1, value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [operator-compound-term|1, value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [operator-compound-term|1, value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [operator-compound-term|1, value-without-comma|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [operator-compound-term|1, value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [operator-compound-term|1, value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [operator-compound-term|1, value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [operator-compound-term|1, value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [operator-compound-term|1, value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [operator-compound-term|1, value-without-comma|0, single-value|2] - - match: '\)' - scope: punctuation.section.parans.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - operator-compound-term|1: - - match: ',' - scope: punctuation.separator.sequence.prolog - push: operator-compound-term|2 - - match: '\)' - scope: punctuation.section.parans.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - operator-compound-term|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: value-without-comma|0 - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: value-without-comma|0 - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: value-without-comma|0 - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: value-without-comma|0 - - match: '_' - scope: language.constant.underscore.prolog - set: value-without-comma|0 - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [value-without-comma|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - prototype: - - match: '(%+).*\n?' - scope: comment.line.percentage.prolog - captures: - 1: punctuation.definition.comment.prolog - - match: '/\*(\*(?!/))?' - scope: comment.block.nested.prolog punctuation.definition.comment.prolog - push: nested-comment|0 - rule|0: - - match: '\(' - scope: punctuation.section.parens.begin.prolog - set: [rule|1, compound-term|0] - - match: ':-' - scope: keyword.operator.definition.begin.prolog - set: rule|2 - - match: '\.' - scope: keyword.operator.definition.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - rule|1: - - match: ':-' - scope: keyword.operator.definition.begin.prolog - set: rule|2 - - match: '\.' - scope: keyword.operator.definition.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - rule|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [rule|3, value|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [rule|3, value|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [rule|3, value|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [rule|3, value|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [rule|3, value|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [rule|3, value|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [rule|3, value|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [rule|3, value|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [rule|3, value|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [rule|3, value|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [rule|3, value|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [rule|3, value|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [rule|3, value|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [rule|3, value|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [rule|3, value|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [rule|3, value|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [rule|3, value|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [rule|3, value|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - rule|3: - - match: '\.' - scope: keyword.operator.definition.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - set|0: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [set|1, value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [set|1, value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [set|1, value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [set|1, value-without-comma|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [set|1, value-without-comma|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [set|1, value-without-comma|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [set|1, value-without-comma|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [set|1, value-without-comma|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [set|1, value-without-comma|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [set|1, value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [set|1, value-without-comma|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [set|1, value-without-comma|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [set|1, value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [set|1, value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [set|1, value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [set|1, value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [set|1, value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [set|1, value-without-comma|0, single-value|2] - - match: '\}' - scope: punctuation.section.braces.begin.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - set|1: - - match: ',' - scope: punctuation.separator.sequence.prolog - push: set|2 - - match: '\}' - scope: punctuation.section.braces.begin.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - set|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [value-without-comma|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [value-without-comma|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: value-without-comma|0 - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: value-without-comma|0 - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: value-without-comma|0 - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: value-without-comma|0 - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [value-without-comma|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: value-without-comma|0 - - match: '_' - scope: language.constant.underscore.prolog - set: value-without-comma|0 - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [value-without-comma|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [value-without-comma|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [value-without-comma|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [value-without-comma|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [value-without-comma|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [value-without-comma|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - shebang|0: - - meta_content_scope: comment.line.number-sign.prolog - - match: '$\n?' - scope: comment.line.number-sign.prolog - pop: true - single-value|0: - - match: '\(' - scope: punctuation.section.parens.begin.prolog - set: compound-term|0 - - match: '(?=\S)' - pop: true - single-value|1: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: single-value|0 - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: operator-compound-term|0 - - match: '!' - scope: keyword.control.cut.prolog - pop: true - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - pop: true - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - pop: true - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: number|0 - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - pop: true - - match: '_' - scope: language.constant.underscore.prolog - pop: true - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: string|0 - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: list|0 - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: set|0 - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: single-value|1 - - match: '\\\+' - scope: keyword.control.negation.prolog - set: single-value|1 - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: single-value|2 - - match: '\S' - scope: invalid.illegal.prolog - pop: true - single-value|2: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: [single-value|3, value|0, single-value|0] - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [single-value|3, value|0, single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: [single-value|3, value|0, operator-compound-term|0] - - match: '!' - scope: keyword.control.cut.prolog - set: [single-value|3, value|0] - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [single-value|3, value|0] - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [single-value|3, value|0] - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - set: [single-value|3, value|0] - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - set: [single-value|3, value|0] - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - set: [single-value|3, value|0] - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: [single-value|3, value|0, number|0] - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - set: [single-value|3, value|0] - - match: '_' - scope: language.constant.underscore.prolog - set: [single-value|3, value|0] - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: [single-value|3, value|0, string|0] - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: [single-value|3, value|0, list|0] - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: [single-value|3, value|0, set|0] - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: [single-value|3, value|0, single-value|1] - - match: '\\\+' - scope: keyword.control.negation.prolog - set: [single-value|3, value|0, single-value|1] - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: [single-value|3, value|0, single-value|2] - - match: '\S' - scope: invalid.illegal.prolog - pop: true - single-value|3: - - match: '\)' - scope: punctuation.section.group.end.prolog - pop: true - - match: '\S' - scope: invalid.illegal.prolog - pop: true - string|0: - - meta_content_scope: meta.string.prolog string.quoted.double.prolog - - meta_include_prototype: false - - match: '\\([abcefnrstv''\"`\n\\]|x\h\h+\\?|u\h{4}|U\h{8})' - scope: constant.character.escape.prolog - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.end.prolog - pop: true - value-without-comma|0: - - match: '\bis\b|>>|\^|=\.\.|=?<|>=?|==?|\*\*?|\+|->?|/|#=|\\=' - scope: keyword.operator.prolog - push: value-without-comma|1 - - match: ';' - scope: keyword.operator.logical.or.prolog - push: value-without-comma|1 - - match: '->' - scope: keyword.operator.logical.if.prolog - push: value-without-comma|1 - - match: '(?=\S)' - pop: true - value-without-comma|1: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: single-value|0 - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: operator-compound-term|0 - - match: '!' - scope: keyword.control.cut.prolog - pop: true - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - pop: true - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - pop: true - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: number|0 - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - pop: true - - match: '_' - scope: language.constant.underscore.prolog - pop: true - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: string|0 - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: list|0 - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: set|0 - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: single-value|1 - - match: '\\\+' - scope: keyword.control.negation.prolog - set: single-value|1 - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: single-value|2 - - match: '\S' - scope: invalid.illegal.prolog - pop: true - value|0: - - match: '\bis\b|>>|\^|=\.\.|=?<|>=?|==?|\*\*?|\+|->?|/|#=|\\=' - scope: keyword.operator.prolog - push: value|1 - - match: ';' - scope: keyword.operator.logical.or.prolog - push: value|1 - - match: '->' - scope: keyword.operator.logical.if.prolog - push: value|1 - - match: ',' - scope: keyword.operator.logical.and.prolog - push: value|1 - - match: '(?=\S)' - pop: true - value|1: - - match: '\b[a-z][[:alpha:]0-9_]*\b' - scope: meta.path.prolog variable.function.functor.prolog - set: single-value|0 - - match: '''' - scope: meta.path.prolog variable.function.functor.prolog - set: [single-value|0, atom-functor|meta, atom-string|0] - - match: '([~^&*\-+=|\\/<>][~^&*\-+=|\\/<>.,]*)(\()' - captures: - 1: constant.character.swi-prolog.prolog - 2: punctuation.section.parens.begin.prolog - set: operator-compound-term|0 - - match: '!' - scope: keyword.control.cut.prolog - pop: true - - match: '(0b)[01_]+' - scope: constant.numeric.integer.binary.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0x)[\h_]+' - scope: constant.numeric.integer.hexadecimal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '(0o)[0-7_]+' - scope: constant.numeric.integer.octal.prolog - captures: - 1: punctuation.definition.number.base.prolog - pop: true - - match: '([0-9]{1,2})('')[0-9a-z]+' - scope: constant.numeric.integer.prolog - captures: - 1: punctuation.definition.number.base.prolog - 2: punctuation.separator.base.prolog - pop: true - - match: '[0-9]+\.[0-9]+' - scope: constant.numeric.float.prolog - pop: true - - match: '[+-]?[0-9_]+' - scope: constant.numeric.integer.prolog - set: number|0 - - match: '\b[A-Z][[:alpha:]0-9_]*\b|\b_[[:alpha:]0-9_]+\b' - scope: variable.parameter.prolog - pop: true - - match: '_' - scope: language.constant.underscore.prolog - pop: true - - match: '"' - scope: meta.string.prolog string.quoted.double.prolog punctuation.definition.string.begin.prolog - set: string|0 - - match: '\[' - scope: punctuation.section.brackets.begin.prolog - set: list|0 - - match: '\{' - scope: punctuation.section.braces.begin.prolog - set: set|0 - - match: '\+|-' - scope: keyword.operator.arithmetic.prolog - set: single-value|1 - - match: '\\\+' - scope: keyword.control.negation.prolog - set: single-value|1 - - match: '\(' - scope: punctuation.section.group.begin.prolog - set: single-value|2 - - match: '\S' - scope: invalid.illegal.prolog - pop: true diff --git a/third_party/bat_syntaxes/default.nix b/third_party/bat_syntaxes/default.nix deleted file mode 100644 index 15af13091..000000000 --- a/third_party/bat_syntaxes/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -# For depot projects that make use of syntect (primarily -# //tools/cheddar) the included syntax set is taken from bat. -# -# However, bat lacks some of the syntaxes we are interested in. This -# package creates a new binary syntax set which bundles our additional -# syntaxes on top of bat's existing ones. -{ pkgs, ... }: - -let - inherit (pkgs) bat runCommand; -in -runCommand "bat-syntaxes.bin" { } '' - export HOME=$PWD - mkdir -p .config/bat/syntaxes - cp ${./Prolog.sublime-syntax} .config/bat/syntaxes - ${bat}/bin/bat cache --build - mv .cache/bat/syntaxes.bin $out -'' diff --git a/tools/cheddar/.gitignore b/tools/cheddar/.gitignore deleted file mode 100644 index 2f7896d1d..000000000 --- a/tools/cheddar/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ diff --git a/tools/cheddar/.skip-subtree b/tools/cheddar/.skip-subtree deleted file mode 100644 index e69de29bb..000000000 diff --git a/tools/cheddar/Cargo.lock b/tools/cheddar/Cargo.lock deleted file mode 100644 index c88cba580..000000000 --- a/tools/cheddar/Cargo.lock +++ /dev/null @@ -1,1652 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" - -[[package]] -name = "anstyle-parse" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "brotli" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cc" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" -dependencies = [ - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cheddar" -version = "0.2.0" -dependencies = [ - "clap 2.34.0", - "comrak", - "lazy_static", - "regex", - "rouille", - "serde", - "serde_json", - "syntect", -] - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-targets 0.52.6", -] - -[[package]] -name = "chunked_transfer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "4.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", - "terminal_size", -] - -[[package]] -name = "clap_derive" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - -[[package]] -name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - -[[package]] -name = "comrak" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11e55664fcff7f4d37cc2adf3a1996913692f037312f4ab0909047fdd2bf962" -dependencies = [ - "clap 4.5.16", - "entities", - "memchr", - "once_cell", - "pest", - "pest_derive", - "regex", - "shell-words", - "syntect", - "typed-arena", - "unicode_categories", - "xdg", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "deflate" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" -dependencies = [ - "adler32", - "gzip-header", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "entities" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fancy-regex" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" -dependencies = [ - "bit-set", - "regex", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "flate2" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gzip-header" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" -dependencies = [ - "crc32fast", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "multipart" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" -dependencies = [ - "buf_redux", - "httparse", - "log", - "mime", - "mime_guess", - "quick-error", - "rand", - "safemem", - "tempfile", - "twoway", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "onig" -version = "6.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" -dependencies = [ - "bitflags 1.3.2", - "libc", - "once_cell", - "onig_sys", -] - -[[package]] -name = "onig_sys" -version = "69.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pest" -version = "2.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "plist" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" -dependencies = [ - "base64 0.22.1", - "indexmap", - "quick-xml", - "serde", - "time", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rouille" -version = "3.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3716fbf57fc1084d7a706adf4e445298d123e4a44294c4e8213caf1b85fcc921" -dependencies = [ - "base64 0.13.1", - "brotli", - "chrono", - "deflate", - "filetime", - "multipart", - "percent-encoding", - "rand", - "serde", - "serde_derive", - "serde_json", - "sha1_smol", - "threadpool", - "time", - "tiny_http", - "url", -] - -[[package]] -name = "rustix" -version = "0.38.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "sha1_smol" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syntect" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" -dependencies = [ - "bincode", - "bitflags 1.3.2", - "fancy-regex", - "flate2", - "fnv", - "once_cell", - "onig", - "plist", - "regex-syntax", - "serde", - "serde_derive", - "serde_json", - "thiserror", - "walkdir", - "yaml-rust", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tiny_http" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" -dependencies = [ - "ascii", - "chunked_transfer", - "httpdate", - "log", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" - -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "xdg" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/tools/cheddar/Cargo.toml b/tools/cheddar/Cargo.toml deleted file mode 100644 index d911b7c44..000000000 --- a/tools/cheddar/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "cheddar" -version = "0.2.0" -authors = ["Vincent Ambo "] -edition = "2018" - -[dependencies] -clap = "2.33" -comrak = "0.15" -lazy_static = "1.4" -rouille = "3.6" -syntect = "5.0" -serde_json = "1.0" -regex = "1.7" - -[dependencies.serde] -version = "1.0" -features = [ "derive" ] diff --git a/tools/cheddar/README.md b/tools/cheddar/README.md deleted file mode 100644 index 706f3b62d..000000000 --- a/tools/cheddar/README.md +++ /dev/null @@ -1,21 +0,0 @@ -cheddar -======= - -Cheddar is a tiny Rust tool that uses [syntect][] to render source code to -syntax-highlighted HTML. - -It's invocation is compatible with `cgit` filters, i.e. data is read from -`stdin` and the filename is taken from `argv`: - -```shell -cat README.md | cheddar README.md > README.html - -``` - -In fact, if you are looking at this file on git.tazj.in chances are that it was -rendered by cheddar. - -The name was chosen because I was eyeing a pack of cheddar-flavoured crisps -while thinking about name selection. - -[syntect]: https://github.com/trishume/syntect diff --git a/tools/cheddar/build.rs b/tools/cheddar/build.rs deleted file mode 100644 index f70818d80..000000000 --- a/tools/cheddar/build.rs +++ /dev/null @@ -1,55 +0,0 @@ -//! Build script that can be used outside of Nix builds to inject the -//! BAT_SYNTAXES variable when building in development mode. -//! -//! Note that this script assumes that cheddar is in a checkout of the -//! TVL depot. - -use std::process::Command; - -static BAT_SYNTAXES: &str = "BAT_SYNTAXES"; -static ERROR_MESSAGE: &str = r#"Failed to build syntax set. - -When building during development, cheddar expects to be in a checkout -of the TVL depot. This is required to automatically build the syntax -highlighting files that are needed at compile time. - -As cheddar can not automatically detect the location of the syntax -files, you must set the `BAT_SYNTAXES` environment variable to the -right path. - -The expected syntax files are at //third_party/bat_syntaxes in the -depot."#; - -fn main() { - // Do nothing if the variable is already set (e.g. via Nix) - if let Ok(_) = std::env::var(BAT_SYNTAXES) { - return; - } - - // Otherwise ask Nix to build it and inject the result. - let output = Command::new("nix-build") - .arg("-A") - .arg("third_party.bat_syntaxes") - // ... assuming cheddar is at //tools/cheddar ... - .arg("../..") - .output() - .expect(ERROR_MESSAGE); - - if !output.status.success() { - eprintln!( - "{}\nNix output: {}", - ERROR_MESSAGE, - String::from_utf8_lossy(&output.stderr) - ); - return; - } - - let out_path = String::from_utf8(output.stdout) - .expect("Nix returned invalid output after building syntax set"); - - // Return an instruction to Cargo that will set the environment - // variable during rustc calls. - // - // https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-envvarvalue - println!("cargo:rustc-env={}={}", BAT_SYNTAXES, out_path.trim()); -} diff --git a/tools/cheddar/default.nix b/tools/cheddar/default.nix deleted file mode 100644 index d29f75dc3..000000000 --- a/tools/cheddar/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ depot, pkgs, ... }: - -depot.third_party.naersk.buildPackage { - src = ./.; - doDoc = false; - doCheck = true; - - override = x: { - # Use our custom bat syntax set, which is everything from upstream, - # plus additional languages we care about. - BAT_SYNTAXES = "${depot.third_party.bat_syntaxes}"; - }; - - passthru = { - # Wrapper for cgit which can't be told to pass arguments to a filter - about-filter = pkgs.writeShellScriptBin "cheddar-about" '' - exec ${depot.tools.cheddar}/bin/cheddar --about-filter $@ - ''; - }; - - meta.ci.targets = [ - "about-filter" - ]; -} diff --git a/tools/cheddar/src/bin/cheddar.rs b/tools/cheddar/src/bin/cheddar.rs deleted file mode 100644 index 73017a223..000000000 --- a/tools/cheddar/src/bin/cheddar.rs +++ /dev/null @@ -1,144 +0,0 @@ -//! This file defines the binary for cheddar, which can be interacted -//! with in two different ways: -//! -//! 1. As a CLI tool that acts as a cgit filter. -//! 2. As a long-running HTTP server that handles rendering requests -//! (matching the SourceGraph protocol). -use clap::{App, Arg}; -use rouille::{router, try_or_400, Response}; -use serde::Deserialize; -use serde_json::json; -use std::collections::HashMap; -use std::io; - -use cheddar::{format_code, format_markdown, THEMES}; - -// Server endpoint for rendering the syntax of source code. This -// replaces the 'syntect_server' component of Sourcegraph. -fn code_endpoint(request: &rouille::Request) -> rouille::Response { - #[derive(Deserialize)] - struct SourcegraphQuery { - filepath: String, - theme: String, - code: String, - } - - let query: SourcegraphQuery = try_or_400!(rouille::input::json_input(request)); - let mut buf: Vec = Vec::new(); - - // We don't use syntect with the sourcegraph themes bundled - // currently, so let's fall back to something that is kind of - // similar (tm). - let theme = &THEMES.themes[match query.theme.as_str() { - "Sourcegraph (light)" => "Solarized (light)", - _ => "Solarized (dark)", - }]; - - format_code(theme, &mut query.code.as_bytes(), &mut buf, &query.filepath); - - Response::json(&json!({ - "is_plaintext": false, - "data": String::from_utf8_lossy(&buf) - })) -} - -// Server endpoint for rendering a Markdown file. -fn markdown_endpoint(request: &rouille::Request) -> rouille::Response { - let mut texts: HashMap = try_or_400!(rouille::input::json_input(request)); - - for text in texts.values_mut() { - let mut buf: Vec = Vec::new(); - format_markdown(&mut text.as_bytes(), &mut buf, true); - *text = String::from_utf8_lossy(&buf).to_string(); - } - - Response::json(&texts) -} - -fn highlighting_server(listen: &str) { - println!("Starting syntax highlighting server on '{}'", listen); - - rouille::start_server(listen, move |request| { - router!(request, - // Markdown rendering route - (POST) (/markdown) => { - markdown_endpoint(request) - }, - - // Code rendering route - (POST) (/) => { - code_endpoint(request) - }, - - _ => { - rouille::Response::empty_404() - }, - ) - }); -} - -fn main() { - // Parse the command-line flags passed to cheddar to determine - // whether it is running in about-filter mode (`--about-filter`) - // and what file extension has been supplied. - let matches = App::new("cheddar") - .about("TVL's syntax highlighter") - .arg( - Arg::with_name("about-filter") - .help("Run as a cgit about-filter (renders Markdown)") - .long("about-filter") - .takes_value(false), - ) - .arg( - Arg::with_name("no-tagfilter") - .help("Disable HTML tag filter") - .long("no-tagfilter") - .takes_value(false), - ) - .arg( - Arg::with_name("sourcegraph-server") - .help("Run as a Sourcegraph compatible web-server") - .long("sourcegraph-server") - .takes_value(false), - ) - .arg( - Arg::with_name("listen") - .help("Address to listen on") - .long("listen") - .takes_value(true), - ) - .arg(Arg::with_name("filename").help("File to render").index(1)) - .get_matches(); - - if matches.is_present("sourcegraph-server") { - highlighting_server( - matches - .value_of("listen") - .expect("Listening address is required for server mode"), - ); - return; - } - - let filename = matches.value_of("filename").expect("filename is required"); - - let stdin = io::stdin(); - let mut in_handle = stdin.lock(); - - let stdout = io::stdout(); - let mut out_handle = stdout.lock(); - - if matches.is_present("about-filter") && filename.ends_with(".md") { - format_markdown( - &mut in_handle, - &mut out_handle, - !matches.is_present("no-tagfilter"), - ); - } else { - format_code( - &THEMES.themes["InspiredGitHub"], - &mut in_handle, - &mut out_handle, - filename, - ); - } -} diff --git a/tools/cheddar/src/lib.rs b/tools/cheddar/src/lib.rs deleted file mode 100644 index be8bc7f82..000000000 --- a/tools/cheddar/src/lib.rs +++ /dev/null @@ -1,354 +0,0 @@ -//! This file implements the rendering logic of cheddar with public -//! functions for syntax-highlighting code and for turning Markdown -//! into HTML with TVL extensions. -use comrak::arena_tree::Node; -use comrak::nodes::{Ast, AstNode, NodeCodeBlock, NodeHtmlBlock, NodeValue}; -use comrak::{format_html, parse_document, Arena, ComrakOptions}; -use lazy_static::lazy_static; -use regex::Regex; -use std::cell::RefCell; -use std::collections::HashMap; -use std::ffi::OsStr; -use std::io::{BufRead, Write}; -use std::path::Path; -use std::{env, io}; -use syntect::dumps::from_uncompressed_data; -use syntect::easy::HighlightLines; -use syntect::highlighting::{Theme, ThemeSet}; -use syntect::parsing::{SyntaxReference, SyntaxSet}; -use syntect::util::LinesWithEndings; - -use syntect::html::{ - append_highlighted_html_for_styled_line, start_highlighted_html_snippet, IncludeBackground, -}; - -#[cfg(test)] -mod tests; - -lazy_static! { - // Load syntaxes lazily. Initialisation might not be required in - // the case of Markdown rendering (if there's no code blocks - // within the document). - // - // Note that the syntax set is included from the path pointed to - // by the BAT_SYNTAXES environment variable at compile time. This - // variable is populated by Nix and points to TVL's syntax set. - static ref SYNTAXES: SyntaxSet = from_uncompressed_data(include_bytes!(env!("BAT_SYNTAXES"))) - .expect("failed to deserialise SyntaxSet"); - - pub static ref THEMES: ThemeSet = ThemeSet::load_defaults(); - - // Configure Comrak's Markdown rendering with all the bells & - // whistles! - static ref MD_OPTS: ComrakOptions = { - let mut options = ComrakOptions::default(); - - // Enable non-standard Markdown features: - options.extension.strikethrough = true; - options.extension.tagfilter = true; - options.extension.table = true; - options.extension.autolink = true; - options.extension.tasklist = true; - options.extension.header_ids = Some(String::new()); // yyeeesss! - options.extension.footnotes = true; - options.extension.description_lists = true; - options.extension.front_matter_delimiter = Some("---".to_owned()); - - // Required for tagfilter - options.render.unsafe_ = true; - - options - }; - - // Configures a map of specific filenames to languages, for cases - // where the detection by extension or other heuristics fails. - static ref FILENAME_OVERRIDES: HashMap<&'static str, &'static str> = { - let mut map = HashMap::new(); - // rules.pl is the canonical name of the submit rule file in - // Gerrit, which is written in Prolog. - map.insert("rules.pl", "Prolog"); - map - }; - - // Default shortlink set used in cheddar (i.e. TVL's shortlinks) - static ref TVL_LINKS: Vec = vec![ - // TVL shortlinks for bugs and changelists (e.g. b/123, - // cl/123). Coincidentally these have the same format, which - // makes the initial implementation easy. - Shortlink { - pattern: Regex::new(r#"\b(?Pb|cl)/(?P\d+)\b"#).unwrap(), - replacement: "[$type/$dest](https://$type.tvl.fyi/$dest)", - }, - Shortlink { - pattern: Regex::new(r#"\br/(?P\d+)\b"#).unwrap(), - replacement: "[r/$dest](https://code.tvl.fyi/commit/?id=refs/r/$dest)", - } - ]; -} - -/// Structure that describes a single shortlink that should be -/// automatically highlighted. Highlighting is performed as a string -/// replacement over input Markdown. -pub struct Shortlink { - /// Short link pattern to recognise. Make sure to anchor these - /// correctly. - pub pattern: Regex, - - /// Replacement string, as per the documentation of - /// [`Regex::replace`]. - pub replacement: &'static str, -} - -// HTML fragment used when rendering inline blocks in Markdown documents. -// Emulates the GitHub style (subtle background hue and padding). -const BLOCK_PRE: &str = "
\n";
-
-fn should_continue(res: &io::Result) -> bool {
-    match *res {
-        Ok(n) => n > 0,
-        Err(_) => false,
-    }
-}
-
-// This function is taken from the Comrak documentation.
-fn iter_nodes<'a, F>(node: &'a AstNode<'a>, f: &F)
-where
-    F: Fn(&'a AstNode<'a>),
-{
-    f(node);
-    for c in node.children() {
-        iter_nodes(c, f);
-    }
-}
-
-// Many of the syntaxes in the syntax list have random capitalisations, which
-// means that name matching for the block info of a code block in HTML fails.
-//
-// Instead, try finding a syntax match by comparing case insensitively (for
-// ASCII characters, anyways).
-fn find_syntax_case_insensitive(info: &str) -> Option<&'static SyntaxReference> {
-    // TODO(tazjin): memoize this lookup
-    SYNTAXES
-        .syntaxes()
-        .iter()
-        .rev()
-        .find(|&s| info.eq_ignore_ascii_case(&s.name))
-}
-
-// Replaces code-block inside of a Markdown AST with HTML blocks rendered by
-// syntect. This enables static (i.e. no JavaScript) syntax highlighting, even
-// of complex languages.
-fn highlight_code_block(code_block: &NodeCodeBlock) -> NodeValue {
-    let theme = &THEMES.themes["InspiredGitHub"];
-    let info = String::from_utf8_lossy(&code_block.info);
-
-    let syntax = find_syntax_case_insensitive(&info)
-        .or_else(|| SYNTAXES.find_syntax_by_extension(&info))
-        .unwrap_or_else(|| SYNTAXES.find_syntax_plain_text());
-
-    let code = String::from_utf8_lossy(&code_block.literal);
-
-    let rendered = {
-        // Write the block preamble manually to get exactly the
-        // desired layout:
-        let mut hl = HighlightLines::new(syntax, theme);
-        let mut buf = BLOCK_PRE.to_string();
-
-        for line in LinesWithEndings::from(&code) {
-            let regions = hl
-                .highlight_line(line, &SYNTAXES)
-                .expect("highlight_line failed");
-            append_highlighted_html_for_styled_line(®ions[..], IncludeBackground::No, &mut buf)
-                .expect("appending HTML failed");
-        }
-
-        buf.push_str("
"); - buf - }; - - let mut block = NodeHtmlBlock::default(); - block.literal = rendered.into_bytes(); - - NodeValue::HtmlBlock(block) -} - -// Supported callout elements (which each have their own distinct rendering): -enum Callout { - Todo, - Warning, - Question, - Tip, -} - -// Determine whether the first child of the supplied node contains a text that -// should cause a callout section to be rendered. -fn has_callout<'a>(node: &Node<'a, RefCell>) -> Option { - match node.first_child().map(|c| c.data.borrow()) { - Some(child) => match &child.value { - NodeValue::Text(text) => { - if text.starts_with(b"TODO") { - return Some(Callout::Todo); - } else if text.starts_with(b"WARNING") { - return Some(Callout::Warning); - } else if text.starts_with(b"QUESTION") { - return Some(Callout::Question); - } else if text.starts_with(b"TIP") { - return Some(Callout::Tip); - } - - None - } - _ => None, - }, - _ => None, - } -} - -// Replace instances of known shortlinks in the input document with -// Markdown syntax for a highlighted link. -fn linkify_shortlinks(mut text: String, shortlinks: &[Shortlink]) -> String { - for link in shortlinks { - text = link - .pattern - .replace_all(&text, link.replacement) - .to_string(); - } - - return text; -} - -fn format_callout_paragraph(callout: Callout) -> NodeValue { - let class = match callout { - Callout::Todo => "cheddar-todo", - Callout::Warning => "cheddar-warning", - Callout::Question => "cheddar-question", - Callout::Tip => "cheddar-tip", - }; - - let mut block = NodeHtmlBlock::default(); - block.literal = format!("

", class).into_bytes(); - NodeValue::HtmlBlock(block) -} - -pub fn format_markdown_with_shortlinks( - reader: &mut R, - writer: &mut W, - tagfilter: bool, - shortlinks: &[Shortlink], -) { - let document = { - let mut buffer = String::new(); - reader - .read_to_string(&mut buffer) - .expect("reading should work"); - buffer - }; - - let arena = Arena::new(); - - let mut opts = MD_OPTS.clone(); - if !tagfilter { - opts.extension.tagfilter = false; - } - - let root = parse_document(&arena, &linkify_shortlinks(document, shortlinks), &opts); - - // This node must exist with a lifetime greater than that of the parsed AST - // in case that callouts are encountered (otherwise insertion into the tree - // is not possible). - let mut p_close_value = NodeHtmlBlock::default(); - p_close_value.literal = b"

".to_vec(); - - let p_close_node = Ast::new(NodeValue::HtmlBlock(p_close_value)); - let p_close = Node::new(RefCell::new(p_close_node)); - - // Special features of Cheddar are implemented by traversing the - // arena and reacting on nodes that we might want to modify. - iter_nodes(root, &|node| { - let mut ast = node.data.borrow_mut(); - let new = match &ast.value { - // Syntax highlighting is implemented by replacing the - // code block node with literal HTML. - NodeValue::CodeBlock(code) => Some(highlight_code_block(code)), - - NodeValue::Paragraph => { - if let Some(callout) = has_callout(node) { - node.insert_after(&p_close); - Some(format_callout_paragraph(callout)) - } else { - None - } - } - _ => None, - }; - - if let Some(new_value) = new { - ast.value = new_value - } - }); - - format_html(root, &opts, writer).expect("Markdown rendering failed"); -} - -pub fn format_markdown(reader: &mut R, writer: &mut W, tagfilter: bool) { - format_markdown_with_shortlinks(reader, writer, tagfilter, &TVL_LINKS) -} - -fn find_syntax_for_file(filename: &str) -> &'static SyntaxReference { - (*FILENAME_OVERRIDES) - .get(filename) - .and_then(|name| SYNTAXES.find_syntax_by_name(name)) - .or_else(|| { - Path::new(filename) - .extension() - .and_then(OsStr::to_str) - .and_then(|s| SYNTAXES.find_syntax_by_extension(s)) - }) - .unwrap_or_else(|| SYNTAXES.find_syntax_plain_text()) -} - -pub fn format_code( - theme: &Theme, - reader: &mut R, - writer: &mut W, - filename: &str, -) { - let mut linebuf = String::new(); - - // Get the first line, we might need it for syntax identification. - let mut read_result = reader.read_line(&mut linebuf); - let syntax = find_syntax_for_file(filename); - - let mut hl = HighlightLines::new(syntax, theme); - let (mut outbuf, bg) = start_highlighted_html_snippet(theme); - - // Rather than using the `lines` iterator, read each line manually - // and maintain buffer state. - // - // This is done because the syntax highlighter requires trailing - // newlines to be efficient, and those are stripped in the lines - // iterator. - while should_continue(&read_result) { - let regions = hl - .highlight_line(&linebuf, &SYNTAXES) - .expect("highlight_line failed"); - - append_highlighted_html_for_styled_line( - ®ions[..], - IncludeBackground::IfDifferent(bg), - &mut outbuf, - ) - .expect("appending highlighted HTML failed"); - - // immediately output the current state to avoid keeping - // things in memory - write!(writer, "{}", outbuf).expect("write should not fail"); - - // merry go round again - linebuf.clear(); - outbuf.clear(); - read_result = reader.read_line(&mut linebuf); - } - - writeln!(writer, "").expect("write should not fail"); -} diff --git a/tools/cheddar/src/tests.rs b/tools/cheddar/src/tests.rs deleted file mode 100644 index 0550acd35..000000000 --- a/tools/cheddar/src/tests.rs +++ /dev/null @@ -1,110 +0,0 @@ -use super::*; -use std::io::BufReader; - -// Markdown rendering expectation, ignoring leading and trailing -// whitespace in the input and output. -fn expect_markdown(input: &str, expected: &str) { - let mut input_buf = BufReader::new(input.trim().as_bytes()); - let mut out_buf: Vec = vec![]; - format_markdown(&mut input_buf, &mut out_buf, true); - - let out_string = String::from_utf8(out_buf).expect("output should be UTF8"); - assert_eq!(out_string.trim(), expected.trim()); -} - -#[test] -fn renders_simple_markdown() { - expect_markdown("hello", "

hello

\n"); -} - -#[test] -fn renders_callouts() { - expect_markdown( - "TODO some task.", - r#"

-TODO some task. -

-"#, - ); - - expect_markdown( - "WARNING: be careful", - r#"

-WARNING: be careful -

-"#, - ); - - expect_markdown( - "TIP: note the thing", - r#"

-TIP: note the thing -

-"#, - ); -} - -#[test] -fn renders_code_snippets() { - expect_markdown( - r#" -Code: -```nix -toString 42 -``` -"#, - r#" -

Code:

-
-toString 42
-
-"#, - ); -} - -#[test] -fn highlights_bug_link() { - expect_markdown( - "Please look at b/123.", - "

Please look at b/123.

", - ); -} - -#[test] -fn highlights_cl_link() { - expect_markdown( - "Please look at cl/420.", - "

Please look at cl/420.

", - ); -} - -#[test] -fn highlights_r_link() { - expect_markdown( - "Fixed in r/3268.", - "

Fixed in r/3268.

", - ); -} - -#[test] -fn highlights_multiple_shortlinks() { - expect_markdown( - "Please look at cl/420, b/123.", - "

Please look at cl/420, b/123.

", - ); - - expect_markdown( - "b/213/cl/213 are different things", - "

b/213/cl/213 are different things

", - ); -} - -#[test] -fn ignores_invalid_shortlinks() { - expect_markdown("b/abc is not a real bug", "

b/abc is not a real bug

"); -} - -#[test] -fn syntax_set_loaded() { - assert!(SYNTAXES.syntaxes().len() > 0) -}