Skip to content

Commit

Permalink
fix: type extension with long identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Nsidorenco committed May 26, 2024
1 parent f848815 commit 3717916
Show file tree
Hide file tree
Showing 7 changed files with 380,688 additions and 380,422 deletions.
14 changes: 5 additions & 9 deletions examples/query.fs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
type A() =
member inline _.B<^Value
when ^Value :> ValueType
and ^Value : struct
and ^Value : (new : unit -> ^Value)
and ^Value : (static member ( + ) : ^Value * ^Value -> ^Value)
and ^Value : (static member Zero : ^Value)
and default ^Value : int>
() = ()
namespace A

module B =
type Microsoft.FSharp.Linq.QueryBuilder with
member this.F () = ()
2 changes: 1 addition & 1 deletion examples/types.fs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
type MyClass() =
static member inline F(x) = x + 1
static member F x y = x + y
18 changes: 12 additions & 6 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,18 @@ module.exports = grammar({
),

type_name: ($) =>
seq(
optional($.attributes),
optional($.access_modifier),
choice(
seq(field("type_name", $.identifier), optional($.type_arguments)),
seq(optional($.type_argument), field("type_name", $.identifier)), // Covers `type 'a option = Option<'a>`
prec(
2,
seq(
optional($.attributes),
optional($.access_modifier),
choice(
seq(
field("type_name", $.long_identifier),
optional($.type_arguments),
),
seq(optional($.type_argument), field("type_name", $.identifier)), // Covers `type 'a option = Option<'a>`
),
),
),

Expand Down
158 changes: 81 additions & 77 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3717916

Please sign in to comment.