Closed resolritter closed 2 years ago
Closes https://github.com/tree-sitter/tree-sitter-typescript/issues/140
Why it works is already explained in the comment. I had the idea by looking at the following line:
https://github.com/tree-sitter/tree-sitter-typescript/blob/d08f57f2689f9006c8a362454a6070d578aa8017/common/scanner.h#L118-L119
Given that method definitions are also functions and therefore their definition is similar, I thought it was fine to re-use that token instead of creating a new one.
Initial measurements of parser.c against d08f57f2689f9006c8a362454a6070d578aa8017
parser.c
typescript:
-#define STATE_COUNT 5987 -#define LARGE_STATE_COUNT 1269 +#define STATE_COUNT 6031 +#define LARGE_STATE_COUNT 1270
tsx:
-#define STATE_COUNT 6292 -#define LARGE_STATE_COUNT 1270 +#define STATE_COUNT 6336 +#define LARGE_STATE_COUNT 1271
Checklist:
Thanks!
Closes https://github.com/tree-sitter/tree-sitter-typescript/issues/140
Why it works is already explained in the comment. I had the idea by looking at the following line:
https://github.com/tree-sitter/tree-sitter-typescript/blob/d08f57f2689f9006c8a362454a6070d578aa8017/common/scanner.h#L118-L119
Given that method definitions are also functions and therefore their definition is similar, I thought it was fine to re-use that token instead of creating a new one.
Initial measurements of
parser.c
against d08f57f2689f9006c8a362454a6070d578aa8017typescript:
tsx:
Checklist: