Sublime Forum

How do you fix 'error parsing lexer'?

#1

Hello so I’ve been using Sublime Text 3 for 5 months and want to make a custom syntax for my custom language, the code is:

%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: Plain Text
file_extensions:
  - glz
scope: glz.*
contexts:
    main: [
     #glz.type.mainKeywords
      -match: '\b(class|call)\b',
       scope: glz.type.mainKeywords,

     #glz.type.subKeywords
      -match: '\b(public|private|local)\b',
       scope: glz.type.subKeywords,

     #glz.type.functions
      -match: '\b(void|write|writeln|let)\b',
       scope: glz.type.functions.funcKeywords,

     #glz.type.variables
      -match: '\b(string|int|float|char)\b',
       scope: glz.type.variables,

     #glz.type.variables.string.double-quote.escape-seq
      -match: '"',
       scope: glz.type.variables.string.double-quote.escape-seq,
       push: quote_function,

      -match: '\b(-)?[0-9.]+\b',
       scope: glz.type.numeric-data

  ]

    quote_function: [
      -meta_scope: glz.type.variables.string.double-quote-escape-seq,
      -match: '\\.',
       scope: glz.type.variables.string.double-quote.inline-block,
      -match: '"',
       scope: glz.type.variables.string.double-quote.escape-seq
  ]

but I get this error when I save it:
error parsing lexer: Packages/User/Glaze.sublime-syntax: expected match or include at line (specific line, specific column)

How do you fix it though?

0 Likes

#2

The extraneous [] may be what’s causing some odd parsing results. Not sure why they’re there.

0 Likes