Skip to content

Commit

Permalink
feat: allow anchors to exist in un/ordered links
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Nov 12, 2021
1 parent 0d90966 commit e6fcc1e
Show file tree
Hide file tree
Showing 4 changed files with 193,008 additions and 192,339 deletions.
60 changes: 48 additions & 12 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -574,7 +577,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -617,7 +623,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -656,7 +665,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -691,7 +703,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -720,7 +735,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand All @@ -739,7 +757,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -786,7 +807,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -829,7 +853,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -868,7 +895,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -903,7 +933,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down Expand Up @@ -932,7 +965,10 @@ module.exports = grammar({

field(
"location",
$.link,
choice(
$.link,
$.anchor_definition,
),
),

optional(
Expand Down
156 changes: 132 additions & 24 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1318,8 +1327,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1436,8 +1454,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1538,8 +1565,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1624,8 +1660,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1694,8 +1739,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1740,8 +1794,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1874,8 +1937,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -1992,8 +2064,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -2094,8 +2175,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -2180,8 +2270,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down Expand Up @@ -2250,8 +2349,17 @@
"type": "FIELD",
"name": "location",
"content": {
"type": "SYMBOL",
"name": "link"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "link"
},
{
"type": "SYMBOL",
"name": "anchor_definition"
}
]
}
},
{
Expand Down
Loading

0 comments on commit e6fcc1e

Please sign in to comment.