Skip to content

Commit

Permalink
feat: add named field for narration and payee
Browse files Browse the repository at this point in the history
  • Loading branch information
polarmutex committed Oct 10, 2023
1 parent 1c407c2 commit 0631b99
Show file tree
Hide file tree
Showing 4 changed files with 2,288 additions and 2,239 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Expand Up @@ -169,10 +169,10 @@ module.exports = grammar({
_txn_strings: $ =>
choice(
seq(
alias($.string, $.payee),
alias($.string, $.narration),
field("payee", alias($.string, $.payee)),
field("narration", alias($.string, $.narration)),
),
alias($.string, $.narration),
field("narration", alias($.string, $.narration)),
),

// OPTIONAL
Expand Down
48 changes: 30 additions & 18 deletions src/grammar.json
Expand Up @@ -474,33 +474,45 @@
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"type": "FIELD",
"name": "payee",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "payee"
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "payee"
}
},
{
"type": "ALIAS",
"type": "FIELD",
"name": "narration",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "narration"
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "narration"
}
}
]
},
{
"type": "ALIAS",
"type": "FIELD",
"name": "narration",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "narration"
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "string"
},
"named": true,
"value": "narration"
}
}
]
},
Expand Down
28 changes: 20 additions & 8 deletions src/node-types.json
Expand Up @@ -1349,6 +1349,26 @@
}
]
},
"narration": {
"multiple": false,
"required": false,
"types": [
{
"type": "narration",
"named": true
}
]
},
"payee": {
"multiple": false,
"required": false,
"types": [
{
"type": "payee",
"named": true
}
]
},
"tags_links": {
"multiple": false,
"required": false,
Expand Down Expand Up @@ -1382,14 +1402,6 @@
"type": "key_value",
"named": true
},
{
"type": "narration",
"named": true
},
{
"type": "payee",
"named": true
},
{
"type": "posting",
"named": true
Expand Down

0 comments on commit 0631b99

Please sign in to comment.