Commit
Author: Michael Davis [mcarsondavis@gmail.com]
Hash: 4264c00122a6ad4213a42b4fe8cbf819bc9dcf13
Timestamp: Sat, 10 Dec 2022 00:45:45 +0000 (2 years ago)

+18 -0 +/-2 browse
Parse three or more '+'s as additions
1diff --git a/grammar.js b/grammar.js
2index 4751d38..79ca4e4 100644
3--- a/grammar.js
4+++ b/grammar.js
5 @@ -54,6 +54,8 @@ module.exports = grammar({
6 addition: ($) => choice(
7 iseq("+", optional(ANYTHING)),
8 iseq("++", optional(ANYTHING)),
9+ iseq("+++"),
10+ iseq("++++", optional(ANYTHING)),
11 ),
12 deletion: ($) =>
13 choice(
14 diff --git a/test/corpus/text.txt b/test/corpus/text.txt
15index ed5fe30..82e0a40 100644
16--- a/test/corpus/text.txt
17+++ b/test/corpus/text.txt
18 @@ -241,3 +241,19 @@ Leading dash deletions
19 (deletion)
20 (deletion)
21 (deletion))
22+
23+ ================================================================================
24+ Leading plus additions
25+ ================================================================================
26+ ++123
27+ ++
28+ ++++1234
29+ +++++1234
30+
31+ --------------------------------------------------------------------------------
32+
33+ (source
34+ (addition)
35+ (addition)
36+ (addition)
37+ (addition))