Skip to content

Fix eager skipping of newlines #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Jun 18, 2024

Closes #125

(Note how many lines in the parser were removed!)

Before:

#define STATE_COUNT 5271
#define LARGE_STATE_COUNT 3028

tree-sitter generate --report-states-for-rule -
binary_operator                         2435
extract_operator                        1823
subset                                  1739
subset2                                 1739
call                                    1739
function_definition_repeat1             842
if_statement                            616
for_statement                           504
unary_operator                          448
while_statement                         392
parameters                              156
function_definition                     140
braced_expression                       112
parenthesized_expression                112
call_arguments                          112
subset_arguments                        112
subset2_arguments                       112
repeat_statement                        112
_single_quoted_string                   112
_double_quoted_string                   112
call_arguments_repeat1                  90
namespace_operator                      84
string                                  84
parenthesized_expression_repeat1        70
braced_expression_repeat1               64
integer                                 56
complex                                 56
_expression                             34
_string_or_identifier                   31
_single_quoted_string_content           30
_double_quoted_string_content           30
parameters_repeat1                      29
float                                   28
na                                      28
_argument_named                         12
_argument_value                         6
argument                                6
_argument                               3
_parameter_with_default                 3
_argument_unnamed                       3
program_repeat1                         3
_parameter_without_default              2
parameter                               2
program                                 1
_hex_literal                            0
_open_bracket                           0
_close_bracket                          0
_open_bracket2                          0
_close_bracket2                         0
_open_brace                             0
_close_brace                            0
_float_literal                          0
_close_parenthesis                      0
_open_parenthesis                       0
_else                                   0

After:

#define STATE_COUNT 2199
#define LARGE_STATE_COUNT 1004

tree-sitter generate --report-states-for-rule -
binary_operator                         1033
extract_operator                        775
call                                    739
subset                                  739
subset2                                 739
function_definition_repeat1             362
if_statement                            264
for_statement                           216
unary_operator                          192
while_statement                         168
function_definition                     60
_double_quoted_string                   48
_single_quoted_string                   48
repeat_statement                        48
braced_expression                       48
parenthesized_expression                48
call_arguments                          48
subset_arguments                        48
subset2_arguments                       48
call_arguments_repeat1                  42
namespace_operator                      36
string                                  36
integer                                 24
complex                                 24
_expression                             18
parenthesized_expression_repeat1        15
braced_expression_repeat1               15
_string_or_identifier                   15
_single_quoted_string_content           14
_double_quoted_string_content           14
na                                      12
float                                   12
_argument_named                         12
argument                                6
parameters                              6
_argument_value                         6
parameters_repeat1                      4
program_repeat1                         3
_parameter_with_default                 3
_argument                               3
_argument_unnamed                       3
_parameter_without_default              2
parameter                               2
program                                 1
_close_brace                            0
_open_bracket                           0
_close_bracket                          0
_open_bracket2                          0
_close_bracket2                         0
_hex_literal                            0
_open_brace                             0
_close_parenthesis                      0
_open_parenthesis                       0
_else                                   0
_float_literal                          0

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

Successfully merging this pull request may close these issues.

program node doesn't always start from (0, 0)
1 participant