summaryrefslogtreecommitdiff
path: root/universal_parser.c
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2024-02-05 13:14:56 +0900
committerYuichiro Kaneko <[email protected]>2024-02-20 17:33:58 +0900
commit20dbc7a5f4098ec7612192c2b65bdc970eab6055 (patch)
treee62335330f0d8848207e8870215c87177fc944e2 /universal_parser.c
parent89cfc1520717257073012ec07105c551e4b8af7c (diff)
Skip `test_filepath` of "unparser/corpus/literal/def.txt"
The previous commit changes Ripper lex state behavior of `tLABEL`. For example, Ripper lex state for the second `bar` was changed by the previous commit. ``` def foo(bar: bar()) end ``` Before the commit, Ripper didn’t add label `bar` id to `vtable` because `formal_argument` function for Ripper didn’t return id but returned `VALUE lhs`. Therefore Ripper didn’t `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` for following `bar` in `parse_ident` because `lvar_defined` for following `bar` was not true. Currently Ripper does `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` then the result of this test case is changed like below. ``` Prism::ParseTest#test_filepath_unparser/corpus/literal/def.txt [ruby/test/prism/parse_test.rb:280]: <[[80, 13], :on_ident, “bar”, END|LABEL]> expected but was <[[80, 13], :on_ident, “bar”, ARG]>. ``` Parser sets lex state to `END|LABEL` on master branch. Therefore previous commit makes Ripper’s behavior aligned with parser’s behavior. ``` $ ruby -v -y -e "def foo(bar: bar())" -e "end" ruby 3.4.0dev (2024-02-11T23:52:05Z master 697ade7bda) [arm64-darwin21] ... Reading a token parser_dispatch_scan_event:11210 (1: 12|1|7) lex_state: ARG|LABELED -> ARG at line 11113 lex_state: ARG -> END|LABEL at line 11128 parser_dispatch_scan_event:11877 (1: 13|3|4) Next token is token “local variable or method” (1.13-1.16: bar) Shifting token “local variable or method” (1.13-1.16: bar) ```
Diffstat (limited to 'universal_parser.c')
0 files changed, 0 insertions, 0 deletions