summaryrefslogtreecommitdiff
path: root/rubyparser.h
diff options
context:
space:
mode:
authorydah <[email protected]>2024-11-02 17:21:51 +0900
committerYudai Takada <[email protected]>2025-01-04 13:52:35 +0900
commitfa2517451ec265d5b273e864bc750a1b9ba2957f ()
treebf2d88ec9a7e0d2deee331acba938ce5573c03d2 /rubyparser.h
parent607b1b3d7628b1f94f086ce1dfe67789179cf906 (diff)
Implement LAMBDA NODE locations
The following Location information has been added This is the information required for parse.y to be a universal parser: ``` ❯ ruby --parser=prism --dump=parsetree -e "-> (a, b) do foo end" @ ProgramNode (location: (1,0)-(1,20)) +-- locals: [] +-- statements: @ StatementsNode (location: (1,0)-(1,20)) +-- body: (length: 1) +-- @ LambdaNode (location: (1,0)-(1,20)) +-- locals: [:a, :b] +-- operator_loc: (1,0)-(1,2) = "->" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- opening_loc: (1,10)-(1,12) = "do" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-- closing_loc: (1,17)-(1,20) = "end" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : (snip) ```
-rw-r--r--rubyparser.h3
1 files changed, 3 insertions, 0 deletions
@@ -968,6 +968,9 @@ typedef struct RNode_LAMBDA {
NODE node;
struct RNode *nd_body;
} rb_node_lambda_t;
typedef struct RNode_ARYPTN {