Skip to content

Consider making else_clause an explicit node #150

@DavisVaughan

Description

@DavisVaughan

tree-sitter-r/grammar.js

Lines 253 to 257 in 2097fa5

optional(seq(
$._else,
repeat($._newline),
field("alternative", $._expression)
))

i.e. the seq(else, newlines, alternative) all wrapped up in a named node

This would be for air, which does make a distinction of the else_clause, and I think we could basically remove this whole section if we had a named node here
https://github.com/posit-dev/air/blob/ca6648d251d11a08041be4796b55f02e5d35f2cc/crates/air_r_parser/src/parse.rs#L770-L801

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions