xl function

Mode xl(
  1. Highlight hljs
)

Highlight.js language definition for xl.

Implementation

Mode xl(Highlight hljs) {
  final Mode mode0 = Mode();
  mode0.scope = r'string';
  mode0.begin = r'"';
  mode0.end = r'"';
  mode0.illegal = r'\n';
  return Mode(
    name: r'XL',
    aliases: [r'tao'],
    keywords: {
      r'$pattern': r'[a-zA-Z][a-zA-Z0-9_?]*',
      r'keyword': [
        r'if',
        r'then',
        r'else',
        r'do',
        r'while',
        r'until',
        r'for',
        r'loop',
        r'import',
        r'with',
        r'is',
        r'as',
        r'where',
        r'when',
        r'by',
        r'data',
        r'constant',
        r'integer',
        r'real',
        r'text',
        r'name',
        r'boolean',
        r'symbol',
        r'infix',
        r'prefix',
        r'postfix',
        r'block',
        r'tree',
      ],
      r'literal': [r'true', r'false', r'nil'],
      r'built_in': [
        r'in',
        r'mod',
        r'rem',
        r'and',
        r'or',
        r'xor',
        r'not',
        r'abs',
        r'sign',
        r'floor',
        r'ceil',
        r'sqrt',
        r'sin',
        r'cos',
        r'tan',
        r'asin',
        r'acos',
        r'atan',
        r'exp',
        r'expm1',
        r'log',
        r'log2',
        r'log10',
        r'log1p',
        r'pi',
        r'at',
        r'text_length',
        r'text_range',
        r'text_find',
        r'text_replace',
        r'contains',
        r'page',
        r'slide',
        r'basic_slide',
        r'title_slide',
        r'title',
        r'subtitle',
        r'fade_in',
        r'fade_out',
        r'fade_at',
        r'clear_color',
        r'color',
        r'line_color',
        r'line_width',
        r'texture_wrap',
        r'texture_transform',
        r'texture',
        r'scale_?x',
        r'scale_?y',
        r'scale_?z?',
        r'translate_?x',
        r'translate_?y',
        r'translate_?z?',
        r'rotate_?x',
        r'rotate_?y',
        r'rotate_?z?',
        r'rectangle',
        r'circle',
        r'ellipse',
        r'sphere',
        r'path',
        r'line_to',
        r'move_to',
        r'quad_to',
        r'curve_to',
        r'theme',
        r'background',
        r'contents',
        r'locally',
        r'time',
        r'mouse_?x',
        r'mouse_?y',
        r'mouse_buttons',
        r'ObjectLoader',
        r'Animate',
        r'MovieCredits',
        r'Slides',
        r'Filters',
        r'Shading',
        r'Materials',
        r'LensFlare',
        r'Mapping',
        r'VLCAudioVideo',
        r'StereoDecoder',
        r'PointCloud',
        r'NetworkAccess',
        r'RemoteControl',
        r'RegExp',
        r'ChromaKey',
        r'Snowfall',
        r'NodeJS',
        r'Speech',
        r'Charts',
      ],
    },
    contains: [
      Mode(
        scope: r'comment',
        begin: r'//',
        end: r'$',
        contains: [
          Mode(
            scope: r'doctag',
            begin: r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',
            end: r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):',
            excludeBegin: true,
            relevance: 0,
          ),
          Mode(
            begin:
                r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}",
          ),
        ],
      ),
      Mode(
        scope: r'comment',
        begin: r'/\*',
        end: r'\*/',
        contains: [
          Mode(
            scope: r'doctag',
            begin: r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',
            end: r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):',
            excludeBegin: true,
            relevance: 0,
          ),
          Mode(
            begin:
                r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}",
          ),
        ],
      ),
      mode0,
      Mode(scope: r'string', begin: r"'", end: r"'", illegal: r'\n'),
      Mode(scope: r'string', begin: r'<<', end: r'>>'),
      Mode(
        scope: r'function',
        begin: r'[a-z][^\n]*->',
        returnBegin: true,
        end: r'->',
        contains: [
          Mode(
            scope: r'title',
            begin: r'[a-zA-Z]\w*',
            relevance: 0,
            starts: Mode(
              endsWithParent: true,
              keywords: {
                r'$pattern': r'[a-zA-Z][a-zA-Z0-9_?]*',
                r'keyword': [
                  r'if',
                  r'then',
                  r'else',
                  r'do',
                  r'while',
                  r'until',
                  r'for',
                  r'loop',
                  r'import',
                  r'with',
                  r'is',
                  r'as',
                  r'where',
                  r'when',
                  r'by',
                  r'data',
                  r'constant',
                  r'integer',
                  r'real',
                  r'text',
                  r'name',
                  r'boolean',
                  r'symbol',
                  r'infix',
                  r'prefix',
                  r'postfix',
                  r'block',
                  r'tree',
                ],
                r'literal': [r'true', r'false', r'nil'],
                r'built_in': [
                  r'in',
                  r'mod',
                  r'rem',
                  r'and',
                  r'or',
                  r'xor',
                  r'not',
                  r'abs',
                  r'sign',
                  r'floor',
                  r'ceil',
                  r'sqrt',
                  r'sin',
                  r'cos',
                  r'tan',
                  r'asin',
                  r'acos',
                  r'atan',
                  r'exp',
                  r'expm1',
                  r'log',
                  r'log2',
                  r'log10',
                  r'log1p',
                  r'pi',
                  r'at',
                  r'text_length',
                  r'text_range',
                  r'text_find',
                  r'text_replace',
                  r'contains',
                  r'page',
                  r'slide',
                  r'basic_slide',
                  r'title_slide',
                  r'title',
                  r'subtitle',
                  r'fade_in',
                  r'fade_out',
                  r'fade_at',
                  r'clear_color',
                  r'color',
                  r'line_color',
                  r'line_width',
                  r'texture_wrap',
                  r'texture_transform',
                  r'texture',
                  r'scale_?x',
                  r'scale_?y',
                  r'scale_?z?',
                  r'translate_?x',
                  r'translate_?y',
                  r'translate_?z?',
                  r'rotate_?x',
                  r'rotate_?y',
                  r'rotate_?z?',
                  r'rectangle',
                  r'circle',
                  r'ellipse',
                  r'sphere',
                  r'path',
                  r'line_to',
                  r'move_to',
                  r'quad_to',
                  r'curve_to',
                  r'theme',
                  r'background',
                  r'contents',
                  r'locally',
                  r'time',
                  r'mouse_?x',
                  r'mouse_?y',
                  r'mouse_buttons',
                  r'ObjectLoader',
                  r'Animate',
                  r'MovieCredits',
                  r'Slides',
                  r'Filters',
                  r'Shading',
                  r'Materials',
                  r'LensFlare',
                  r'Mapping',
                  r'VLCAudioVideo',
                  r'StereoDecoder',
                  r'PointCloud',
                  r'NetworkAccess',
                  r'RemoteControl',
                  r'RegExp',
                  r'ChromaKey',
                  r'Snowfall',
                  r'NodeJS',
                  r'Speech',
                  r'Charts',
                ],
              },
            ),
          ),
        ],
      ),
      Mode(
        beginKeywords: r'import',
        end: r'$',
        keywords: {
          r'$pattern': r'[a-zA-Z][a-zA-Z0-9_?]*',
          r'keyword': [
            r'if',
            r'then',
            r'else',
            r'do',
            r'while',
            r'until',
            r'for',
            r'loop',
            r'import',
            r'with',
            r'is',
            r'as',
            r'where',
            r'when',
            r'by',
            r'data',
            r'constant',
            r'integer',
            r'real',
            r'text',
            r'name',
            r'boolean',
            r'symbol',
            r'infix',
            r'prefix',
            r'postfix',
            r'block',
            r'tree',
          ],
          r'literal': [r'true', r'false', r'nil'],
          r'built_in': [
            r'in',
            r'mod',
            r'rem',
            r'and',
            r'or',
            r'xor',
            r'not',
            r'abs',
            r'sign',
            r'floor',
            r'ceil',
            r'sqrt',
            r'sin',
            r'cos',
            r'tan',
            r'asin',
            r'acos',
            r'atan',
            r'exp',
            r'expm1',
            r'log',
            r'log2',
            r'log10',
            r'log1p',
            r'pi',
            r'at',
            r'text_length',
            r'text_range',
            r'text_find',
            r'text_replace',
            r'contains',
            r'page',
            r'slide',
            r'basic_slide',
            r'title_slide',
            r'title',
            r'subtitle',
            r'fade_in',
            r'fade_out',
            r'fade_at',
            r'clear_color',
            r'color',
            r'line_color',
            r'line_width',
            r'texture_wrap',
            r'texture_transform',
            r'texture',
            r'scale_?x',
            r'scale_?y',
            r'scale_?z?',
            r'translate_?x',
            r'translate_?y',
            r'translate_?z?',
            r'rotate_?x',
            r'rotate_?y',
            r'rotate_?z?',
            r'rectangle',
            r'circle',
            r'ellipse',
            r'sphere',
            r'path',
            r'line_to',
            r'move_to',
            r'quad_to',
            r'curve_to',
            r'theme',
            r'background',
            r'contents',
            r'locally',
            r'time',
            r'mouse_?x',
            r'mouse_?y',
            r'mouse_buttons',
            r'ObjectLoader',
            r'Animate',
            r'MovieCredits',
            r'Slides',
            r'Filters',
            r'Shading',
            r'Materials',
            r'LensFlare',
            r'Mapping',
            r'VLCAudioVideo',
            r'StereoDecoder',
            r'PointCloud',
            r'NetworkAccess',
            r'RemoteControl',
            r'RegExp',
            r'ChromaKey',
            r'Snowfall',
            r'NodeJS',
            r'Speech',
            r'Charts',
          ],
        },
        contains: [mode0],
      ),
      Mode(
        scope: r'number',
        begin: r'[0-9]+#[0-9A-Z_]+(\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?',
      ),
      Mode(scope: r'number', begin: r'\b\d+(\.\d+)?', relevance: 0),
    ],
  );
}