Skip to content

Commit

Permalink
GLR-penalize pat_name reduction to compensate for pat_apply design
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Apr 4, 2024
1 parent 1855bd2 commit 47ad951
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion grammar/pat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {

pat_fields: $ => braces($, optional(sep1(',', $.pat_field))),

pat_name: $ => choice(prec('pat-name', $._var), $._cons),
pat_name: $ => choice(prec('pat-name', prec.dynamic(-10, $._var)), $._cons),

pat_as: $ => prec('prefix', seq(field('bind', $.variable), $._tight_at, field('pattern', $._infixpat))),

Expand Down
7 changes: 3 additions & 4 deletions test/corpus/pat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1194,10 +1194,9 @@ a (a :: A -> A {}) = a

(haskell
(declarations
(bind
(pat_apply
(pat_name
(variable))
(function
(variable)
(patterns
(pat_parens
(pat_annotated
(pat_name
Expand Down

0 comments on commit 47ad951

Please sign in to comment.