Skip to content

Sublime hangs trying to parse object nested in another obj #259

@falsefalse

Description

@falsefalse

Looks like this commit introduced endless loop somewhere.

Happens on bigger files, here is the minimal test case that reproduces the problem. Could look too artificial on the first glance, but adding an obj into real life ~150 lines class with bunch of methods and static props reliably hangs the editor.

  • open the file
  • put cursor at the first line
  • add empty line above
  • type some:, Enter
  • type more, attempt to type :, sometimes sublime hangs right away, sometimes allows to type it and then remove it, and then hangs.

Doesn't repro with CoffeeScript.sublime-syntax earlier than 59f5968.

Commenting out named functions rule makes the issue go away.

Definitely a problem with backtracking from a branch somewhere.

file, 128 function declarations

fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->
fn = ->

🎥

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions