Commit 2c3d241
[ruby/prism] Support custom parser in
Follow-up to Shopify/ruby-lsp#1849.
This is an extension of `Prism::Translation::Parser` to implement Shopify/ruby-lsp#1849.
It is based on the comments in Shopify/ruby-lsp#1849 (review),
but also adds a default argument for delegation to `Parser::Base` super class.
Using this API, rubocop/rubocop-ast#359 has been implemented in RuboCop AST.
As detailed in rubocop/rubocop-ast#359, this change is expected to improve performance by 1.3x
for some source code.
Achieving a 1.3x speedup with such this simple modification is a significant improvement for Ruby LSP and its users.
ruby/prism@925725291cPrism::Translation::Parser
1 parent e0c0e06 commit 2c3d241
1 file changed
+32
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
36 | 65 | | |
37 | 66 | | |
38 | 67 | | |
| |||
51 | 80 | | |
52 | 81 | | |
53 | 82 | | |
54 | | - | |
| 83 | + | |
55 | 84 | | |
56 | 85 | | |
57 | 86 | | |
| |||
64 | 93 | | |
65 | 94 | | |
66 | 95 | | |
67 | | - | |
| 96 | + | |
68 | 97 | | |
69 | 98 | | |
70 | 99 | | |
| |||
83 | 112 | | |
84 | 113 | | |
85 | 114 | | |
86 | | - | |
| 115 | + | |
87 | 116 | | |
88 | 117 | | |
89 | 118 | | |
| |||
0 commit comments