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

C grammar pushes states and does not pop them for sqlite3.c #155

@aeschli

Description

@aeschli

Run the c grammar on the following code snippet:

SQLITE_API int SQLITE_STDCALL sqlite3_create_collation(
  sqlite3*, 
  const char *zName, 
  int eTextRep, 
  void *pArg,
  int(*xCompare)(void*,int,const void*,int,const void*)
);

at the end of processing these lines, the text mate engine has still 3 scopes on the stack, but should have none.
* [172,1] BeginEndRule "meta.parens.c", entered @-1
* [168,2] BeginEndRule "meta.function.c", entered @-1
* [1,3] IncludeOnlyRule "source.c", entered @-1

Multiple declarations like this as in sqlite.c lead to a ever growing stack which is a performance problem.

You can use https://github.com/alexandrudima/grammar-debug to emit the textmate states generated when parsing a file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions