Sublime Forum

Syntax error after update to ST4

#1

I have just updated to ST4 and I got a new error when it starts:

error: Error loading syntax file "Packages/....sublime-syntax": Apparent recursion within a with_prototype action: 25000 context sanity limit hit

All I have with “with_prototype” is in this fashion, one per language:

- match: ^__python$
  push: Packages/Python/Python.sublime-syntax
  with_prototype:
    - match: (^__$)    # OR (?=^__$)
      pop: true

- match: ^__html$
  push: Packages/HTML/HTML.sublime-syntax
  with_prototype:
    - match: (^__$)
      pop: true

This tries to apply a specific syntax to the text between two strings. Is there anything wrong in the syntax?

0 Likes

#2

HTML includes CSS and JS which got a bit more complex. So it is very likely for with_prototype to cause that issue.

Replacing those lines by

- match: ^__python$
  embed: Packages/Python/Python.sublime-syntax
  escape: (^__$)    # OR (?=^__$)

- match: ^__html$
  embed: Packages/HTML/HTML.sublime-syntax
  escape: (^__$)

should do the trick.

2 Likes

#3

It works indeed! No more errors. So I suppose the issue was caused by HTML interdependencies, and for some reason the error check was not enabled in ST3. Thanks

0 Likes

#4

The error checking mechanism hasn’t changed, but syntaxes got more complex over time so it’s more likely to hit the limits with those legacy constructs.

0 Likes