1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 21:16:12 +03:00
Commit Graph

5257 Commits

Author SHA1 Message Date
Rob Rix
e682c4164c Enable pattern-matches on AlgorithmF again. 2017-02-21 10:41:46 -05:00
Rob Rix
6f30690b71 Document time complexity. 2017-02-21 10:38:10 -05:00
Rob Rix
984be76b0f Better docs for the AlgorithmF constructors. 2017-02-21 10:29:02 -05:00
Rob Rix
303ba57d27 Tidy up the AlgorithmF docs. 2017-02-21 10:26:27 -05:00
Rob Rix
f79adf7493 Express AlgorithmF as a GADT. 2017-02-21 10:25:25 -05:00
Timothy Clem
9910f8dd16 Add friendly category name now that we have singleton methods 2017-02-17 14:57:29 -08:00
Timothy Clem
854eeee9fb ++tree-sitter-ruby for new constant parsing 2017-02-17 14:16:29 -08:00
Timothy Clem
6e718a7804 No opening linebreak if first node is a patch 2017-02-17 13:54:20 -08:00
Josh Vera
696e4f6a8c Merge branch 'master' into ruby-singleton-methods 2017-02-17 15:02:32 -05:00
Josh Vera
d0af7a2f40 Merge branch 'master' into it-slices,-it-dices 2017-02-17 14:52:42 -05:00
Timothy Clem
91c650ee9c Minor fix for sexpression padding on the Pure side 2017-02-17 11:36:50 -08:00
Timothy Clem
a10bc515c0 ++tree-sitter-ruby and parse singleton methods to fix ambiguity 2017-02-17 11:34:47 -08:00
Rob Rix
75d3fc5079 🔥 stale hiding of fromList. 2017-02-16 14:28:32 -05:00
Rob Rix
b17af9d9c8 🔥 Source.fromList. 2017-02-16 13:11:04 -05:00
Rob Rix
6abfc2b158 Define mempty using the extant empty value. 2017-02-16 13:10:55 -05:00
Rob Rix
a7bfbb72f4 Rename characterRange to byteRange. 2017-02-16 11:58:26 -05:00
Rob Rix
6e35a32566 Produce non-ASCII characters and longer byte strings earlier. 2017-02-16 11:53:27 -05:00
Rob Rix
6c54412778 Source’s Listable instance produces non-ASCII values. 2017-02-16 11:38:02 -05:00
Rob Rix
76e97e3df5 Interleave the ASCII code points. 2017-02-16 11:28:51 -05:00
Timothy Clem
70c8e2a57b Property test that toc summarizes methods and functions 2017-02-15 16:13:34 -08:00
Rob Rix
598b933aea Byte ranges, not character ranges. 2017-02-15 16:17:01 -05:00
Rob Rix
73b96969a8 Generate valid 7-bit ASCII. 2017-02-15 14:51:18 -05:00
Rob Rix
ed2ac59a36 Merge remote-tracking branch 'origin/hold-on-to-your-butts' into it-slices,-it-dices 2017-02-15 14:51:03 -05:00
Timothy Clem
aa84bb40d6 Merge branch 'master' into hold-on-to-your-butts 2017-02-15 08:34:18 -08:00
Timothy Clem
b34c71dcc5 Merge branch 'master' into dedupe-added-removed-methods 2017-02-15 08:14:21 -08:00
Timothy Clem
09337e21d8 Merge remote-tracking branch 'origin/master' into go-receiver-toc-iteration 2017-02-14 13:13:11 -08:00
Rob Rix
f6e1981606 Source holds a ByteString. 2017-02-14 15:33:24 -05:00
Rob Rix
5cb06adf11 🔥 Source.at. 2017-02-14 15:08:12 -05:00
Timothy Clem
1facca0b50 Add failing toc summary test and refactor removeDupes 2017-02-14 11:29:24 -08:00
Rob Rix
80bb79f73c Merge remote-tracking branch 'origin/master' into hold-on-to-your-butts 2017-02-14 14:16:19 -05:00
Rob Rix
3906d33194 This weight is already being added by way of the lifts. 2017-02-14 12:38:07 -05:00
Rob Rix
b7e052cb1a List all Category values.
Helps avoid the combinatorial explosion that comes from multiplying all of the Category constructors by all of the Syntax constructors.
2017-02-14 12:37:32 -05:00
Rob Rix
e35e8d788e Simpler definitions of liftCons2 through 5. 2017-02-14 12:21:12 -05:00
Rob Rix
319ecc61ce Simpler definition of liftTiers2 over (,). 2017-02-14 12:20:56 -05:00
Rob Rix
ad81f4f605 Add weight to every layer of Free/Cofree. 2017-02-14 11:59:42 -05:00
Rob Rix
c275b0fc04 Export ofWeight and addWeight. 2017-02-14 11:59:15 -05:00
Timothy Clem
8bc4da76c9 Have to check parentInfo for duplicates 2017-02-14 08:27:00 -08:00
Timothy Clem
2770540191 Make sure we have a real Summarizable to replace with 2017-02-13 17:30:33 -08:00
Timothy Clem
d68633f643 WIP - identify similar methods/functions 2017-02-13 17:18:25 -08:00
Timothy Clem
31519dda42 Remove dups, including matching method names 2017-02-13 16:15:38 -08:00
Timothy Clem
87dbe3ed9a Merge branch 'master' into go-receiver-toc-iteration 2017-02-13 14:36:42 -08:00
Rob Rix
7d284252c5 Migrate semantic-diff to lts-8.0. 2017-02-13 17:25:45 -05:00
Timothy Clem
cb611a4aa6 Pass in parentOffset to toTermName 2017-02-13 12:53:20 -08:00
Rob Rix
52025ac5e5 Don’t trim the source for recursive calls into termToDiffInfo. 2017-02-13 15:19:06 -05:00
Rob Rix
566891afb7 Offset by the parent’s starting index. 2017-02-13 13:51:07 -05:00
Rob Rix
7cf8a7ddbb Compute the child node’s range, not the parent’s. 2017-02-13 12:28:05 -05:00
Rob Rix
329485febd Define a Listable instance for Source. 2017-02-13 11:55:20 -05:00
Rob Rix
d18dfe453e Use the correct offset for child ranges.
This also ensures that getChild must close over the correct range & source.
2017-02-13 11:41:57 -05:00
Rob Rix
b473e4eafe Extract isNonEmpty & nodeRange. 2017-02-13 11:41:10 -05:00
Rob Rix
0ce897db17 🔥 Source.uncons. 2017-02-13 10:17:55 -05:00
Rob Rix
3a0064e796 Define actualLines over Text internally. 2017-02-13 10:17:44 -05:00
Rob Rix
86be2c584e 🔥 toString. 2017-02-13 09:39:56 -05:00
Rob Rix
24722c3fb6 Render Text. 2017-02-13 09:39:33 -05:00
Rob Rix
802c048ec6 Pull the drop & take into the where clause.
This change, while semantically equivalent, causes `slice` to complete in approximately 1/3rd the time, and allocate only a fraction as much.

Maybe ghc can fuse this better or something? I honestly have no idea, but I’ll take it.

/cc @github/semantic-code
2017-02-10 17:09:54 -05:00
Rob Rix
2bfc2d91c8 Offset the child range correctly. 2017-02-10 16:57:33 -05:00
Rob Rix
f8cc3b8933 Close over the right source. 2017-02-10 16:53:40 -05:00
Rob Rix
00c14e403a Revert "Source carries its Range."
This reverts commit 6e075787935c10b0bd7256673a5623cb5d1a4945.
2017-02-10 16:44:09 -05:00
Rob Rix
f3bad55fee Revert "Close over the correct source."
This reverts commit 6770d9970d9e4aee6029e9b739583c1dc8cfc372.
2017-02-10 16:44:07 -05:00
Rob Rix
46aa3b8fc0 Revert "Take the range from the source."
This reverts commit fd59885f1dc0a4dba976617ed6791d76ad44f708.
2017-02-10 16:44:06 -05:00
Rob Rix
aa78d3215f Revert "Make doubly sure we don’t close over the wrong variable."
This reverts commit 9d24a050f33ad4e123f82a272331d39fd75de68b.
2017-02-10 16:44:03 -05:00
Rob Rix
7d019b9032 Revert "O(1) length."
This reverts commit db4025e8daacf7a8a716b5ddc621b6053cff768f.
2017-02-10 16:44:00 -05:00
Rob Rix
8e241ef71d Revert "Use O(1) length to find line ranges."
This reverts commit 2c5ec5a3254ce88756ddc9312ff50cbdf884789d.
2017-02-10 16:43:57 -05:00
Rob Rix
92831bc12f Revert "Get the total range of a Source in O(1)."
This reverts commit b867910530a6078bb2336e7abc7fca8327851435.
2017-02-10 16:43:55 -05:00
Rob Rix
901f085bec Revert "Strictify Source’s fields."
This reverts commit 4b1917a45aa841db8f3fa30bf0d7fd2757f11b42.
2017-02-10 16:43:52 -05:00
Rob Rix
913fb11aa8 Strictify Source’s fields. 2017-02-10 16:42:41 -05:00
Rob Rix
9a23a6ae40 Get the total range of a Source in O(1). 2017-02-10 15:58:35 -05:00
Rob Rix
c18f3b8224 Use O(1) length to find line ranges. 2017-02-10 15:49:25 -05:00
Rob Rix
ff2d0e6de6 O(1) length. 2017-02-10 15:48:24 -05:00
Rob Rix
d1a5167999 Make doubly sure we don’t close over the wrong variable. 2017-02-10 15:45:02 -05:00
Rob Rix
94c448bef3 Take the range from the source. 2017-02-10 15:42:16 -05:00
Rob Rix
26efa43611 Close over the correct source. 2017-02-10 15:35:10 -05:00
Rob Rix
672ff179ed Source carries its Range. 2017-02-10 15:33:41 -05:00
Rob Rix
3298641a3b Define a function to divide a range in two. 2017-02-10 15:22:27 -05:00
Rob Rix
6bc9971661 Rename unSource to sourceText. 2017-02-10 15:12:39 -05:00
Rob Rix
2a30f6d462 Pre-slice in termToDiffInfo. 2017-02-10 14:23:42 -05:00
Rob Rix
5134595525 Rename blob to source. 2017-02-10 14:18:55 -05:00
Rob Rix
bab725047d Divide once and multiply d times. 2017-02-10 13:31:06 -05:00
Rob Rix
d28e0f23ac Merge remote-tracking branch 'origin/master' into what-the-text 2017-02-10 13:10:46 -05:00
Rob Rix
f723b576e1 Pass the getter in. 2017-02-10 12:59:22 -05:00
Rob Rix
ad5d659941 Cut down on crossing the FFI. 2017-02-10 12:58:15 -05:00
Rob Rix
5688c2b447 Pre-slice the source passed to toTerm. 2017-02-10 12:26:02 -05:00
Rob Rix
9bcabf21b7 Extract a function to retrieve the range for a node. 2017-02-10 12:24:10 -05:00
Rob Rix
8e1095535a Update the 📝 for Source. 2017-02-10 11:24:38 -05:00
Rob Rix
7ea240414b Rename some bindings. 2017-02-10 11:24:31 -05:00
Rob Rix
bc2a29d84e Source is no longer parametric in the character type. 2017-02-10 11:21:24 -05:00
Rob Rix
2c0b19dd6f Rename getVector to unSource. 2017-02-10 11:15:49 -05:00
Rob Rix
35c39e8b56 Change subtractRange to offsetRange.
This has slightly clearer semantics.
2017-02-10 11:11:25 -05:00
Rob Rix
3d975ece64 Move totalRange to Source properly. 2017-02-10 11:08:17 -05:00
Rob Rix
e85eb49e0e Tidy up the imports a bit. 2017-02-10 11:02:38 -05:00
Rob Rix
060680f070 🔥 a redundant import. 2017-02-10 09:32:10 -05:00
Rob Rix
42871bcc94 Fix do notation. 2017-02-10 09:28:57 -05:00
Rob Rix
2108d7287a Use the new input string with length API. 2017-02-10 09:23:51 -05:00
Timothy Clem
f4a10a4c3f Use blobToByteString 2017-02-09 21:31:55 -08:00
Timothy Clem
d6796afd6f Pass Text to tree-sitter 2017-02-09 21:31:29 -08:00
Timothy Clem
905fdea0a2 Put back detect 2017-02-09 21:30:48 -08:00
Timothy Clem
c485c0ab55 Try the default converter 2017-02-09 16:18:19 -08:00
Timothy Clem
e92c43224e Don't use Char8 ByteStrings 2017-02-09 15:01:15 -08:00
Timothy Clem
7ba739a508 Properly calculate range for subterms 2017-02-09 14:47:35 -08:00
Rob Rix
ac4df9a7b3 Remove the Foldable instance for Source. 2017-02-09 17:10:16 -05:00
Rob Rix
70185f4695 Source wraps Text instead of Vector. 2017-02-09 16:33:47 -05:00
Rob Rix
fe22126059 Pre-slice the source. 2017-02-09 16:33:33 -05:00
Timothy Clem
5f91bc426f Merge branch 'master' into go-receiver-toc-iteration 2017-02-09 10:54:35 -08:00
Rob Rix
2e386dc76f Merge remote-tracking branch 'origin/master' into cache-and-discard-feature-vectors 2017-02-09 10:16:14 -05:00
joshvera
30029f3640 no tabs 2017-02-08 18:28:43 -05:00
joshvera
7df0f0ab6e Set LANG to utf8 if it's the empty string 2017-02-08 18:23:10 -05:00
Rob Rix
6de5e73219 Inline the definition of termVector. 2017-02-08 15:47:50 -05:00
Rob Rix
ce59dfba8b Merge remote-tracking branch 'origin/master' into cache-and-discard-feature-vectors 2017-02-08 15:44:52 -05:00
Timothy Clem
a3a895d107 Another iterator for go method toc summaries 2017-02-08 10:57:13 -08:00
Rob Rix
7aed25cccd Remove the fallback to termVector, as it’s redundant. 2017-02-08 12:18:17 -05:00
Rob Rix
d9e44ede6c 📝 modifyAnnotations. 2017-02-08 12:04:05 -05:00
Rob Rix
051916082a Correct a misleading comment. 2017-02-08 12:03:50 -05:00
Rob Rix
f19a1fdfbf Add a function to modify the annotation of a top-level diff node. 2017-02-08 12:03:10 -05:00
Rob Rix
d102c6a13a Don’t re-erase vectors. 2017-02-08 11:54:14 -05:00
Rob Rix
223b836612 Erase feature vectors for the empty/nonempty cases. 2017-02-08 11:53:19 -05:00
Timothy Clem
1bde86531e Fix ordering of go Method shape in termAssignment 2017-02-08 08:43:04 -08:00
Rob Rix
398bb62d16 Merge remote-tracking branch 'origin/master' into cache-and-discard-feature-vectors 2017-02-08 11:36:52 -05:00
Timothy Clem
047bcfcbcb ++tree-sitter-ruby 2017-02-07 15:59:12 -08:00
Timothy Clem
ded960356a Remove S.MemberAccess case entirely since it's now handled above 2017-02-07 15:20:27 -08:00
Timothy Clem
2f230a485e Add receiver to Syntax.Method 2017-02-07 14:53:15 -08:00
Rob Rix
04cc05c20f Erase the feature vector from equal terms. 2017-02-07 16:11:51 -05:00
Rob Rix
3a0c0c29a6 🔥 a redundant import. 2017-02-07 15:57:44 -05:00
Rob Rix
cee0bef699 🔥 eitherCutoff.
We don’t gain any value from `eitherCutoff`, because:

1. We compute diffs in O(1), only ever matching up equal terms (up to category).

2. We compute costs in O(1), mapping Pure (i.e. unmatched diffs) to 1 & Free to 0.

3. If SES were going to compute the cost of recursive diffs (which is what makes it O(n³) instead of just O(n²)), it would have done so before returning, i.e. mapping the results thus is null.

Thus, `eitherCutoff 1` is essentially the identity transformation for our purposes, and can safely be omitted.

/cc @joshvera.
2017-02-07 15:56:25 -05:00
Rob Rix
7d25fb7103 Revert "Erase the feature vectors from the copied portions of the diff."
This reverts commit 0e4d3fd887004941f92747f17538ec73a6e3095e.
2017-02-07 15:38:37 -05:00
Rob Rix
ddfadeaf6b Erase the feature vectors from the copied portions of the diff. 2017-02-07 15:27:13 -05:00
Rob Rix
86a5f2f077 Define stripDiff in terms of mapAnnotations. 2017-02-07 15:27:13 -05:00
Rob Rix
9a39762d91 📝 the generalization. 2017-02-07 15:27:13 -05:00
Rob Rix
7263b683e5 Generalize the type of mapAnnotations slightly. 2017-02-07 15:27:13 -05:00
Rob Rix
bb46960dd8 📝 mapAnnotations. 2017-02-07 15:27:13 -05:00
Rob Rix
4a3dd9afd8 Define a function for mapping over the annotations in a diff. 2017-02-07 15:27:13 -05:00
Rob Rix
ef2bc957c1 Erase the feature vectors from patches. 2017-02-07 15:27:13 -05:00
Rob Rix
3814fb6968 Pull the feature vector setter out. 2017-02-07 15:27:13 -05:00
Rob Rix
b72e5fa730 Don’t erase feature vectors recursively. 2017-02-07 15:27:13 -05:00
Rob Rix
d5ba968315 Erase feature vectors during mapping. 2017-02-07 15:27:13 -05:00
Rob Rix
79dc68a497 Cache feature vectors in record annotations. 2017-02-07 15:27:13 -05:00
Timothy Clem
85afbd6df4 Handle termAssignment for Ruby singleton method defs 2017-02-07 11:59:18 -08:00
Rob Rix
0c5225515e Export FeatureVector. 2017-02-03 15:54:24 -05:00
Rob Rix
72a32ff289 Compute random numbers using the Mersenne twister. 2017-02-03 15:27:37 -05:00
Rob Rix
a9c55f9b93 Revert "Use a strict RNG."
This reverts commit c87855937476ce2214d1bd608203015c6cd6424a.
2017-02-03 14:38:40 -05:00
Rob Rix
a80daff98c Use a strict RNG. 2017-02-03 14:37:28 -05:00
Rob Rix
cdb01ce3a1 Revert "Memoize feature vectors by hashes."
This reverts commit cd4b4adb967edd1d8c2a97f3f6b68f37e40f28b0.
2017-02-03 14:27:02 -05:00
Rob Rix
f0c469233b Memoize feature vectors by hashes. 2017-02-03 14:26:59 -05:00
Rob Rix
06b73aa0da Specialize how we add vectors. 2017-02-03 13:44:36 -05:00
Rob Rix
dda587e86d Represent feature vectors using boxed Arrays. 2017-02-03 13:32:52 -05:00
Rob Rix
522e3f3ab4 Bind functions for profiling purposes. 2017-02-03 12:28:53 -05:00
Rob Rix
80e62f5ffa Define a type synonym for feature vectors. 2017-02-03 12:20:18 -05:00
Rob Rix
041a145150 Extract the head of the annotation record. 2017-02-03 11:58:20 -05:00
Rob Rix
05a669b9f9 Revert "Unbox feature vectors."
This reverts commit 3e60bc0730aa6f85c118bde080f0328cfbe227f2.
2017-02-03 11:53:05 -05:00
Rob Rix
25cd96333c Unbox feature vectors. 2017-02-03 11:50:44 -05:00
Rob Rix
553cd8a534 Sum subterm vectors strictly. 2017-02-03 11:49:35 -05:00
Rob Rix
afa04822dd Generate random numbers in batches. 2017-02-02 16:24:24 -05:00
Rob Rix
b653534ddf Avoid dictionary passing when summing vectors. 2017-02-02 14:54:31 -05:00
joshvera
425933bfa7 update apis 2017-01-31 15:52:38 -05:00
Timothy Clem
262d6ead40 Fix up ruby integration tests 2017-01-31 11:50:02 -08:00
Rick Winfrey
eda990ad7b Remove tree-sitter-parsers; replace with language specific packages
- This allows us to migrate to haskell-tree-sitter, which provides an
open source git repository that contains no language bindings, but
provides the ffi for working with tree sitter.
- Additionally now semantic-diff uses language specific packages found
with the languages dir. Each language package contains a vendored
version of its associated tree-sitter project (i.e. language/ruby
contains tree-sitter-ruby). The implication is that generating a
language’s updated parser.c does not require a re-compilation of all
languages parser.c files.
2017-01-30 14:03:22 -08:00
joshvera
0503fc9555 Flatten BranchInfo patches 2017-01-26 15:07:18 -05:00
joshvera
386fa47ae6 s/Error/ParseError 2017-01-26 12:48:03 -05:00
joshvera
69cf915bf7 Only export toc 2017-01-26 12:46:28 -05:00
Josh Vera
36804a8686 Merge branch 'master' into table-of-contents 2017-01-26 12:07:08 -05:00
Rob Rix
41a10c977f Merge remote-tracking branch 'origin/master' into consolidate-common-term-assignment-patterns 2017-01-25 20:44:58 -05:00
Rob Rix
57d2f50420 Summarize var assignments’ ids even when composite. 2017-01-25 20:16:36 -05:00
Rob Rix
006ec80a06 Summarize all of indexed nodes’ children, not just the first child. 2017-01-25 20:16:13 -05:00
joshvera
3ab42ca794 add a param 2017-01-25 18:26:03 -05:00
Josh Vera
b9f9dff1c6 Merge branch 'master' into table-of-contents 2017-01-25 18:19:40 -05:00
Timothy Clem
3d4f6fe48b Remove need to qualify patch 2017-01-25 10:45:56 -08:00
Timothy Clem
a8fed91deb No need for HideInfo constructor b/c we only surface functions/methods 2017-01-25 08:47:50 -08:00
Timothy Clem
2b0363e031 Remove comments and API sketching 2017-01-25 08:46:45 -08:00
joshvera
bd5b2a4c93 Add optional type to Syntax.Function 2017-01-25 11:41:09 -05:00
Rob Rix
776527711d 🔥 another unnecessary GADT extension. 2017-01-25 03:20:17 -05:00
Rob Rix
e7e9a83f4c This also no longer needs GADTs. 2017-01-25 03:19:00 -05:00
Rob Rix
0b93c638ea These no longer need GADTs. 2017-01-25 03:18:30 -05:00
Rob Rix
2929fb3cb4 Rename Syntax.Error to ParseError. 2017-01-25 03:09:53 -05:00
Rob Rix
296c53f187 Rename Category.Error to ParseError. 2017-01-25 03:08:06 -05:00
Rob Rix
5a39e7234c Reformat Go term assignment. 2017-01-25 03:04:33 -05:00
Rob Rix
fc85c6de40 🔥 redundant term assignments from JavaScript. 2017-01-25 03:02:06 -05:00
Rob Rix
833f2f755e Add a language-agnostic assignment of Throw. 2017-01-25 03:02:03 -05:00
Rob Rix
84db693349 Reformat JavaScript term assignments. 2017-01-25 03:00:41 -05:00
Rob Rix
559bb0b9dc 🔥 redundant assignments from Ruby. 2017-01-25 02:58:25 -05:00
Rob Rix
6207e474b6 Add a language-agnostic Yield assignment. 2017-01-25 02:58:04 -05:00
Rob Rix
d407fcd201 Reformat Ruby term assignment. 2017-01-25 02:56:35 -05:00
Timothy Clem
8f40cbfad1 Use strings that match octicons for ease of PoC 2017-01-24 16:08:34 -08:00
joshvera
dd6a5d3a20 Rename sourceSpan keys to span 2017-01-24 17:20:22 -05:00
joshvera
348d5ae699 Move patchType to Patch 2017-01-24 16:00:25 -05:00
joshvera
e3da60eada Add afterOrBefore function to Patch.hs 2017-01-24 15:58:17 -05:00
Rob Rix
7e6337fbb2 Summarize assignments to lists of variables. 2017-01-24 14:53:11 -05:00
Timothy Clem
e53ae6a88a Catch (and hide) NotSummarizable leaves 2017-01-24 11:25:44 -08:00
Rob Rix
8d41d78572 Assign package identifiers to Module syntax.
This gives us somewhat better summaries for the teardown integration tests.
2017-01-24 14:21:34 -05:00
Timothy Clem
f49fc1910d Don't print method arguments 2017-01-24 11:18:59 -08:00
Timothy Clem
9ec2262b38 Refactor names and handling of what's summarizable 2017-01-24 11:16:22 -08:00
Rob Rix
4cb1af8879 Handle Case/When matching specifically for Ruby again.
This fixes 10 of 340 integration test failures 🎉
2017-01-24 14:14:05 -05:00
joshvera
3f34bcec46 Expand toTermName to summarize methods and functions 2017-01-24 12:14:14 -05:00
joshvera
acb277e32c remove duplicates 2017-01-24 12:13:59 -05:00
joshvera
1fe58a5c48 Panic in toJSON if we see a None 2017-01-24 12:13:22 -05:00
joshvera
b3bbff3f45 Output term, category, sourceSpan 2017-01-23 17:46:29 -05:00
joshvera
e58799c42d Concat TOCOutput like summaries 2017-01-23 17:31:01 -05:00
joshvera
c35d7e8089 Summarize functions and methods to ExpressionInfo 2017-01-23 17:26:43 -05:00
joshvera
3177a565a7 Append parent annotations to summaries 2017-01-23 16:59:47 -05:00
joshvera
5ae0dbf2be Export sourceSpan 2017-01-23 16:59:05 -05:00
joshvera
cc4cc5efc6 Add ParentInfo to carry information about parent or expression information 2017-01-23 16:33:07 -05:00
Rob Rix
9a4c92d735 Only pass the category to term assignment. 2017-01-23 16:04:31 -05:00
Rob Rix
a27edde9e4 Return Syntax from Go term assignment. 2017-01-23 16:01:42 -05:00
joshvera
261f374fb5 Parameterize JSONSummary with term context info types 2017-01-23 15:58:20 -05:00
Rob Rix
393689bacb Simplify the Slice pattern to just a pair. 2017-01-23 15:55:35 -05:00
Rob Rix
ab73581f8b Allow if statements to fall through. 2017-01-23 15:41:24 -05:00
Rob Rix
99590a52d3 Map "block" onto ExpressionStatements. 2017-01-23 15:33:31 -05:00
Rob Rix
338522ab5c Flatten single-child expression lists. 2017-01-23 15:26:54 -05:00
Rob Rix
cfbe9b9b16 Flatten assignments out. 2017-01-23 15:22:00 -05:00
Rob Rix
258e136abb Flatten the variable declaration pattern. 2017-01-23 15:19:19 -05:00
Rob Rix
f6e6e7f516 Slightly more idiomatic handling of Select. 2017-01-23 15:13:50 -05:00
Rob Rix
110dc2129c Allow Case to fall through. 2017-01-23 15:13:22 -05:00
Rob Rix
281df3178f Handle Case language agnostically. 2017-01-23 15:12:38 -05:00
Rob Rix
e88e4c81ff Slightly more lenient handling of Case. 2017-01-23 15:12:12 -05:00
Rob Rix
122a34452a Let If & While fall through. 2017-01-23 15:12:02 -05:00
Rob Rix
7af836e39d 🔥 a redundant function call pattern. 2017-01-23 15:09:45 -05:00
Rob Rix
f761323f14 Let return statements fall through. 2017-01-23 15:08:40 -05:00
Rob Rix
f2dd0977ba Defer to the language-agnostic handling of Switch. 2017-01-23 15:06:55 -05:00
Rob Rix
e95ae2c5d9 Ruby uses Switch/Case like anyone else would. 2017-01-23 15:06:05 -05:00
Rob Rix
974020891a Assign Switch terms language-agnostically. 2017-01-23 15:04:05 -05:00
Rob Rix
e5902d9358 Switch takes a list of subject clauses. 2017-01-23 15:02:52 -05:00
Rob Rix
0d52a93060 Placate hlint. 2017-01-23 15:02:08 -05:00
Rob Rix
ab8b6d4b37 Simplify the import of Go sources. 2017-01-23 14:47:42 -05:00
Rob Rix
f5d22fcc4d Syntax.Ty takes a list of fields. 2017-01-23 14:39:12 -05:00
Rob Rix
0474b79b97 🔥 some redundant uses of withCategory. 2017-01-23 14:33:48 -05:00
Rob Rix
413fd969f1 Simplify withRanges to get the children from the syntax. 2017-01-23 14:24:05 -05:00
Rob Rix
2540196cf3 Define the var assignment zippers tacitly. 2017-01-23 14:19:22 -05:00
Rob Rix
9092a9ebc2 Inline the range/source span lists. 2017-01-23 14:17:08 -05:00
Rob Rix
f55dd77f18 Allow variable & const declarations to fall through. 2017-01-23 14:15:42 -05:00
Rob Rix
e1df6cc471 Flatten the struct type pattern. 2017-01-23 14:14:24 -05:00
Timothy Clem
381549c045 Structure to produce toc summaries 2017-01-23 11:13:11 -08:00
Rob Rix
a7cbea7051 Handle break/continue statements language-agnostically. 2017-01-23 14:09:07 -05:00
Rob Rix
a0bdcb9f60 Handle pairs in the default term assignment. 2017-01-23 14:07:47 -05:00
Rob Rix
fac36a16ab Fall through from Go term assignment. 2017-01-23 14:06:39 -05:00
Rob Rix
af4fcadc5f Var assignment patterns match partially. 2017-01-23 14:03:05 -05:00
Timothy Clem
02f87738c0 Plumb in cmd line option for new toc output format 2017-01-23 10:49:48 -08:00
Rob Rix
107124fe62 🔥 special handling of import_declaration. 2017-01-23 13:27:55 -05:00
Rob Rix
f6eea74747 Assign C.Import to S.Import. 2017-01-23 13:27:46 -05:00
Rob Rix
9c83566b34 Map import_spec into Import. 2017-01-23 13:27:27 -05:00
Rob Rix
4c48fe33dd Simplify how individual imports are flattened. 2017-01-23 13:23:07 -05:00
Rob Rix
aa1d770ab1 Flatten import declarations. 2017-01-23 13:21:20 -05:00
Rob Rix
b2456dce33 Flatten the field declaration patterns. 2017-01-23 13:19:39 -05:00
Rob Rix
f5bc950755 Flatten toIdent into toFieldDecl. 2017-01-23 13:17:49 -05:00
Rob Rix
9a98bd6c8e Flatten the type declaration pattern. 2017-01-23 13:14:42 -05:00
Rob Rix
9e61d8a2eb Flatten the defer/go statement patterns. 2017-01-23 13:14:01 -05:00
Rob Rix
b9a8207b93 Flatten the susbcript access patterns. 2017-01-23 13:13:16 -05:00
Rob Rix
2d3bffbad3 Flatten the slice/subscript access patterns. 2017-01-23 13:12:24 -05:00
Rob Rix
df6c2dae38 Flatten the struct patterns. 2017-01-23 13:09:39 -05:00
Rob Rix
bf618900ae Flatten the dictionary literal pattern. 2017-01-23 13:05:53 -05:00
Rob Rix
252e2a6f2d Flatten the array literal pattern. 2017-01-23 13:05:19 -05:00
Rob Rix
53eff8dc1a Flatten the composite_literal pattern match. 2017-01-23 13:02:35 -05:00
Rob Rix
2fc48d7ff8 Flatten the continue pattern. 2017-01-23 13:00:57 -05:00
Rob Rix
b3ee5042cb Flatten the break pattern. 2017-01-23 13:00:06 -05:00