1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00
Commit Graph

20268 Commits

Author SHA1 Message Date
Rob Rix
b6f9fea37d
Use fromMaybes to define maybeBlobPair. 2019-10-18 12:26:50 -04:00
Rob Rix
41f38b1c59
Use Applicative to tidy up further. 2019-10-18 12:25:40 -04:00
Rob Rix
fecb0d8f1f
Use fromMaybes to clean up the FromJSON instance for BlobPair. 2019-10-18 12:25:09 -04:00
Rob Rix
fc93bb4b4d
Define a helper to construct an Edit from a pair of Maybes. 2019-10-18 12:24:44 -04:00
Rob Rix
cb3fa623b1
Alignment. 2019-10-18 12:20:32 -04:00
Rob Rix
1bdf9ff63a
Alignment. 2019-10-18 12:19:02 -04:00
Rob Rix
c80af0fc21
🔥 mergeEditWith. 2019-10-18 12:18:47 -04:00
Rob Rix
1d72bfe0ef
📝 mergeEdit. 2019-10-18 12:17:34 -04:00
Rob Rix
f140d97d23
Fix the docs for edit. 2019-10-18 12:16:26 -04:00
Rob Rix
6722f2f9da
Fix docs. 2019-10-18 12:15:20 -04:00
Rob Rix
84a448ad4f
Simplify the Bitraversable instance. 2019-10-18 12:14:47 -04:00
Rob Rix
a2812137c2
Alignment. 2019-10-18 12:12:55 -04:00
Rob Rix
b3e6f527a3
More alignment. 2019-10-18 12:12:29 -04:00
Rob Rix
f870e977ff
Align. 2019-10-18 12:12:02 -04:00
Rob Rix
8a7d72edbf
Rename the eq parameters. 2019-10-18 12:11:33 -04:00
Rob Rix
0764de8320
LambdaCase. 2019-10-18 12:11:19 -04:00
Rob Rix
38cff494e7
LambdaCase. 2019-10-18 12:11:06 -04:00
Rob Rix
7e5f28dba5
Define an Ord2 instance for Edit. 2019-10-18 12:10:50 -04:00
Rob Rix
1e30f49984
Use mergeEditWith to compute languageForBlobPair. 2019-10-18 12:06:53 -04:00
Rob Rix
14182b3d21
Use mergeEditWith to compute path keys. 2019-10-18 12:05:13 -04:00
Rob Rix
0dd2021a44
Define a generalization of mergeEdit. 2019-10-18 12:04:16 -04:00
Rob Rix
0b6b79b42b
Use mergeEdit to define pathForBlobPair. 2019-10-18 12:02:47 -04:00
Rob Rix
43eeca7d10
Define a helper to merge edits. 2019-10-18 12:02:38 -04:00
Rob Rix
23d34a7c6e
🔥 redundant parens. 2019-10-18 11:59:27 -04:00
Rob Rix
b00715e247
🔥 the pattern synonyms. 2019-10-18 11:57:26 -04:00
Rob Rix
36ee5fcfce
Alignment. 2019-10-18 11:52:50 -04:00
Rob Rix
571cb74d43
Style. 2019-10-18 11:52:38 -04:00
Rob Rix
7a3c4ac5fc
🔥 the Bicrosswalk instance for Edit. 2019-10-18 11:50:16 -04:00
Rob Rix
9170893153
Inline the definition of bicrosswalk & alignWith. 2019-10-18 11:48:43 -04:00
Rob Rix
9813bdd5f0
🔥 the re-export of Data.These from Prologue. 2019-10-18 11:29:03 -04:00
Rob Rix
939041c43a
tryAlignWith uses Edit. 2019-10-18 11:25:02 -04:00
Rob Rix
a7dc70f474
🔥 diffThese. 2019-10-18 11:20:35 -04:00
Rob Rix
c80219296e
Redefine BlobPair as a type synonym. 2019-10-18 11:12:54 -04:00
Rob Rix
bf9a4e1260
Parsing produces an Edit of terms. 2019-10-18 11:09:06 -04:00
Rob Rix
5c6371b6db
Don’t qualify the names of the Edit constructors. 2019-10-18 10:59:00 -04:00
Rob Rix
759ca6d3cc
Define BlobPair using Edit. 2019-10-18 10:58:36 -04:00
Patrick Thomson
8289e7eb22 Merge remote-tracking branch 'origin/master' into bump-lingo 2019-10-18 10:53:36 -04:00
Rob Rix
9cce18a921
🔥 Both. 2019-10-18 10:46:45 -04:00
Rob Rix
6606d52841
Eliminate uses of Both. 2019-10-18 10:45:59 -04:00
Rob Rix
29ceb4c8d6
Don’t export Both in the Prologue. 2019-10-18 10:26:20 -04:00
Rob Rix
88c12a963b
🔥 toThese. 2019-10-17 22:54:16 -04:00
Rob Rix
6f0c2a6450
Diff directly in Edit. 2019-10-17 22:53:45 -04:00
Rob Rix
55ee8b4f7a
Define a helper to diff an Edit of terms. 2019-10-17 22:53:21 -04:00
Rob Rix
b26c941b9c
🔥 SES.Edit. 2019-10-17 22:50:14 -04:00
Rob Rix
209f8871a5
Rename Patch to Edit. 2019-10-17 22:48:19 -04:00
Rob Rix
e4af857c5b
Rename Copy to Compare. 2019-10-17 22:44:57 -04:00
Rob Rix
7b37f3789f
Rename Data.Patch to Data.Edit. 2019-10-17 22:43:03 -04:00
Rob Rix
6b7ef7c725
🔥 before/after. 2019-10-17 22:39:34 -04:00
Rob Rix
b6caf8d98f
Move the ToJSONFields instance for Patch into Data.JSON.Fields. 2019-10-17 22:36:50 -04:00
Rob Rix
e6ffee0829
Import everything explicitly. 2019-10-17 22:35:43 -04:00
Rob Rix
76d35900df
Rename patch to edit. 2019-10-17 22:34:19 -04:00
Rob Rix
eb549cff26
Align. 2019-10-17 22:31:16 -04:00
Rob Rix
fc394d69e7
Rename some variables. 2019-10-17 22:28:35 -04:00
Rob Rix
c59e205447
Rename some type parameters. 2019-10-17 22:28:15 -04:00
Rob Rix
c452385869
Use LambdaCase to define patch. 2019-10-17 22:26:17 -04:00
Rob Rix
8f91dd09bb
Use defaults in terms of bitraverse. 2019-10-17 22:25:15 -04:00
Rob Rix
3cf78abe5f
LambdaCase. 2019-10-17 22:24:46 -04:00
Rob Rix
20c92cb22a
🔥 2019-10-17 22:21:26 -04:00
Rob Rix
aeff33b31a
🔥 a redundant OPTIONS_GHC pragma. 2019-10-17 22:20:41 -04:00
Rob Rix
fb72904e1b
Correct a doc comment. 2019-10-17 22:19:48 -04:00
Rob Rix
64c4fed882
Rename replacing to comparing. 2019-10-17 22:18:48 -04:00
Rob Rix
dd7f65828a
Rename replaceF to compareF. 2019-10-17 22:17:01 -04:00
Rob Rix
9557070bfb
Rename Replace to Compare. 2019-10-17 22:15:58 -04:00
Rob Rix
c07532e3f3
Merge branch 'toc-this-way' into join-these-blobs-with-this-one-weird-trick 2019-10-17 22:04:35 -04:00
Rob Rix
8a3c49f3df
Reformat dedupe. 2019-10-17 22:03:02 -04:00
Rob Rix
fbfcdd8985
LambdaCase. 2019-10-17 21:59:35 -04:00
Rob Rix
7ab0695766
More queswish.
Co-Authored-By: Patrick Thomson <patrickt@github.com>
2019-10-17 19:38:34 -04:00
Rob Rix
3d1732a061
Use the queswish operator.
Co-Authored-By: Patrick Thomson <patrickt@github.com>
2019-10-17 19:37:58 -04:00
Rob Rix
ea2cd5528a
Define a Bifunctor instance for Edit. 2019-10-17 13:55:59 -04:00
Rob Rix
30872c822f
Export SummarizeDiff & the parsers. 2019-10-17 13:50:12 -04:00
Rob Rix
1886c9d4e5
Parse language mode arguments for diffing. 2019-10-17 12:44:24 -04:00
Rob Rix
3d01323129
Extract the parser for the language modes. 2019-10-17 12:43:58 -04:00
Rob Rix
dca68d3714
Use precise parsers for ToC where available. 2019-10-17 12:43:50 -04:00
Rob Rix
c9eee51a15
Run a reader effect for the language modes around diffing. 2019-10-17 12:43:23 -04:00
Rob Rix
93c459b205
Derive SummarizeDiff instances for the precise AST types. 2019-10-17 12:35:51 -04:00
Rob Rix
45363a7950
Define a newtype for computing summaries from tags. 2019-10-17 12:33:51 -04:00
Rob Rix
b22d86b55b
Tags hold a Loc. 2019-10-17 12:28:32 -04:00
Rob Rix
f7a0673dfe
Carry the entire Loc along in Taggable. 2019-10-17 12:16:28 -04:00
Rob Rix
267115ce31
🔥 the text field from Declaration. 2019-10-17 11:36:04 -04:00
Rob Rix
ccc95d87b9
Reformat the end of Declaration. 2019-10-17 11:32:52 -04:00
Rob Rix
8b9a65c4f8
Export summarizeChange. 2019-10-17 11:29:22 -04:00
Rob Rix
1dbd5c6e8f
Rename recordSummary to summarizeChange. 2019-10-17 11:12:40 -04:00
Rob Rix
28d0a94996
Correct the docs for recordSummary. 2019-10-17 11:12:01 -04:00
Rob Rix
c3d7c426c6
Redefine Edit as a datatype. 2019-10-17 11:09:39 -04:00
Rob Rix
dff89a12fb
Define an Edit synonym instead of EditScript. 2019-10-17 11:02:58 -04:00
Rob Rix
925ff6fc41
Derive the ToTags instances for the precise term types. 2019-10-17 06:36:33 -04:00
Rob Rix
2e0f0c4eca
Define a newtype for Precise ToTags deriving. 2019-10-17 06:34:56 -04:00
Rob Rix
a05370f7e1
Move SummarizeDiff into TOCSummaries. 2019-10-17 06:32:47 -04:00
Rob Rix
ef0ec740c9
Incorporate decorateTerm into summarizeTerm. 2019-10-17 06:23:10 -04:00
Rob Rix
f78a16b5c7
🔥 redundant parens. 2019-10-17 06:07:18 -04:00
Rob Rix
b983117cbc
Pass the blobs to diffTerms in These. 2019-10-17 06:05:41 -04:00
Rob Rix
a6ea14ab0a
🔥 decoratingDiffWith. 2019-10-17 06:00:02 -04:00
Rob Rix
140c4019e5
Parsing pairs returns the blobs with the terms. 2019-10-17 05:56:34 -04:00
Rob Rix
0d93d67be8
Define SummarizeDiff over term pairs. 2019-10-17 05:51:32 -04:00
Rob Rix
ac027b325e
Define a function to decorate a pair of terms from a pair of blobs. 2019-10-17 05:47:21 -04:00
Rob Rix
3bb1d65228
Reformat. 2019-10-17 05:46:56 -04:00
Rob Rix
2604e94052
Define BlobPair as a newtype. 2019-10-17 05:16:23 -04:00
Rob Rix
073bf89ee8
Move formatIdentifier to Analysis.TOCSummary. 2019-10-17 04:25:38 -04:00
Rob Rix
a559479779
Align. 2019-10-17 04:24:17 -04:00
Rob Rix
cfb9151d0f
🔥 redundant deriving strategies. 2019-10-17 04:23:49 -04:00
Rob Rix
b682d04653
🔥 a redundant UNPACK pragma. 2019-10-17 03:39:28 -04:00
Rob Rix
baf1868d48
🔥 the proxies. 2019-10-17 03:25:51 -04:00
Rob Rix
5611398aa7
Align. 2019-10-17 03:24:45 -04:00
Rob Rix
9b2ddd3cbe
Sort imports. 2019-10-17 03:24:09 -04:00
Rob Rix
698cc4392d
🔥 CustomHasDeclaration. 2019-10-17 03:23:13 -04:00
Rob Rix
1f58e9a82d
Rename HasDeclarationWithStrategy to HasDeclarationBy. 2019-10-17 03:18:14 -04:00
Rob Rix
30a26f7ff2
🔥 HasDeclaration'. 2019-10-17 03:17:04 -04:00
Rob Rix
65fb560524
🔥 the whole parameter. 2019-10-17 03:15:54 -04:00
Rob Rix
ec7b0755ae
🔥 redundant parens. 2019-10-17 03:13:01 -04:00
Rob Rix
89b8fb1397
Don’t export declaration. 2019-10-17 03:08:09 -04:00
Rob Rix
bed762db8e
Rename DeclarationKind to Kind. 2019-10-17 03:05:33 -04:00
Rob Rix
62617b3eea
Rename the DeclarationKind constructors. 2019-10-17 03:04:57 -04:00
Rob Rix
3ddb57fb4c
List the Data.Aeson imports explicitly. 2019-10-17 03:04:41 -04:00
Rob Rix
12df95e509
Qualify the import of Data.Error. 2019-10-17 02:56:10 -04:00
Rob Rix
d23e0a17ba
Reformat toChange/toError. 2019-10-17 02:50:13 -04:00
Rob Rix
eb2ee42c7e
Extract some helpers to the top level. 2019-10-17 02:49:30 -04:00
Rob Rix
ea20b4e980
Preserve the kind in TOCSummary as late as possible. 2019-10-17 02:46:57 -04:00
Rob Rix
1990de19c2
Fix an indentation bug. 2019-10-17 02:44:57 -04:00
Rob Rix
9c5a5be7f4
Move formatKind into Analysis.TOCSummary. 2019-10-17 02:44:18 -04:00
Patrick Thomson
defbeb5e7e Merge remote-tracking branch 'origin/master' into bump-lingo 2019-10-16 23:40:08 -04:00
Rob Rix
5e3fd0e6d1
Reuse toMap. 2019-10-16 23:13:41 -04:00
Rob Rix
39a643c149
🔥 summaryKey. 2019-10-16 23:13:06 -04:00
Rob Rix
433288f715
Don’t bind separate variables for path/lang. 2019-10-16 23:12:27 -04:00
Rob Rix
a91fd4fd5a
Align. 2019-10-16 23:10:22 -04:00
Rob Rix
9ffddbd203
Reuse toFile. 2019-10-16 23:10:00 -04:00
Rob Rix
491d912c3e
Map instead of folding. 2019-10-16 23:08:54 -04:00
Rob Rix
e06187627f
Correct how we construct Summaries. 2019-10-16 23:08:36 -04:00
Rob Rix
9fc7b807e1
Split TOCSummary up into separate datatypes for valid and error summaries. 2019-10-16 23:02:16 -04:00
Rob Rix
4417506758
Build lists in the fold. 2019-10-16 22:55:47 -04:00
Rob Rix
3ef5943117
Don’t rebuild the whole message every step. 2019-10-16 22:46:01 -04:00
Rob Rix
c35d91736f
Don’t convert the kind to text during deduping. 2019-10-16 22:38:22 -04:00
Rob Rix
fd888e8243
Derive an Ord instance for DeclarationKind. 2019-10-16 22:37:46 -04:00
Rob Rix
53b25956d2
Align. 2019-10-16 22:36:15 -04:00
Rob Rix
d531418ba2
Fix the docs for Change. 2019-10-16 22:35:50 -04:00
Rob Rix
7c6c677fda
Preserve the full Change in TOCSummary as late as possible. 2019-10-16 22:34:24 -04:00
Rob Rix
5b452bf471
Rename the entry field of Dedupe to change. 2019-10-16 22:29:17 -04:00
Rob Rix
2d3f74f2b5
Rename some variables. 2019-10-16 22:27:26 -04:00
Rob Rix
8c0c6ebcd4
Rename formatEntry to formatChange. 2019-10-16 22:26:55 -04:00
Rob Rix
27ae91c883
Rename ChangeType to Change. 2019-10-16 22:25:24 -04:00
Rob Rix
05e3944464
Rename the changeType field to change. 2019-10-16 22:25:02 -04:00
Rob Rix
dd4c6ed8a5
Rename Entry to ChangeType. 2019-10-16 22:23:04 -04:00
Rob Rix
a1c9738d69
Move Entry up. 2019-10-16 22:22:12 -04:00
Rob Rix
bad94967a9
Rename the ErrorSummary fields. 2019-10-16 22:21:36 -04:00
Rob Rix
bd7c33d1ae
Align. 2019-10-16 22:20:25 -04:00
Rob Rix
9dc8140af7
Reformat the ErrorSummary case. 2019-10-16 22:20:19 -04:00
Rob Rix
5d376b41a5
Rename the TOCSummary fields. 2019-10-16 22:19:58 -04:00
Rob Rix
3be5fa1953
🔥 the Generic instance for TOCSummary. 2019-10-16 22:18:27 -04:00
Rob Rix
58a208ddc8
Align the TOCSummary fields. 2019-10-16 22:16:49 -04:00
Rob Rix
fbf87d22c1
🔥 some redundant signatures. 2019-10-16 22:15:35 -04:00
Rob Rix
dc6782c6b4
🔥 LegacySummarizeDiff. 2019-10-16 22:13:59 -04:00
Rob Rix
7f959d1978
Define legacyDiffSummary using summarizeDiff. 2019-10-16 22:13:14 -04:00
Rob Rix
def8e1b6fb
Move the guts of summarizeDiff into TOCSummaries. 2019-10-16 22:11:36 -04:00
Rob Rix
cb77c1b810
🔥 renderToCDiff. 2019-10-16 18:55:32 -04:00
Rob Rix
27ad92b6b1
Inline the definition of renderToCDiff into legacySummarizeDiff. 2019-10-16 18:54:57 -04:00
Rob Rix
429cf1e7c3
Rename entryChange to formatEntry. 2019-10-16 18:47:02 -04:00
Rob Rix
0531d03f91
Rename toCategoryName to formatKind. 2019-10-16 18:46:47 -04:00
Rob Rix
1242180ccc
Don’t export toCategoryName. 2019-10-16 18:46:16 -04:00
Rob Rix
220c6dd133
Rename the Declaration fields. 2019-10-16 18:42:57 -04:00
Rob Rix
b99dc6ad23
Unpack DedupeKey. 2019-10-16 18:41:10 -04:00
Rob Rix
9dbb019833
🔥 findSimilarBy. 2019-10-16 18:39:32 -04:00
Rob Rix
a98588bf29
Don’t recompute the key. 2019-10-16 18:39:07 -04:00
Rob Rix
f8a24c4c4d
Reformat. 2019-10-16 18:36:09 -04:00
Rob Rix
83a84e0d22
Alignment. 2019-10-16 18:35:52 -04:00
Rob Rix
a0fbf8433e
🔥 redundant parens. 2019-10-16 18:35:36 -04:00
Rob Rix
fe1de046b0
findSimilar returns just the similar Declaration. 2019-10-16 18:35:00 -04:00
Rob Rix
8519e25b26
Call entryChange from recordSummary. 2019-10-16 18:30:56 -04:00
Rob Rix
94099aad8f
Don’t prefix the Dedupe fields. 2019-10-16 18:29:47 -04:00
Rob Rix
c94e53adf9
Don’t repack Dedupe when we don’t have to. 2019-10-16 18:28:11 -04:00
Rob Rix
ca4247d6af
🔥 the signature for go. 2019-10-16 18:27:18 -04:00
Rob Rix
b2bbe03e85
Map the entries into Dedupe. 2019-10-16 18:27:05 -04:00
Rob Rix
b3e49380c7
Use strict triples in the maps. 2019-10-16 18:26:10 -04:00
Rob Rix
978b406be2
Don’t match the index & entry. 2019-10-16 18:20:57 -04:00
Rob Rix
8b4c045e0d
Define go as a case expression. 2019-10-16 18:19:32 -04:00
Rob Rix
f366d4519d
Extract a helper to find a similar entry. 2019-10-16 18:16:59 -04:00
Rob Rix
444f0b306c
Index the elements, not the fold. 2019-10-16 18:15:37 -04:00
Rob Rix
ce0866dc1b
Uncurry go. 2019-10-16 18:14:27 -04:00
Rob Rix
2523d60b2c
Rename similarDecl to similar. 2019-10-16 18:13:14 -04:00
Rob Rix
fba58c685f
🔥 termTableOfContentsBy. 2019-10-16 18:12:40 -04:00
Rob Rix
e084c83b7f
Alignment. 2019-10-16 18:11:24 -04:00
Rob Rix
203ea9c954
Define recordSummary using guards. 2019-10-16 18:05:51 -04:00
Rob Rix
73713125cd
Extract formatIdentifier to the top level. 2019-10-16 18:04:08 -04:00
Rob Rix
be95b43b71
Reformat formatIdentifier. 2019-10-16 18:03:13 -04:00
Rob Rix
a0d9f57239
Pattern match in dedupeKey. 2019-10-16 18:00:52 -04:00
Rob Rix
ab0781c07a
Factor Declaration into a kind and the rest of the fields. 2019-10-16 18:00:05 -04:00
Rob Rix
10e82079b9
🔥 the Generic instance for Declaration. 2019-10-16 17:54:48 -04:00
Rob Rix
3a3145050c
Spacing. 2019-10-16 17:45:27 -04:00
Rob Rix
6f7683c9a7
🔥 redundant parens. 2019-10-16 17:45:17 -04:00
Rob Rix
483e6b2f2c
Curry go. 2019-10-16 17:42:13 -04:00
Rob Rix
50638e0205
Factor out the tuple. 2019-10-16 17:40:57 -04:00
Rob Rix
bfec2ffa45
Reformat go. 2019-10-16 17:40:20 -04:00
Rob Rix
582d516bf4
Inline tuples. 2019-10-16 17:39:21 -04:00
Rob Rix
a488ec2d9f
Compose. 2019-10-16 17:39:08 -04:00
Rob Rix
a2348e3463
Monomorphize. 2019-10-16 17:38:41 -04:00
Rob Rix
b54d109311
Move tuples into the where clause. 2019-10-16 17:35:46 -04:00
Rob Rix
70414495f5
🔥 exactMatch. 2019-10-16 17:35:17 -04:00
Rob Rix
d9505164fb
Match the decl explicitly. 2019-10-16 17:34:40 -04:00
Rob Rix
bf8f03ce37
🔥 a let. 2019-10-16 17:33:43 -04:00
Rob Rix
6ced7e6fae
dedupeKey takes the second field only. 2019-10-16 17:32:14 -04:00
Rob Rix
aa98934d85
Split the entry change type logic out of recordSummary. 2019-10-16 17:29:58 -04:00
Rob Rix
fb41c1741e
🔥 the export of entrySummary. 2019-10-16 17:29:35 -04:00
Rob Rix
0246a2e130
Align. 2019-10-16 17:26:32 -04:00
Rob Rix
6fe1467956
Monomorphize. 2019-10-16 17:26:10 -04:00
Rob Rix
d8dc9b7d25
Split Entry up into an enum in a tuple. 2019-10-16 17:25:30 -04:00
Patrick Thomson
ba122b2aae Bump lingo to 0.3 and remove hack associated with #333.
Now that lingo's language detection returns all possible results for a
given filename, we're able to abolish the workaround where we parsed
the string `"Hack"` into PHP. We have to check ourselves for spurious
results associated with Hack, TSX, and Markdown files, but that's
fitting and proper, rather than doing it behind the scenes in lingo.
2019-10-14 15:55:48 -04:00
Patrick Thomson
df96f43acd Make findFilesInDir use pathtype. 2019-10-11 19:24:53 -04:00
Patrick Thomson
78d7ba126b Make languageForFilePath work for .php files.
As reported in #330, we're currently dying in `languageForFilePath`
because `lingo` is giving us back Hack when we expect PHP. This is a
pretty bad bug, so here's a temporary workaround for the issue. Once
https://github.com/tclem/lingo-haskell/issues/3 is fixed, we can
remove this workaround.

Fixes #330.
2019-10-11 12:16:17 -04:00
Rick Winfrey
e07d63f284 Java as code nav language; update javaParser 2019-10-09 12:56:50 -07:00
Patrick Thomson
c12eca0c00 Pathtype comes with a shim for withBinaryFile. 2019-10-08 18:57:28 -04:00
Patrick Thomson
4110353b63 Make the -o option demand a file path.
You can test this like so:

```
cabal run semantic -- -o /tmp/blah/ parse --json --gitDir .git --sha HEAD
option -o: "/tmp/blah/" is not a valid file path
```

This would previously fail at runtime with a less informative error message:

```
/tmp/blah/: openBinaryFile: inappropriate type (Not a directory)
```
2019-10-08 18:52:28 -04:00
Patrick Thomson
d998c40043
Merge branch 'master' into 🔥-ts-parse 2019-10-08 18:28:03 -04:00
Patrick Thomson
3e65913d27 Fix a build error. 2019-10-08 18:24:36 -04:00
Rob Rix
e57359a8bf
Merge branch 'master' into 🔥-ts-parse 2019-10-08 18:00:56 -04:00
Patrick Thomson
2036569a09
Merge pull request #312 from github/remove-shelly
Remove shelly in favor of streaming-bytestring and utf8-string.
2019-10-08 17:58:59 -04:00
Rob Rix
2291e0c97d
Merge branch 'precise-json' into 🔥-ts-parse 2019-10-08 17:37:29 -04:00
Patrick Thomson
8368950c03
Merge branch 'master' into remove-shelly 2019-10-08 16:52:07 -04:00
Rob Rix
b053774ede
Merge branch 'remove-reprinter-and-rewriter' into precise-json 2019-10-08 16:32:19 -04:00
Patrick Thomson
eabfd53284 Redundant import. 2019-10-08 15:50:26 -04:00
Patrick Thomson
df9e272419 Some Evaluatable instances got nuked. 2019-10-08 15:50:07 -04:00
Patrick Thomson
3b4b9dc95e fix stray typo and remove spec invocations 2019-10-08 15:02:33 -04:00
Patrick Thomson
693c317bf0 Remove experimental reprinting and rewriting facilities.
As we shift to a precise, non-DTALC representation of language syntax,
the foundations upon which our (experimental) reprinting and rewriting
framework are becoming questionable. These experiments are not hooked
up anywhere (except the tests), constitute a considerable amount of
code, and are getting in the way of @robrix and myself lately.

I like a lot of this code, but if we're not using it, it's our moral
imperative to delete it, if only to reduce the carbon emissions
associated with our CI builds. We can always rescuscitate it from the
git history if we find ourselves wanting it back.
2019-10-08 14:41:31 -04:00
Rob Rix
bacb523b7f
Use the AST synonym in the type of MarkdownParser. 2019-10-07 14:40:09 -04:00
Rob Rix
a457d8777f
Use the AST synonym in the type of AssignmentParser. 2019-10-07 14:39:39 -04:00
Rob Rix
c01e8314ff
🔥 the various *ASTParsers. 2019-10-07 14:37:53 -04:00
Rob Rix
3cad826597
🔥 SomeASTParser. 2019-10-07 14:35:49 -04:00
Rob Rix
a21afc0e1b
🔥 Semantic.AST. 2019-10-07 14:35:05 -04:00
Rob Rix
c25cac9531
🔥 tsParseCommand. 2019-10-07 14:34:07 -04:00
Rob Rix
2f6d485205
Get tree_sitter_python from semantic-python for the precise parser.
It’s the same symbol, but will ease breaking the dependency when we 🔥 à la carte Python.
2019-10-07 14:22:28 -04:00
Rob Rix
223007c508
Get tree_sitter_java from Language.Java. 2019-10-07 14:18:46 -04:00
Rob Rix
bb898a34e6
Get tree_sitter_json from Language.JSON. 2019-10-07 14:13:30 -04:00
Patrick Thomson
edb2e1c155 Stylish. 2019-10-07 12:37:58 -04:00
Patrick Thomson
cc9d398947 Small cleanup on lsTree. 2019-10-07 12:34:47 -04:00
Patrick Thomson
fe7301575c Remove shelly in favor of streaming-bytestring and utf8-string. 2019-10-07 12:29:42 -04:00
Rob Rix
17c70240d4
🔥 Assigning.Assignment.Deterministic. 2019-10-07 11:56:00 -04:00
Rob Rix
f4da0a8db4
🔥 DeterministicParser. 2019-10-07 11:55:21 -04:00
Rob Rix
6b4b5011aa
🔥 Language>JSON.Assignment. 2019-10-07 11:42:01 -04:00
Rob Rix
6f9d49fef8
🔥 jsonParser. 2019-10-07 11:13:42 -04:00
Rob Rix
058aab0417
🔥 jsonASTParser. 2019-10-07 11:13:36 -04:00
Rob Rix
47020db964
Drop support for JSON from someASTParser. 2019-10-07 11:12:08 -04:00
Rob Rix
a87b91d9a4
🔥 jsonParserALaCarte'. 2019-10-07 11:10:56 -04:00
Rob Rix
190abe1af5
Simplify aLaCarteParsers to exclude à la carte JSON. 2019-10-07 11:10:22 -04:00
Rob Rix
4743e4e595
Simplify allParsers to exclude à la carte JSON. 2019-10-07 11:10:10 -04:00
Rob Rix
ac961fb945
🔥 modeForLanguage. 2019-10-07 11:07:52 -04:00
Rob Rix
9568ff6f2d
JSON defaults to precise.
This isn’t actually all that useful, but for completeness’ sake.
2019-10-07 11:06:32 -04:00
Rob Rix
734c365674
Add precise JSON to allParsers. 2019-10-07 11:05:49 -04:00
Rob Rix
656f1e187e
Define a ToTags instance for JSON terms. 2019-10-07 11:05:28 -04:00
Rob Rix
8a3fd7ef67
Alphabetize. 2019-10-07 11:04:56 -04:00
Rob Rix
ed17dcbeea
Define an SExprTerm instance for precise JSON. 2019-10-07 10:57:17 -04:00
Rob Rix
4f6e91a128
Define a ShowTerm instance for precise JSON. 2019-10-07 10:57:02 -04:00
Rob Rix
a4ed7de6f0
🔥 a redundant -fno-warn-orphans. 2019-10-07 10:51:50 -04:00
Rob Rix
53803071b0
Rename jsonParser' to jsonParserALaCarte. 2019-10-07 10:48:51 -04:00
Rob Rix
e5e9228f56
Export jsonParserPrecise'. 2019-10-07 10:42:52 -04:00
Rob Rix
f4212d2c6e
Add a precise JSON parser. 2019-10-07 10:40:52 -04:00
Rob Rix
56956198fa
Fix an overlooked case. 2019-10-07 10:40:30 -04:00
Rob Rix
20bc736250
Fix a renamed rule. 2019-10-07 10:40:11 -04:00
Rob Rix
f930c7eb9a
Merge branch 'precise-s-expressions' into fused-effects-one-dot-zero 2019-10-07 09:21:31 -04:00
Rob Rix
1ec330fbe4
Annotate the kind of ToSExpression. 2019-10-07 09:17:30 -04:00
Rob Rix
57826de7a0
Merge branch 'semantic-java' into precise-s-expressions 2019-10-07 09:16:33 -04:00
Rob Rix
a9abd08f5c
Merge branch 'master' into semantic-java 2019-10-07 09:10:20 -04:00
Rob Rix
13a6989a01
Port Control.Effect.Parse forward. 2019-10-07 09:07:02 -04:00
Rick Winfrey
4729b5e677 Remove Haskell language modules for now 2019-10-04 15:00:58 -07:00
Patrick Thomson
e5841eb473 Squash warnings. 2019-10-04 15:49:34 -04:00
Patrick Thomson
4684e3a798 Overhaul catFile. 2019-10-04 12:39:13 -04:00
Rob Rix
2791018ce0
Merge remote-tracking branch 'origin/semantic-java' into precise-s-expressions 2019-10-03 14:26:53 -04:00
Rob Rix
4eb0e76bee
Use square brackets for collections. 2019-10-03 14:24:00 -04:00
Rob Rix
722f8d3a18
Special-case empty collections. 2019-10-03 14:22:46 -04:00
Rob Rix
9439145b2b
Increase indentation. 2019-10-03 14:21:02 -04:00
Rob Rix
67e2909b05
Simplify the formatting of compositions. 2019-10-03 14:17:29 -04:00
Rob Rix
546c1d0e64
List the imports explicitly. 2019-10-03 14:15:47 -04:00
Rob Rix
7b74525d2f
Specialize for the wrapper types and format accordingly. 2019-10-03 14:11:51 -04:00
Rob Rix
7dabb9a972
Use a list literal. 2019-10-03 13:50:47 -04:00
Rob Rix
70c309aaec
Tweak to alignment. 2019-10-03 13:43:21 -04:00
Rob Rix
90341c1138
Merge branch 'master' into semantic-java 2019-10-03 13:24:52 -04:00
Rob Rix
779b1154c6
Allow s-expr rendering for Java & precise Python. 2019-10-03 12:58:06 -04:00
Timothy Clem
f8c76b2329 Merge remote-tracking branch 'origin/master' into proto-lens 2019-10-03 09:48:06 -07:00
Rob Rix
88f9fc88c7
Define a SExprTerm instance for Precise python. 2019-10-03 12:47:18 -04:00
Rob Rix
b322d2674e
Define a SExprTerm instance for Java. 2019-10-03 12:47:10 -04:00
Rob Rix
4ffa6c4a26
sexprTerm is pure. 2019-10-03 12:46:03 -04:00
Rob Rix
e1a18eeb05
Bypass serialize and call into the s-expression serialization code directly. 2019-10-03 12:45:16 -04:00
Timothy Clem
32f6e9dfb9 ++proto-lens-jsonpb to handle excluding default fields 2019-10-03 08:41:30 -07:00
Rob Rix
867a65c575
Don’t print L1/R1. 2019-10-03 02:50:42 -04:00
Rob Rix
70b24a476d
Define a GToSExpression instance for :.:. 2019-10-03 02:42:08 -04:00
Rob Rix
feac508bb5
Update Precise.hs
Define a GToSExpression instance for Rec1.
2019-10-03 02:40:44 -04:00
Rob Rix
4b0ec75528
Define a GToSExpression instance for Par1. 2019-10-03 02:39:22 -04:00
Rob Rix
48cf558a72
Define ToSExpression at * -> *. 2019-10-03 02:38:01 -04:00
Rob Rix
310e3a36ee
Use ambiguous types instead of proxies. 2019-10-03 02:29:36 -04:00
Rob Rix
8e9fe4e58a
Rename toSExpressionWithStrategy to toSExpression'. 2019-10-03 02:28:59 -04:00
Rob Rix
09070aaf33
Rename ToSExpressionWithStrategy to ToSExpressionBy. 2019-10-03 02:28:32 -04:00
Rob Rix
14e8fd1c50
Merge branch 'master' into semantic-java 2019-10-02 20:51:14 -04:00
Rob Rix
54324a98a7
Merge branch 'master' into list-parsers-independently 2019-10-02 20:27:30 -04:00
Patrick Thomson
2231f7e749 Make runParse return an Either TSParseException. 2019-10-02 18:44:51 -04:00
Rob Rix
914f69add8
🔥 the à la carte Java stuff. 2019-10-02 18:02:50 -04:00
Rob Rix
150ce9b7f3
There isn’t any à la carte Java. 2019-10-02 18:01:31 -04:00
Rob Rix
30d11fe288
Merge branch 'list-parsers-independently' into semantic-java 2019-10-02 17:44:51 -04:00
Rob Rix
116e5b385a
Merge branch 'master' into semantic-java 2019-10-02 17:32:09 -04:00
Timothy Clem
54eb044136 Minor cleanup 2019-10-02 14:21:02 -07:00
Timothy Clem
5fbcca4fe4 Merge remote-tracking branch 'origin/master' into proto-lens 2019-10-02 13:49:32 -07:00
Timothy Clem
85bf7e72ec Use tclem/proto-lens-jsonpb 2019-10-02 13:14:16 -07:00
Rob Rix
e55426cff1
Weaken the language extension to MonoLocalBinds. 2019-10-02 15:51:40 -04:00
Rob Rix
ce8928e9a2
📝 AnalysisClasses. 2019-10-02 15:50:45 -04:00
Rob Rix
898eb8a22d
Reformat AnalysisClasses. 2019-10-02 15:50:45 -04:00
Rob Rix
e0bc6dc9a8
Update src/Semantic/Api/Terms.hs
Co-Authored-By: Patrick Thomson <patrickt@github.com>
2019-10-02 15:31:56 -04:00
Rob Rix
34aaec96d7
📝 the parameters to diffWith/decoratingDiffWith. 2019-10-02 15:30:21 -04:00
Rob Rix
f5f3124efa
📝 diffWith/decoratingDiffWith. 2019-10-02 15:26:15 -04:00
Rob Rix
0c3170edc4
📝 DiffFor. 2019-10-02 15:21:13 -04:00
Rob Rix
e4346562d6
📝 DiffTerms. 2019-10-02 15:18:48 -04:00
Rob Rix
8b705faefc
Rename the DiffFor result variable. 2019-10-02 15:18:29 -04:00
Rob Rix
843b49b26d
🔥 HasDiffFor. 2019-10-02 15:18:13 -04:00
Rob Rix
7433b7e6b1
📝 parseWith & parsePairWith’s parameters. 2019-10-02 15:16:35 -04:00
Rob Rix
3dd91ec21a
Fix some docs. 2019-10-02 15:13:48 -04:00
Rob Rix
87e72d1e0e
Give a kind signature for the constraint parameter to SomeAnalysisParser. 2019-10-02 15:13:40 -04:00
Rob Rix
80fbd7184f
📝 the abstract parsers. 2019-10-02 15:05:33 -04:00
Rob Rix
17481f566e
📝 SomeParser. 2019-10-02 14:52:45 -04:00
Rob Rix
fd94a1d3f2
📝 the canonical sets of parsers. 2019-10-02 14:48:36 -04:00
Rob Rix
2d21661c85
📝 parseWith/parsePairWith. 2019-10-02 14:47:11 -04:00
Rob Rix
a7c366cde2
Use Map instead of lists of pairs for the parsers. 2019-10-02 14:45:16 -04:00
Rob Rix
ecd283ac43
Rename precisePythonParser to pythonParserPrecise. 2019-10-02 14:10:59 -04:00
Rob Rix
1a1cdc9acb
🔥 the export of precisePythonParser. 2019-10-02 14:10:05 -04:00
Rob Rix
2a8d57fa6d
Merge branch 'master' into list-parsers-independently 2019-10-02 14:08:26 -04:00
Rob Rix
9c981030b9
🔥 ApplyAll. 2019-10-02 14:05:57 -04:00
Rob Rix
66801bf4f6
SomeAnalysisParser uses a single constraint. 2019-10-02 14:05:04 -04:00
Rob Rix
ce3fe3fbe7
Eliminate a few uses of Join. 2019-10-02 13:57:46 -04:00
Rob Rix
4a6da6903d
🔥 redundant language extensions. 2019-10-02 13:53:08 -04:00
Rob Rix
49fe06d576
🔥 the & typeclass. 2019-10-02 13:51:35 -04:00
Patrick Thomson
cf7f403c0d
Merge branch 'master' into safer-exceptions-over-tree-sitter-ffi 2019-10-02 13:48:14 -04:00
Rob Rix
56f8f5f666
Define an analogue of diffWith which does no decoration. 2019-10-02 13:43:41 -04:00
Rob Rix
6b77558d69
Rename diffWith to decoratingDiffWith. 2019-10-02 13:42:15 -04:00
Rob Rix
21f36e1161
Weaken from GADTs to MonoLocalBinds. 2019-10-02 13:35:32 -04:00
Rob Rix
3ec0981e47
🔥 DiffActions. 2019-10-02 13:30:44 -04:00
Rob Rix
f98471a614
🔥 SomeTermPair. 2019-10-02 13:30:39 -04:00
Rob Rix
fdc0fb6dcc
🔥 Decorate. 2019-10-02 13:29:15 -04:00
Rob Rix
2fb8a77ef2
🔥 doParse. 2019-10-02 13:28:56 -04:00
Rob Rix
a5307843c6
🔥 doDiff. 2019-10-02 13:28:08 -04:00
Rob Rix
99f9edf65f
Use diffWith for summaries. 2019-10-02 13:26:52 -04:00
Rob Rix
dd01c89463
Use diffWith for legacy summaries. 2019-10-02 13:25:42 -04:00
Rob Rix
2be893baf0
🔥 diffParsers. 2019-10-02 13:24:56 -04:00
Rob Rix
af17fb489b
Use diffWith for JSON trees. 2019-10-02 13:24:26 -04:00
Rob Rix
e7013d8c90
Use diffWith for JSON graphs. 2019-10-02 13:23:56 -04:00
Rob Rix
e3734e4165
Use diffWith for DOT. 2019-10-02 13:22:59 -04:00
Rob Rix
a6466b86a2
Use diffWith for show. 2019-10-02 13:22:18 -04:00
Rob Rix
4f50381c4c
Use diffWith to diff s-expressions. 2019-10-02 13:21:21 -04:00
Rob Rix
85509fa339
Explicitly list the type parameters for diffWith. 2019-10-02 13:21:08 -04:00
Rob Rix
5cee2da207
Prove DiffTerms for each of the sets of parsers. 2019-10-02 13:20:56 -04:00
Rob Rix
cf37d082d1
Define sets of parsers for each diff output format. 2019-10-02 13:18:02 -04:00
Rob Rix
589a567e60
Export diffWith. 2019-10-02 13:17:49 -04:00
Rob Rix
4036affcf2
Define a helper to run a diff with a specific set of parsers. 2019-10-02 13:15:07 -04:00
Rob Rix
052c99ec12
Define a typeclass for joining constraints together. 2019-10-02 13:14:25 -04:00
Rob Rix
a888d6722e
Generalize diffTerms to require only DiffTerms. 2019-10-02 13:04:46 -04:00
Rob Rix
4d2fd76b2d
Bifoldable (DiffFor term) is a superclass of DiffTerms. 2019-10-02 13:03:59 -04:00
Rob Rix
2c9349087c
Construct the canonical list of diff parsers. 2019-10-02 12:38:14 -04:00
Rob Rix
e8a89bfddc
Use a class for diff actions. 2019-10-02 12:38:01 -04:00
Rob Rix
8418813e5b
Define all of the diffing actions using HasDiffFor. 2019-10-02 12:32:47 -04:00
Rob Rix
678d586ec5
Define a HasDiffFor class with a type family for the diff. 2019-10-02 12:32:07 -04:00
Patrick Thomson
bbf3554bd7 Move and export the exception type. 2019-10-02 12:23:59 -04:00
Patrick Thomson
4c4329f295 Use Exception.try and throw to handle errors from tree-sitter FFI.
The crossing into IO and across the FFI boundary is a dangerous
journey. A `try` call handles all possible dynamic/IO-bound
exceptions, and enables the use of a more precise error type on our
end (rather than `String`) and makes downstream code simpler (we just
pass on the thrown `SomeException` rather than throwing a new one
based on a `Left String`).
2019-10-02 12:12:05 -04:00
Rob Rix
e8279b9081
Define an action to parse BlobPairs with a single parser. 2019-10-02 12:11:20 -04:00
Patrick Thomson
ca2f8a65a8
Merge branch 'master' into abstract-actions-over-terms 2019-10-02 12:07:35 -04:00
Rob Rix
f07c8a0c98
Use parseWith to produce tags. 2019-10-02 12:05:02 -04:00
Rob Rix
7454477ecc
Compute tags via a more general interface.
This allows us to 🔥 ALaCarteTerm.
2019-10-02 12:01:06 -04:00
Rob Rix
9f97649a33
Swap the order of the source & symbols to summarize params. 2019-10-02 11:57:26 -04:00
Rob Rix
b285e612d9
Move parseWith into Control.Effect.Parse. 2019-10-02 11:46:54 -04:00
Rob Rix
fc9a579085
🔥 doParse. 2019-10-02 11:44:29 -04:00
Rob Rix
837916e922
Use parseWith for JSONGraphTerm. 2019-10-02 11:43:40 -04:00
Rob Rix
41652c96ab
Use parseWith for JSONTreeTerm. 2019-10-02 11:41:21 -04:00
Rob Rix
b0b419bf6e
Use parseWith for DOTGraphTerm. 2019-10-02 11:39:48 -04:00
Rob Rix
5013f3bfca
Define showTermParsers using allParsers. 2019-10-02 11:37:35 -04:00
Rob Rix
f32c25b01a
Define showTermParsers as a function, rather than in a monad. 2019-10-02 11:36:14 -04:00
Rob Rix
d8b99b9cb1
Use the canonical listing of à la carte parsers for sexprTermParsers. 2019-10-02 11:27:13 -04:00
Rob Rix
035f26725f
List the canonical precise parsers. 2019-10-02 11:26:11 -04:00
Rob Rix
7aee07b3ec
List all the canonical parsers. 2019-10-02 11:24:37 -04:00
Rob Rix
1b46f40e8f
List the canonical à la carte parsers. 2019-10-02 11:23:27 -04:00
Rob Rix
0307f7e536
Alphabetize. 2019-10-02 11:22:43 -04:00
Rob Rix
2e9213bfda
Use parseWith for SExprTerm. 2019-10-02 11:19:48 -04:00
Rob Rix
d7d71f2ba5
List the SExprTerm parsers. 2019-10-02 11:18:51 -04:00
Rob Rix
316e6ad0aa
Replace annotations with () in Python terms. 2019-10-02 11:13:53 -04:00
Patrick Thomson
ab2f30cf6e List comprehensions are nicer here. 2019-10-02 10:57:29 -04:00
Rob Rix
d168e391ef
Rename doParse' to parseWith. 2019-10-02 10:49:32 -04:00
Rob Rix
5309eed607
Move showTermParsers adjacent to ShowTerm. 2019-10-02 10:48:41 -04:00
Rob Rix
3e137ae384
Use the abstracted parsers to define showTermParsers. 2019-10-02 10:47:53 -04:00
Rob Rix
7fdeb90f6b
Define abstracted parsers. 2019-10-02 10:46:15 -04:00
Rob Rix
e3e14a666b
Move SomeParser to Parsing.Parser. 2019-10-02 10:45:53 -04:00
Rob Rix
3026e6210b
Add separators to the haddocks. 2019-10-02 10:32:57 -04:00
Rob Rix
e71e1fcca1
Show terms using showTermParsers/doParse'. 2019-10-02 09:56:57 -04:00
Rob Rix
fe13a6c560
Define a helper to parse using a given list of parsers. 2019-10-02 09:56:42 -04:00
Rob Rix
1e35fcf8e8
Define the list of parsers for the ShowTerm feature. 2019-10-02 09:56:30 -04:00
Rob Rix
a1511f2a4d
Define a SomeParser type abstracting a parser over a given constraint on its terms. 2019-10-02 09:56:10 -04:00
Rob Rix
9f68d5b6c5
Redefine DiffActions as a constraint synonym. 2019-10-02 09:21:08 -04:00
Rob Rix
1fdecb0abb
Redefine TermActions as a constraint synonym since we’re specialized to it. 2019-10-02 09:19:47 -04:00
Rob Rix
764710260c
🔥 yet more redundant language extensions. 2019-10-02 09:14:43 -04:00
Rob Rix
8af41587e4
🔥 more redundant language extensions. 2019-10-02 09:13:41 -04:00
Rob Rix
9b1c99f159
🔥 redundant language extensions. 2019-10-02 08:47:59 -04:00
Patrick Thomson
79e47aaeaf No need for ProjectException. 2019-10-02 00:54:55 -04:00
Rob Rix
c847990bd6
🔥 a redundant language pragma. 2019-10-01 23:33:11 -04:00
Rob Rix
bc62f324df
Diff using an abstract interface. 2019-10-01 23:32:48 -04:00
Rob Rix
08247c7444
Summarize diffs legacy-wise using an abstract interface. 2019-10-01 22:56:41 -04:00
Rob Rix
fea2338eae
🔥 renderToCTerm. 2019-10-01 22:43:43 -04:00
Rob Rix
f08ac25116
Summarize diffs using an abstract interface. 2019-10-01 22:29:29 -04:00
Rob Rix
e5685f9f5c
🔥 redundant parens. 2019-10-01 22:26:05 -04:00
Rob Rix
5fe4b1da74
🔥 withSomeTermPair. 2019-10-01 22:23:15 -04:00
Rob Rix
68ea7e147d
The diff & term types are mutually supporting. 2019-10-01 22:14:12 -04:00
Rob Rix
0c5342a030
Diff via an abstract interface. 2019-10-01 22:12:18 -04:00