Skip to content
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

Fix is_expression and is_pattern_expression parsing #317

Open
tamasvajk opened this issue Jun 19, 2023 · 0 comments
Open

Fix is_expression and is_pattern_expression parsing #317

tamasvajk opened this issue Jun 19, 2023 · 0 comments

Comments

@tamasvajk
Copy link
Collaborator

The below two is expressions produce different parse trees. The former is correctly parsed as is_expression and latter is incorrectly parsed as is_pattern_expression.

var x = y is int;
var x = y is A;
(compilation_unit [0, 0] - [1, 15]
  (global_statement [0, 0] - [0, 17]
    (local_declaration_statement [0, 0] - [0, 17]
      (variable_declaration [0, 0] - [0, 16]
        type: (implicit_type [0, 0] - [0, 3])
        (variable_declarator [0, 4] - [0, 16]
          (identifier [0, 4] - [0, 5])
          (equals_value_clause [0, 6] - [0, 16]
            (is_expression [0, 8] - [0, 16]
              left: (identifier [0, 8] - [0, 9])
              right: (predefined_type [0, 13] - [0, 16])))))))
  (global_statement [1, 0] - [1, 15]
    (local_declaration_statement [1, 0] - [1, 15]
      (variable_declaration [1, 0] - [1, 14]
        type: (implicit_type [1, 0] - [1, 3])
        (variable_declarator [1, 4] - [1, 14]
          (identifier [1, 4] - [1, 5])
          (equals_value_clause [1, 6] - [1, 14]
            (is_pattern_expression [1, 8] - [1, 14]
              expression: (identifier [1, 8] - [1, 9])
              pattern: (constant_pattern [1, 13] - [1, 14]
                (identifier [1, 13] - [1, 14])))))))))
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

No branches or pull requests

1 participant