Commit
Author: Michael Davis [mcarsondavis@gmail.com]
Hash: 913a0c167aa339356a3190594da1e9860ff4a642
Timestamp: Mon, 05 Sep 2022 14:29:42 +0000 (2 years ago)

+12 -1 +/-2 browse
Mark lines starting with '--' as deletions
1diff --git a/grammar.js b/grammar.js
2index 7169e19..50c986a 100644
3--- a/grammar.js
4+++ b/grammar.js
5 @@ -52,7 +52,8 @@ module.exports = grammar({
6 iseq("@@", $.linerange, $.linerange, "@@", optional(ANYTHING)),
7
8 addition: ($) => iseq("+", optional(ANYTHING)),
9- deletion: ($) => iseq("-", optional(ANYTHING)),
10+ deletion: ($) =>
11+ choice(iseq("-", optional(ANYTHING)), iseq("--", optional(ANYTHING))),
12
13 context: ($) => token(prec(-1, ANYTHING)),
14
15 diff --git a/test/corpus/text.txt b/test/corpus/text.txt
16index 73cc93b..2f1f90a 100644
17--- a/test/corpus/text.txt
18+++ b/test/corpus/text.txt
19 @@ -225,3 +225,13 @@ index 321c90a..b4a5cba 100644
20 (addition)
21 (addition)
22 (addition))
23+
24+ ================================================================================
25+ Double dash
26+ ================================================================================
27+ --123
28+
29+ --------------------------------------------------------------------------------
30+
31+ (source
32+ (deletion))