Skip to content

Commit

Permalink
Add comment (#19)
Browse files Browse the repository at this point in the history
Add comment
  • Loading branch information
pickfire authored Jul 1, 2022
1 parent 1050a25 commit 1f864fb
Show file tree
Hide file tree
Showing 8 changed files with 3,330 additions and 3,263 deletions.
12 changes: 9 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,22 @@ module.exports = grammar({
// TODO $.automated_xact,
),

// TODO note opt
plain_xact: $ => createXact($,
seq($.date,
optional(seq($.whitespace, $.status)),
optional(seq($.whitespace, $.code)),
optional(seq($.whitespace, $.payee)),
'\n'),
choice($.note, '\n')
),
),

periodic_xact: $ => createXact($, seq('~', $.whitespace, $.interval, '\n')),
periodic_xact: $ => createXact($,
seq('~',
$.whitespace,
$.interval,
choice($.note, '\n')
),
),

interval: $ => {
ci = s => new RegExp(caseInsensitive(s))
Expand Down
1 change: 1 addition & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

((account) @field)
((commodity) @text.literal)
((tag) @tag)

"include" @include

Expand Down
26 changes: 22 additions & 4 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,17 @@
]
},
{
"type": "STRING",
"value": "\n"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "note"
},
{
"type": "STRING",
"value": "\n"
}
]
}
]
},
Expand Down Expand Up @@ -1021,8 +1030,17 @@
"name": "interval"
},
{
"type": "STRING",
"value": "\n"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "note"
},
{
"type": "STRING",
"value": "\n"
}
]
}
]
},
Expand Down
Loading

0 comments on commit 1f864fb

Please sign in to comment.