Skip to content

Commit

Permalink
minor changes to grammar from quite a while ago
Browse files Browse the repository at this point in the history
  • Loading branch information
green726 committed Mar 17, 2024
1 parent 8fdd7f7 commit 06a5727
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ function commaSep(rule) {
return optional(commaSep1(rule))
}

/*
Due to the fact that Hazel can have the same syntactic form (in terms of grammar) for patterns and functions, and within Hazel itself this is differentiated through the semantic evaluation, the Hazel treesitter grammar has been written to model this by defining seperate rules for "duplicate" forms' expressions and patterns. Because these duplicate rules share the same grammar, manual conflicts must be added to the treesitter parser. Although this does have the potential to decrease performance, the trade-off in ease-of-use and maintaining a close relationship to the Hazel "forms" (I believe) is well worth it. - Milan Lustig
*/


module.exports = grammar({
name: 'hazel',
Expand Down

0 comments on commit 06a5727

Please sign in to comment.