Skip to content

Commit

Permalink
breaking change: remove differentiation of foreplay and document_content
Browse files Browse the repository at this point in the history
  • Loading branch information
mrossinek committed Nov 9, 2021
1 parent 941bb61 commit 51fdb9e
Show file tree
Hide file tree
Showing 15 changed files with 189,547 additions and 190,184 deletions.
22 changes: 1 addition & 21 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,27 +151,7 @@ module.exports = grammar({
],

rules: {
document: $ =>
seq(
optional($.foreplay),
optional($.document_content),
),

foreplay: $ =>
prec.right(0,
repeat1(
prec(2,
choice(
$._paragraph_break,
$._line_break,
$.ranged_tag,
$.insertion,
)
),
)
),

document_content: $ => repeat1(
document: $ => repeat1(
choice(
prec(1,
choice(
Expand Down
61 changes: 0 additions & 61 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,6 @@
"name": "norg",
"rules": {
"document": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "foreplay"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "document_content"
},
{
"type": "BLANK"
}
]
}
]
},
"foreplay": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "REPEAT1",
"content": {
"type": "PREC",
"value": 2,
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_paragraph_break"
},
{
"type": "SYMBOL",
"name": "_line_break"
},
{
"type": "SYMBOL",
"name": "ranged_tag"
},
{
"type": "SYMBOL",
"name": "insertion"
}
]
}
}
}
},
"document_content": {
"type": "REPEAT1",
"content": {
"type": "CHOICE",
Expand Down
38 changes: 0 additions & 38 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,25 +249,6 @@
"type": "document",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "document_content",
"named": true
},
{
"type": "foreplay",
"named": true
}
]
}
},
{
"type": "document_content",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
Expand Down Expand Up @@ -373,25 +354,6 @@
]
}
},
{
"type": "foreplay",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "insertion",
"named": true
},
{
"type": "ranged_tag",
"named": true
}
]
}
},
{
"type": "generic_list",
"named": true,
Expand Down
Loading

0 comments on commit 51fdb9e

Please sign in to comment.