Commit 7751130
committed
feat: implement comment parser
add lexer tokens and rules
remove lexer "Whitespace" token
This token is not needed, we will later use the position information to
pad each token.
implement "Comment" handling
... which is not handling at all for the time being
temporary fix by dropping comments before parseGenericPackageDescription
make metaFields a map of positions
rearrange and simplify field
make lexer emit comment wherever they would occur
stop parser from emitting indentation warning for comments
fix: restore checkIndentation behaviour for Field
test: add dummy tests
test: accept new golden expressions
test: accept new golden expressions
test: rename comment test group
debug: trace tokens
fix: split comments recursively
fix: consume comments after colon in FieldLayoutOrBraces
debug: remove tracing
test: update expected
test: improve comment tests
test: correct comment tests
test: assert interleaving comment parsing
fix: correct interleaving comment parsing
test: update expected
debug: remove tracing
test: assert parsing of fieldline flag
test: update expected
fix: correct parsing fieldLine starting with -- as comment
test: update expected
test: remove test case that doesn't pass on upstream
minor fixes
test: ignore comment in test comparison
docs: improve comments on the grammar
style: whitespace
style: fourmolu
ref: simplification
docs: update grammar specification for comments
ref: run hlint
improve describeToken on comments
ref: make diff smaller
test: fix no-thunks test
test: fix md5Check test
fix compiler errors and warnings
test: add expectation for failing hackage test
We also reintroduced the flag "CABAL_PARSEC_DEBUG" to debug the
lexer/parser.
fix hackage test 001
fix hackage test
test: disable comments in comparison in roundtrip hackage test
refactor parser
refactor test
style: run fourmolu
remove todos
yay
test: remove test dependencies
move ToExpr to orphan module
test: simplify
restore accidently formatted cabal
restore previous debug behaviour
refactor: don't use liftA2 and liftA3
refactor annotation to ([Comment ann], ann)
attempt
test: update expects
fix errors for Deprecated module
fix compilation errors for integration tests
fix grammar while incorrect output
We need to look into how to wire the output for it to hold the comments
in the right position.
refactor parser
style: run fourmolu
fix comment attach post processing
refactor
fix: only discard element comments at top level
test: update expected
fix: derive Eq instance for Comment
This fixes builds for old GHC
use strict either for parser
fix: doctest
define proper WithComments data type
remove exactComment field in GenericPackageDescription
add Lens functions for AnnotatedGenericPackageDescription
test AnnotatedGenericPackageDescription instead
run fourmolu
run hlint
remove redundant imports
tests: test hasktorch
tests: update expected
tests: fix integration tests
tests: fix nothunks test
run fourmolu
fix doctests
ref: keep backward compatibility of exported functions
test: explicitly test *WithComment readFields variant
test: fix doctest
fix: build
undo changes from experiments
ref: clean up the parser code
ref: reduce diff1 parent 1e3c355 commit 7751130
File tree
75 files changed
+1657
-247
lines changed- Cabal-syntax
- src/Distribution
- Fields
- PackageDescription
- Parsec
- Types
- AnnotatedGenericPackageDescription
- Cabal-tests/tests
- ParserTests
- comments
- regressions
- Cabal-tree-diff/src/Data/TreeDiff/Instances
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
75 files changed
+1657
-247
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
| |||
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
| 161 | + | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
47 | 69 | | |
48 | 70 | | |
49 | 71 | | |
50 | 72 | | |
51 | | - | |
| 73 | + | |
52 | 74 | | |
53 | 75 | | |
54 | 76 | | |
| |||
73 | 95 | | |
74 | 96 | | |
75 | 97 | | |
76 | | - | |
| 98 | + | |
77 | 99 | | |
78 | 100 | | |
79 | 101 | | |
| |||
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
97 | | - | |
| 119 | + | |
98 | 120 | | |
99 | 121 | | |
100 | 122 | | |
| |||
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
118 | | - | |
| 140 | + | |
119 | 141 | | |
120 | 142 | | |
121 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
244 | | - | |
| 246 | + | |
| 247 | + | |
245 | 248 | | |
246 | 249 | | |
247 | | - | |
| 250 | + | |
| 251 | + | |
248 | 252 | | |
249 | 253 | | |
250 | 254 | | |
| |||
0 commit comments