Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Infinite loop when pattern matches nothing #46

Open
benogle opened this issue May 21, 2015 · 1 comment
Open

Infinite loop when pattern matches nothing #46

benogle opened this issue May 21, 2015 · 1 comment
Labels

Comments

@benogle
Copy link
Contributor

benogle commented May 21, 2015

Line to tokenize: <
This pattern

  {
    'begin': '(?<=\\A)'
    'end': '(?=<)'
    'name': 'meta.scope.outside-tag.html'
    'patterns': [
      {
        'include': '#entities'
      }
    ]
  }

In this line, match is an object with an empty nextTokens array:

screen shot 2015-05-21 at 11 47 38 am

This causes an infinite loop, and locks Atom. Here is an attempt to use these potentially-empty-matching patterns in language-html atom/language-html@bc7c4c9

cc @nathansobo

@lee-dohm lee-dohm added the bug label May 22, 2015
@nathansobo
Copy link
Contributor

Not going to fix this for now. The reason is that the matches in question were zero width. This should probably be fixed to avoid user error, but for now grammars shouldn't be constructed with zero width matches.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants