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

4960 Commits

Author SHA1 Message Date
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
Rob Rix
e284d73430 Flatten the pair pattern. 2017-01-23 12:59:25 -05:00
Rob Rix
c7bb1e5325 Flatten the module/package_name pattern somewhat. 2017-01-23 12:58:51 -05:00
Rob Rix
893cb771e6 Flatten the anonymous function pattern. 2017-01-23 12:54:21 -05:00
Rob Rix
ef5d6e9df5 Don’t attempt to convert cases. 2017-01-23 12:53:09 -05:00
Rob Rix
3a459a7f31 Flatten Method pattern matches. 2017-01-23 12:44:41 -05:00
Rob Rix
5c9a9c8eb5 Flatten the FunctionCall patterns. 2017-01-23 12:41:51 -05:00
Rob Rix
918dcd0498 Flatten the type assertion/conversion patterns. 2017-01-23 12:41:01 -05:00
Rob Rix
681dc71832 Flatten the Send pattern. 2017-01-23 12:40:00 -05:00
Rob Rix
07a5688d21 Flatten the pointer/channel type patterns. 2017-01-23 12:39:37 -05:00
Rob Rix
0b01b510a3 Combine the ParameterDecl patterns. 2017-01-23 12:38:33 -05:00
Rob Rix
1cd22e2df0 Flatten the function patterns to the top level. 2017-01-23 12:37:19 -05:00
Rob Rix
5e6f45e482 Flatten the for statement patterns to the top level. 2017-01-23 12:37:12 -05:00
Rob Rix
5c2a024607 Match against the category and children in one go. 2017-01-23 12:33:13 -05:00
joshvera
f8ecbf9286 WIP stub TOC renderer 2017-01-23 12:16:59 -05:00
joshvera
18c8a0124d Add a stub TOC renderer 2017-01-23 11:22:51 -05:00
Rob Rix
e81b1b65e1 JS relies on the default return rule. 2017-01-23 10:27:40 -05:00
Rob Rix
3809b07723 Group language-agnostic patterns. 2017-01-20 16:49:45 -05:00
Rob Rix
ed217d9d10 Add language-agnostic handling of while statements. 2017-01-20 16:40:34 -05:00
Rob Rix
a49ca3cbe6 Add language-agnostic handling of return statements. 2017-01-20 16:39:27 -05:00
Rob Rix
848659cb31 Match method calls on the Syntax constructor. 2017-01-20 16:38:12 -05:00
Rob Rix
5da93d8274 Don’t match comments in JS or Ruby term assignment. 2017-01-20 16:35:33 -05:00
Rob Rix
f55d90084f Flatten the JS function/method call patterns. 2017-01-20 15:43:15 -05:00
Rob Rix
6d615d0f00 Flatten the JS try/catch/finally patterns. 2017-01-20 15:42:11 -05:00
Rob Rix
f68de599a7 Flatten the JS function patterns out. 2017-01-20 15:39:53 -05:00
Rob Rix
476f4ac567 JavaScript term assignment is actually partial. 2017-01-20 15:37:01 -05:00
Rob Rix
c27875b6f7 Consolidate the JS function patterns. 2017-01-20 15:34:50 -05:00
Rob Rix
eae2480d31 Allow malformed JS for statements to fall through. 2017-01-20 15:33:30 -05:00
Rob Rix
0744fa78b2 Consolidate the JS try/catch/finally patterns. 2017-01-20 15:32:25 -05:00
Rob Rix
89f8e3b1a3 Consolidate the JS function/method call patterns. 2017-01-20 15:30:00 -05:00
Rob Rix
f6d98c4c5d Allow top-level JS assignment errors to fall through. 2017-01-20 15:27:35 -05:00
Rob Rix
79a0386931 Correct Ruby’s Method pattern. 2017-01-20 15:25:53 -05:00
Rob Rix
438234b97d 🔥 specialization of the If rule for Ruby. 2017-01-20 15:21:55 -05:00
Rob Rix
24753de48d Add a default handler for if statements. 2017-01-20 15:20:36 -05:00
Rob Rix
9967585650 Ruby term assignment is actually partial. 2017-01-20 15:16:32 -05:00
Rob Rix
43c4cc7d23 Consolidate the method patterns. 2017-01-20 15:12:58 -05:00
Rob Rix
65ae07f301 Consolidate the lambda patterns. 2017-01-20 15:10:47 -05:00
Rob Rix
3fe41d324e Consolidate the method/function call patterns. 2017-01-20 15:08:55 -05:00
Rob Rix
0f99a0ff8f Allow top-level errors to fall through. 2017-01-20 15:08:40 -05:00
Rob Rix
c9af7b1196 Per-language term assignment is pure. 2017-01-20 15:03:40 -05:00
Rob Rix
6abb7d812a Handle operators in the default term assignment. 2017-01-20 14:59:49 -05:00
Rob Rix
a16f3b4e99 defaultTermAssignment receives the list of all children. 2017-01-20 14:55:43 -05:00
Rob Rix
3ed32e9225 defaultTermAssignment returns in IO. 2017-01-20 14:54:03 -05:00
Rob Rix
cff0db5528 Add field accessors for SourceSpan. 2017-01-20 14:44:23 -05:00
Rob Rix
0aa45a615b Reformat Info’s exports. 2017-01-20 14:44:10 -05:00
Rob Rix
fe155eac5a Move the sourceText getter out from between the Cost accessors. 2017-01-20 14:41:34 -05:00
Rob Rix
a24781d2bd 🔥 unionSourceSpans. 2017-01-20 14:38:39 -05:00
Rob Rix
546369c625 🔥 SourceSpan.maybeConcat. 2017-01-20 14:38:02 -05:00
Rob Rix
48f119539f Define unionSourceSpansFrom in terms of the Semigroup instance. 2017-01-20 14:37:52 -05:00
Rob Rix
7dc2406848 🔥 Range.maybeConcat. 2017-01-20 14:36:40 -05:00
Rob Rix
ea3278b745 Define unionRangesFrom in terms of the Semigroup instance. 2017-01-20 14:36:28 -05:00
Rob Rix
f8c4b00411 🔥 unionRanges. 2017-01-20 14:36:10 -05:00
Rob Rix
427afdf61c Ruby term assignment returns Syntax. 2017-01-20 14:15:09 -05:00
Rob Rix
600b861135 C term assignment returns Syntax. 2017-01-20 14:12:56 -05:00
Rob Rix
e7e0e5c01c 🔥 an apparently redundant $!. 2017-01-20 14:11:41 -05:00
Rob Rix
c16e75c670 Don’t match errors specially in JS term assignment. 2017-01-20 14:11:05 -05:00
Rob Rix
e11c56b7a4 Don’t match unused fields. 2017-01-20 14:10:30 -05:00
Rob Rix
17ce8d6988 JavaScript term assignment returns Syntax. 2017-01-20 14:09:44 -05:00
Rob Rix
a538d39b31 Per-language term assignment returns Syntax, not Term. 2017-01-20 14:09:29 -05:00
Rob Rix
2bf708aaeb Collapse C term assignment for now. 2017-01-20 13:53:12 -05:00
Rob Rix
af8b3bf268 Go term assignment is (notionally) partial. 2017-01-20 13:51:52 -05:00
Rob Rix
40eb0312ef 🔥 the old default term assignment function. 2017-01-20 13:50:25 -05:00
Rob Rix
27a01e8ddc Fall back to default term assignment if we don’t have a language. 2017-01-20 13:48:52 -05:00
Rob Rix
45621eedd8 JavaScript term assignment is (notionally) partial. 2017-01-20 13:47:06 -05:00
Rob Rix
2e7c4c2ac4 C term assignment is (notionally) partial. 2017-01-20 13:45:05 -05:00
Rob Rix
5432eaab34 Ruby term assignment is (notionally) partial. 2017-01-20 13:37:20 -05:00
Rob Rix
740f1ee174 Write a fallback path for partial term assignment. 2017-01-20 13:35:38 -05:00
Rob Rix
f84c578371 Construct parse error terms for all languages. 2017-01-20 13:11:04 -05:00
Rob Rix
44ecf732fa Curry defaultTermAssignment. 2017-01-20 13:07:19 -05:00
Rob Rix
a6c897163c Rename termConstructor to termAssignment. 2017-01-20 13:05:55 -05:00
Rob Rix
8dbf54bcca Export the default term assignment. 2017-01-20 13:04:36 -05:00
Rob Rix
c1e82f9b37 Define a default term assignment. 2017-01-20 13:03:52 -05:00
Rob Rix
1c0c7e4bdf Factor slicing the source out of term assignment. 2017-01-20 12:59:56 -05:00
Rob Rix
3f60857321 Merge branch 'better-record-pattern-matches' into consolidate-common-term-assignment-patterns 2017-01-19 16:38:38 -05:00
Rob Rix
c93d9abe0b Pass the annotations in whole. 2017-01-19 16:36:49 -05:00
Rob Rix
f6c750dde2 Merge branch 'better-record-pattern-matches' into consolidate-common-term-assignment-patterns 2017-01-19 16:00:12 -05:00
Rob Rix
8e1c5706b6 Replace uses of (.:) with (:.). 2017-01-19 15:46:28 -05:00
Rob Rix
9f707bcf3a Rename RCons to (:.).
We can’t use (.:) because Haskell doesn’t allow that. However, tokens starting with : are reserved for data constructors, so (:.) is, apparently, a perfectly cromulent constructor.
2017-01-19 15:42:51 -05:00
Rob Rix
d64108dfb8 Rename TermIndexOrNil to avoid clashing with new Record construction. 2017-01-19 15:41:50 -05:00
Rob Rix
877fec5e38 Rename RNil to Nil. 2017-01-19 15:36:04 -05:00
Rob Rix
b8901998ff Rename termConstructor to assignTerm. 2017-01-19 15:22:04 -05:00
Rob Rix
5ef2464550 Extract the overall term constructor to the top level. 2017-01-19 15:18:02 -05:00
Rob Rix
aff613148f Don’t map parse error productions per-language. 2017-01-19 15:13:07 -05:00
Rob Rix
4d1d84ef9f Map parse error categories in one place. 2017-01-19 15:09:22 -05:00
Rob Rix
abe529534a Don’t add “modifier” for now. 2017-01-19 14:05:51 -05:00
Rob Rix
cd5a51aa7a Disable -Wdeprecations on files pattern matching against Category.
We can’t 🔥 RescueModifier yet because of RWS instability. See also #778.
2017-01-19 14:01:48 -05:00
Rob Rix
ae7a91d9da Deprecate RescueModifier. 2017-01-19 14:01:01 -05:00
Rob Rix
eb8c09f2b5 Revert "🔥 RescueModifier."
This reverts commit 9eda5f256678287b9252a7c654ffcaf486b22c21.
2017-01-19 13:51:24 -05:00
Rob Rix
ca1647d45e Disambiguate the Rescue category 😞 2017-01-19 13:16:31 -05:00
Rob Rix
9c064da12f Compute a simpler string for rescue modifiers. 2017-01-19 13:14:40 -05:00
Rob Rix
21dabbe077 🔥 RescueModifier. 2017-01-19 13:13:57 -05:00
Rob Rix
8df4e8ca7b Look for Modifier Rescue, not RescueModifier. 2017-01-19 13:12:59 -05:00
Rob Rix
36a6760347 Match against Modifier categories where appropriate. 2017-01-19 13:09:39 -05:00
Rob Rix
2f3dfd2df7 Compact the unless/until rules. 2017-01-19 13:07:55 -05:00
Rob Rix
d9397f930c Handle Until/Unless in the same manner as the other control statements/modifiers. 2017-01-19 13:06:12 -05:00
Rob Rix
72f2260164 Ruby term assignment is pure except for operators. 2017-01-19 13:01:59 -05:00
Rob Rix
37141178ea Map Ruby modifier productions onto Modifier categories. 2017-01-19 12:56:09 -05:00
Rob Rix
408ad2ecc5 Add Modifier categories.
These are used when a normal syntactic category is attached as a modifier instead of as a statement, e.g.:

```ruby
if foo then bar end
```

vs.

```ruby
bar if foo
```
2017-01-19 12:55:06 -05:00
Rob Rix
33040ea22e Assign terms based on the Category. 2017-01-19 12:26:45 -05:00
Rob Rix
83acde8ad4 Add a function computing the Category for a given language & production name. 2017-01-19 12:26:20 -05:00
Rob Rix
fde31b836e Go term assignment is pure. 2017-01-19 12:02:35 -05:00
joshvera
ee10187ba1 Merge remote-tracking branch 'origin/master' into more-go-terms 2017-01-18 15:36:02 -05:00
joshvera
95d6f7a850 Add a maybeRecursively so we compare optional values as insertions or deletions when one side is missing 2017-01-18 15:08:30 -05:00
joshvera
9966b88f1b s/if statement/maybe 2017-01-18 14:07:39 -05:00
joshvera
7f396dd7b7 Rename Default to DefaultCase 2017-01-18 14:06:45 -05:00
joshvera
b3a300f745 Add docs 2017-01-18 14:02:06 -05:00
Rob Rix
dbcfb85c1c This comment now applies to sourceSpan as well. 2017-01-18 13:40:55 -05:00
Rob Rix
0854ba66e2 Evaluate the SourceSpan strictly. 2017-01-18 13:39:58 -05:00
Rob Rix
60a8f588e4 Term assignment takes a pure SourceSpan.
We always access this now, so we don’t need to guard it in IO.
2017-01-18 13:39:40 -05:00
joshvera
d34b8e2354 Parse methods 2017-01-18 13:38:31 -05:00
joshvera
d4c33c0176 Map keyed_element to Pair 2017-01-18 13:01:25 -05:00
joshvera
0acdf470e4 Remove identifer_list wrapper in field declarations 2017-01-18 12:53:12 -05:00
joshvera
8e88838495 Merge remote-tracking branch 'origin/master' into more-go-terms 2017-01-18 11:14:03 -05:00
joshvera
0c24778b05 add rune literal case 2017-01-17 18:57:43 -05:00
joshvera
496e95a41f fix rune tests 2017-01-17 18:55:59 -05:00
joshvera
fc55bee5fc Change Break and Continue to take a Maybe 2017-01-17 17:20:50 -05:00
joshvera
0c36efc850 Fix ranges and categories for const var assignments 2017-01-17 17:10:34 -05:00
joshvera
c3201ed689 Map var declarations to VarDecl 2017-01-17 14:56:59 -05:00
joshvera
23450d64ee Clean up dead code 2017-01-17 13:20:46 -05:00
joshvera
e97330fe83 Map short var declarations to var assignments 2017-01-17 13:19:46 -05:00
joshvera
f3d29d894e Convert var_declaration to Indexed and var_spec to VarAssignment 2017-01-17 12:30:42 -05:00
joshvera
a95d57c8cf Parse struct type declarations 2017-01-17 12:23:56 -05:00
joshvera
71a147862a tags can only be strings in field declarations 2017-01-17 12:06:26 -05:00
joshvera
74b2b1715c Add correct ranges to errors 2017-01-17 11:54:11 -05:00
joshvera
52c4f1a7b4 Add tag to FieldDecl 2017-01-17 11:53:44 -05:00
Rick Winfrey
e0983245d2 Add missing category 2017-01-13 16:46:24 -08:00
Rick Winfrey
4fcd80a6fe Add qualified identifiers for Go 2017-01-13 16:46:16 -08:00
Rick Winfrey
27196d8f6b Add Go support for increment / decrement statements 2017-01-13 15:03:42 -08:00
Rick Winfrey
46345434ca Merge branch 'more-go-terms' of github.com:github/semantic-diff into more-go-terms 2017-01-12 16:09:48 -08:00
joshvera
cb2f0b7e7b unused param 2017-01-12 19:00:10 -05:00
Rick Winfrey
25c79a31de Merge branch 'more-go-terms' of github.com:github/semantic-diff into more-go-terms 2017-01-12 15:59:00 -08:00
Rick Winfrey
86a456b285 Merge remote 2017-01-12 15:54:14 -08:00
joshvera
2dd0f2c609 add missing send statement case in Renderer.Split 2017-01-12 18:53:20 -05:00
joshvera
e3505286ba Add function types 2017-01-12 18:52:11 -05:00
joshvera
741ccd4c05 Map unary_expression to Operator 2017-01-12 18:44:11 -05:00
joshvera
20ead53d1c Add send statements 2017-01-12 18:39:09 -05:00
joshvera
45fe48b1ad Map channel types 2017-01-12 18:33:13 -05:00
joshvera
79d9561c4f Make types identifiable for now 2017-01-12 18:28:49 -05:00
joshvera
98f2407677 Add Ty syntax 2017-01-12 17:56:41 -05:00
Rob Rix
9cb0d7a354 Merge branch 'master' into leancheck,-the-other-white-meat 2017-01-12 15:55:26 -05:00
Rob Rix
364d36f40f Use the Tier type synonym more widely. 2017-01-12 15:53:31 -05:00
Rick Winfrey
0880b41fc6 Add slice literal summary statements 2017-01-12 12:00:09 -08:00
Rick Winfrey
2563a26a8a Add Literal category 2017-01-12 11:59:38 -08:00
Rick Winfrey
7cd5da6ea6 Add SliceTy and Element to Split renderer 2017-01-12 11:47:29 -08:00
Rick Winfrey
d015068e5b Add mapping for slice types 2017-01-12 11:44:07 -08:00
Rick Winfrey
5fa1e51694 Add mapping for Slice literals and their elements 2017-01-12 11:43:44 -08:00
Rick Winfrey
1caeb18406 Add Element category 2017-01-12 11:38:44 -08:00
Rick Winfrey
b69badb184 Add SliceTy category 2017-01-12 11:38:35 -08:00
Rob Rix
b12aa44636 Replace the quaternary ToJSON instance over Record with an inductive one. 2017-01-12 14:23:36 -05:00
Rob Rix
3124447ad6 Define ToJSONList instances over records. 2017-01-12 14:23:18 -05:00
Rob Rix
a044e862b2 Define a typeclass for computing a record’s component Values. 2017-01-12 14:23:03 -05:00
Rick Winfrey
3a7259503d Add FieldDecl renderer entries 2017-01-11 15:26:56 -08:00
Rick Winfrey
ad9895a28c Merge branch 'more-go-terms' of github.com:github/semantic-diff into more-go-terms 2017-01-11 15:23:04 -08:00
Rick Winfrey
4bddf7952a Summarize FieldDecl 2017-01-11 15:10:45 -08:00
Rick Winfrey
24e8e87cd5 Make TypeDecl identifiable but not Struct 2017-01-11 15:10:28 -08:00
Rick Winfrey
2bb7ec94ac Add field declaration mapping 2017-01-11 15:10:12 -08:00
Rick Winfrey
f2eacd915c Build Structs (and also allow for empty structs) 2017-01-11 15:09:58 -08:00
Rick Winfrey
99e4e8da28 Add type and field declarations to Go category list 2017-01-11 15:09:19 -08:00
Rick Winfrey
7dcab8f987 Formatting 2017-01-11 15:06:28 -08:00
Rick Winfrey
9d9e3e295f Add FieldDecl Syntax 2017-01-11 15:06:06 -08:00
Rick Winfrey
ce8de2b833 Add FieldDecl category 2017-01-11 15:05:51 -08:00
joshvera
ccdaf8f663 Add PointerTy category 2017-01-11 17:45:31 -05:00
joshvera
5b2f6ed3d5 Make TypeDecl Identifiable 2017-01-11 16:32:01 -05:00
Rick Winfrey
2ac9497559 Add Default and TypeDecl arbitrary categories 2017-01-10 15:40:10 -08:00
Rick Winfrey
6e488a4d6f Add TypeDecl to Renderer.Split 2017-01-10 15:39:50 -08:00
joshvera
d1ed9fd7ba totality our old friend 2017-01-10 18:17:48 -05:00
joshvera
5d1e105dc3 Parse type declarations 2017-01-10 18:04:34 -05:00
joshvera
8fc30bea71 never mind don't make case statements identifiable 2017-01-10 16:51:50 -05:00
joshvera
0d13819f30 Make a switch statements clause a Maybe 2017-01-10 16:41:55 -05:00
Rob Rix
01347e4af9 Go back to QuickCheck’s RNG for RWS.
Changing the RNG changes the vectors which changes the similarities which changes the results which breaks the integration tests. See also #778.
2017-01-10 16:29:07 -05:00
joshvera
fdea1399f0 Make case statements identifiable 2017-01-10 16:21:29 -05:00
joshvera
6d42df94ec Add missing Default cases 2017-01-10 16:19:15 -05:00
Rob Rix
34d6c36b0c 📝 Data.Functor.Listable. 2017-01-10 16:10:07 -05:00
joshvera
d42962590b Consider expression_case to be a Case statement 2017-01-10 16:06:48 -05:00
joshvera
b6c22b8477 Don't consider expression_case_clause a Case statement 2017-01-10 16:06:26 -05:00
joshvera
83eb1539e9 Unpack expression_case_clause 2017-01-10 16:06:12 -05:00
joshvera
cbd132c8dc Add a Default Syntax for default cases 2017-01-10 16:05:55 -05:00
joshvera
3d95799fc7 Handle parameter declarations 2017-01-10 15:09:09 -05:00
joshvera
8de5504f97 Add a top level node in case comments come before a module 2017-01-10 13:48:23 -05:00
joshvera
531524f29c Revert "Don't wrap a VarAssignment in a VarDecl"
This reverts commit 2b39a7cc0576675f0104f67a00df799b6f9ef970.
2017-01-09 18:07:23 -05:00
joshvera
cbb31dd42a Fix up categories for var decls 2017-01-09 17:54:27 -05:00
joshvera
3fbc488c39 Don't wrap a VarAssignment in a VarDecl 2017-01-09 17:21:48 -05:00
joshvera
0f7e190c7f Map function literals to var assignment summaries 2017-01-09 16:42:39 -05:00
joshvera
98c5c41cfa Allow dictionaries to be identifiable 2017-01-09 15:20:36 -05:00
Rob Rix
b4cd153a43 Generate random walks with mkStdGen. 2017-01-09 15:16:06 -05:00
joshvera
57137db0cf bump tests 2017-01-09 15:13:55 -05:00
joshvera
760d99cc53 Allow arrays with types to be identifiable 2017-01-09 15:10:20 -05:00
Rob Rix
1ee9a60039 🔥 Arbitrary instances. 2017-01-09 14:59:04 -05:00
Rob Rix
21f0b8b152 🔥 {Term,Diff}.Arbitrary. 2017-01-09 14:46:47 -05:00
Rob Rix
c326fd447c Move the Listable instance for Patch into its module. 2017-01-09 14:45:09 -05:00
Rob Rix
57a4ecd6e3 Convert leaf values to Text using StringConv. 2017-01-09 14:29:24 -05:00
Rob Rix
233113913a 🔥 a redundant import of Test.LeanCheck. 2017-01-09 11:46:04 -05:00
Rob Rix
75d4488bf8 Export a Tier type synonym. 2017-01-07 23:37:20 -05:00
Rob Rix
489631ee50 Allow Term to be partially applied. 2017-01-07 09:34:49 -05:00
Rob Rix
ddaa2d2d18 Define a Listable newtype wrapper for Listable1 type applications. 2017-01-07 09:13:40 -05:00
Rob Rix
a9ba058cf9 Define a Listable1 instance over (Listable1 f, Listable a) => CofreeF f a. 2017-01-07 09:07:48 -05:00
Rob Rix
8a06e024f5 Define a Listable1 instance over (Listable1 f, Listable a) => FreeF f a. 2017-01-07 09:03:38 -05:00
joshvera
ae40908cd2 Update go tests 2017-01-05 17:08:28 -05:00