1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00
Commit Graph

12588 Commits

Author SHA1 Message Date
Rob Rix
b08969b44c Define a withModules function running an action with a module table constructed from a list of modules. 2018-03-21 20:01:13 -04:00
Rob Rix
9819f2c29b Rename withModules to withModulesForBlobs. 2018-03-21 19:59:14 -04:00
Rob Rix
99ab0a46cb Define withModules using moduleForBlob. 2018-03-21 19:57:44 -04:00
Rob Rix
da02fc870d 📝 the arguments to moduleForBlob. 2018-03-21 19:55:01 -04:00
Rob Rix
842ab3403d 📝 moduleForBlob. 2018-03-21 19:52:52 -04:00
Rob Rix
7e2b8b93e4 Define a helper constructing a Module for a Blob relative to some root directory. 2018-03-21 19:52:20 -04:00
Rob Rix
1cc91b78dc 🔥 evaluate. 2018-03-21 19:46:03 -04:00
Rob Rix
21ee656538 Run the analysis directly in Util. 2018-03-21 19:45:47 -04:00
Rob Rix
ba73ae1eaa 🔥 evaluates. 2018-03-21 19:44:53 -04:00
Rob Rix
864606af8a Call withModules directly in Semantic.Util. 2018-03-21 19:44:48 -04:00
Rob Rix
0f16b4e973 Move withModules into Control.Abstract.Analysis. 2018-03-21 19:35:15 -04:00
Rob Rix
1002395074 The Reader module table holds Modules. 2018-03-21 19:30:51 -04:00
Rob Rix
9d1cf41d63 Rename moduleTerm to moduleBody. 2018-03-21 19:20:08 -04:00
Rob Rix
5af7154996 Derive a bunch of instances for Module. 2018-03-21 19:09:37 -04:00
Rob Rix
84843b8a60 Move ModuleName to Module. 2018-03-21 19:09:16 -04:00
Rob Rix
f032aec337 Define a Module type. 2018-03-21 19:09:06 -04:00
Rob Rix
f476eb22bd Stub in a Data.Abstract.Module module. 2018-03-21 17:59:16 -04:00
Rob Rix
56dbd8b6a1 Copy the CallGraph stuff into a new module. 2018-03-21 17:58:47 -04:00
Rob Rix
d645481dcf 📝 AppMerge is a Monoid too. 2018-03-21 17:29:48 -04:00
Rob Rix
6a785e0b30 Remove the Monoid instance for App, as it’s unlawful. 2018-03-21 17:26:32 -04:00
Rob Rix
aab509cf63 Test the identity properties. 2018-03-21 17:26:07 -04:00
Rob Rix
b55010c2c1 Define shrinking. 2018-03-21 17:22:34 -04:00
Rob Rix
6be056bd9a Swap the order of the types. 2018-03-21 17:16:31 -04:00
Rob Rix
c6148c6cad Test the associativity of the semigroup instances. 2018-03-21 17:16:09 -04:00
Rob Rix
69a4e4cc2e 🔥 Imperative. 2018-03-21 17:08:52 -04:00
Rob Rix
256623a818 eval lists in App. 2018-03-21 17:08:25 -04:00
Rob Rix
e0245ed752 Define a Monoid instance for App. 2018-03-21 17:08:14 -04:00
Rob Rix
3329bd0a51 Define a Semigroup instance for App. 2018-03-21 17:08:06 -04:00
Rob Rix
5ea6482e96 📝 App. 2018-03-21 17:07:55 -04:00
Rob Rix
6399cb3c58 Define an App semigroup. 2018-03-21 17:07:49 -04:00
Patrick Thomson
d39db0db06 fix comment 2018-03-21 16:56:52 -04:00
Rob Rix
8f22cb26f8 Explicitly list the exports. 2018-03-21 16:44:35 -04:00
Rob Rix
88230df1fe Define a Monoid instance for AppMerge. 2018-03-21 16:41:49 -04:00
Rob Rix
794a03a49c 📝 AppMerge. 2018-03-21 16:41:41 -04:00
Rob Rix
541e230431 Define a Semigroup instance for AppMerge. 2018-03-21 16:41:32 -04:00
Rob Rix
0b2b27ff21 Stub in an AppMerge semigroup. 2018-03-21 16:40:56 -04:00
joshvera
2bf23e7a08 no need to import prelude 2018-03-21 16:01:27 -04:00
joshvera
7cc460fab1 Move Resumable to the top of the effect stack 2018-03-21 15:51:36 -04:00
joshvera
310a2d9e6d Missing import 2018-03-21 15:23:44 -04:00
joshvera
2d7c54ba54 Rename MonadResume to MonadThrow 2018-03-21 15:14:35 -04:00
joshvera
ec39a8bdd9 Move RunnEffect Resumable instance 2018-03-21 15:14:24 -04:00
joshvera
85bcdb6281 Remove unused import 2018-03-21 15:14:09 -04:00
joshvera
c067736a55 Move NonDetEff stuff to effects and clean up imports 2018-03-21 14:58:45 -04:00
joshvera
3cdfb81991 Move Resumable to effects package 2018-03-21 14:33:17 -04:00
joshvera
750f66d31a Add a resumeException function to wrap nonsense 2018-03-21 12:26:17 -04:00
Timothy Clem
166c66766e Whitespace 2018-03-21 09:20:07 -07:00
Timothy Clem
a740f2938a Don't change assignment for namespaces just yet 2018-03-21 09:19:32 -07:00
Patrick Thomson
b59fc64dd8 Implement single-inheritance subclassing.
Pretty straightforward stuff: we augment `klass` to take an optional
superclass, match to ensure it's a class, then, when defining that new
class, push its definition onto the environment provided by the superclass.
2018-03-21 12:17:16 -04:00
joshvera
5ca8367dff Use resumeError in analyzeTerm 2018-03-21 12:15:12 -04:00
joshvera
2cdd9fa183 Add MonadResume instance for effects 2018-03-21 12:14:04 -04:00
joshvera
ffea66cdca Add RunEffect instance for ResumeExc 2018-03-21 12:13:48 -04:00
joshvera
8b13d98a25 Use MonadResume in eval 2018-03-21 12:13:29 -04:00
joshvera
86f8ce5eab Add MonadResume 2018-03-21 12:13:17 -04:00
joshvera
e713a17ca9 Add resumable exceptions 2018-03-21 11:41:41 -04:00
Timothy Clem
cdd0a9f35e Remove this 2018-03-20 16:47:36 -07:00
Timothy Clem
038af3ccb2 Ruby require/load now return proper values too 2018-03-20 16:34:46 -07:00
Timothy Clem
8d3de3e640 PHP includes can now return proper values 2018-03-20 16:34:31 -07:00
Timothy Clem
26f2fc4f9a Store off a tuple of env value in the module table 2018-03-20 16:34:17 -07:00
Timothy Clem
d30e832e11 Move require/load so we can return values 2018-03-20 16:33:53 -07:00
Timothy Clem
041082a79d Merge remote-tracking branch 'origin/master' into php-namespaces 2018-03-20 11:07:04 -07:00
Patrick Thomson
b9cef5e540 Merge branch 'fix-hlints' of github.com:github/semantic into fix-hlints 2018-03-20 12:36:01 -04:00
Patrick Thomson
bde8afb472 Stop ignoring syntax errors and fix hints in Assignments. 2018-03-20 12:35:30 -04:00
Patrick Thomson
b61938de73 Use newtype for GShow1Options. 2018-03-20 12:21:39 -04:00
Rob Rix
5cede65fd7 Merge branch 'master' into fix-hlints 2018-03-20 11:33:28 -04:00
Patrick Thomson
62aa1a9d57 Fix evaluatePythonFile.
Ruby and Go's evaluators had been changed to invoke `evaluateFile`
rather than `evaluate` directly, but Python's didn't make it in. This
remedies that.
2018-03-20 11:14:00 -04:00
Patrick Thomson
d5c404c1aa spurious annotations 2018-03-20 10:49:57 -04:00
Patrick Thomson
9d5ace795b Take a pass at fixing/silencing linter hints.
Since @charliesome was expressing trouble with keeping custom infix
operator precedence straight (a very fair complaint, and one that I
have trouble with too), I thought it best to make sure that master
builds with clean hlints. I propose we make CI check that `hlint src`
executes cleanly.
2018-03-20 10:41:53 -04:00
Timothy Clem
47f00e4ec3 Fill in IncludeOnce, Require, and RequireOnce 2018-03-19 15:42:42 -07:00
Timothy Clem
6a0c5e8714 Gonna use this help for other instances 2018-03-19 15:35:06 -07:00
Timothy Clem
cb915cc95b No more IncludePath 2018-03-19 15:34:32 -07:00
Timothy Clem
dc2bfc5736 PHP includes just have to eval to a string 2018-03-19 15:33:06 -07:00
Timothy Clem
fc5d22f7a5 Clean up path helper functions 2018-03-19 15:32:51 -07:00
Timothy Clem
992e721281 We actually want load semantics here 2018-03-19 15:11:43 -07:00
Timothy Clem
a7a8c7121a These are not needed 2018-03-19 15:01:48 -07:00
Timothy Clem
31f7746c26 Fix for latest version of env handling 2018-03-19 14:48:06 -07:00
Timothy Clem
3b284cb401 Alternative assignment of qualified names to make spec pass 2018-03-19 14:42:31 -07:00
Timothy Clem
9ca7b7f983 Update assignment for PHP include and eval it 2018-03-19 14:42:31 -07:00
Timothy Clem
67a7a8c358 Strip both single and double quotes 2018-03-19 14:42:31 -07:00
Timothy Clem
80197edb67 Let's evaluate PHP 2018-03-19 14:42:30 -07:00
Patrick Thomson
62ee3a149e fix redundant constraint 2018-03-19 15:51:14 -04:00
Patrick Thomson
dd1e1c555d Merge remote-tracking branch 'origin/master' into classes 2018-03-19 15:45:43 -04:00
Patrick Thomson
d053da814b Merge branch 'master' into ruby-match-syntax 2018-03-19 15:35:38 -04:00
Patrick Thomson
0db78c3cb3 overwrite is a better name than merge 2018-03-19 12:40:06 -04:00
Rob Rix
95f13be61f Merge branch 'master' into doctests 2018-03-19 12:35:14 -04:00
Patrick Thomson
d419ad8bf6 Merge remote-tracking branch 'origin/master' into classes 2018-03-19 12:31:34 -04:00
Patrick Thomson
91f8701492 Merge remote-tracking branch 'origin/master' into ruby-match-syntax 2018-03-19 12:20:43 -04:00
Timothy Clem
0332350154 Don't need this constraint 2018-03-19 09:02:13 -07:00
Timothy Clem
1dbe16e206 Fix fallback for lastRange 2018-03-19 08:57:03 -07:00
Patrick Thomson
00aecff08c Add match-operation syntax and assign =~ and !~ to it.
Previously, both =~ and !~ were parsed as equal nodes. This remedies
that by adding a new syntax node and calling out to it in Ruby's
Assignment.

Fixes #1558.
2018-03-19 11:55:07 -04:00
Rob Rix
1968d3bc16 Test that Range <> is associative. 2018-03-19 09:54:34 -04:00
Rob Rix
c962a0bae5 🔥 a redundant LANGUAGE pragma. 2018-03-19 09:53:52 -04:00
Patrick Thomson
7f7aec72d9 fix broken callsites 2018-03-19 09:52:24 -04:00
Patrick Thomson
c90c57ba42 rename => mergeBindings 2018-03-19 09:48:06 -04:00
Rob Rix
3f47dfbdc0 Indent a comment. 2018-03-19 09:30:19 -04:00
Rob Rix
d54b6b812b 🔥 some ill-advised pseudo-properties. 2018-03-19 09:23:11 -04:00
Rob Rix
5fc81f8566 Rename the fresh/nondet modules to not conflict with the effects package. 2018-03-19 09:23:11 -04:00
Rob Rix
0b6dd8f126 Correct some haddocks. 2018-03-19 09:23:11 -04:00
Timothy Clem
e9d8c9c247 This is not allowed 2018-03-16 14:12:55 -07:00
Patrick Thomson
de4c3e5f8a Take a stab at typechecking. 2018-03-16 17:07:53 -04:00
Patrick Thomson
6a5c3084ad merge folderol 2018-03-16 16:58:15 -04:00
Timothy Clem
e580051a66 Merge remote-tracking branch 'origin/master' into build-fix-em-ups 2018-03-16 13:57:37 -07:00
Timothy Clem
f9fc79725a Fix up warning in markdown assignment 2018-03-16 13:55:53 -07:00
Patrick Thomson
5df347eb3e Merge remote-tracking branch 'origin/master' into classes 2018-03-16 16:51:59 -04:00
Patrick Thomson
6f13d55e60 More docs and more renaming. 2018-03-16 16:49:56 -04:00
Patrick Thomson
b6e27fc185 this comment no longer points out a lie 2018-03-16 16:40:03 -04:00
Patrick Thomson
dcaf4ed61f There is no distinction between local and global environment now. 2018-03-16 16:34:39 -04:00
Patrick Thomson
9446684846 qualify Exports, in keeping with the philosophy of not repeating prefixes 2018-03-16 16:28:24 -04:00
Patrick Thomson
9e04cee330 docs! docs! docs! 2018-03-16 16:23:45 -04:00
Timothy Clem
247b13831c We should fix these, but I'm not confident about how to do that... 2018-03-16 13:22:49 -07:00
Timothy Clem
7b558445d6 Extra constraint 2018-03-16 13:22:34 -07:00
Patrick Thomson
b26780b539 add localize 2018-03-16 16:00:49 -04:00
Patrick Thomson
96df75d5a3 Fix broken Semigroup instance for Imperative 2018-03-16 15:55:25 -04:00
Timothy Clem
9d767ba861 One more place we allow redundant-constraints 2018-03-16 12:48:42 -07:00
Timothy Clem
b9e021c682 Handle Nothing potential 2018-03-16 12:48:30 -07:00
Timothy Clem
6999781fef Extra langauge pragma 2018-03-16 12:48:05 -07:00
Timothy Clem
0556e874bb Couple more places where we don't care about redundant-constraints 2018-03-16 12:47:55 -07:00
Patrick Thomson
17bf4150e3 implement Evaluatable for member access, add doctests, and fix Latest 2018-03-16 15:41:15 -04:00
Patrick Thomson
a44d5ed861 Use the Environment functions qualified. 2018-03-16 14:33:55 -04:00
Patrick Thomson
56e7c25268 Move Exports to its own module. 2018-03-16 14:09:41 -04:00
Timothy Clem
9bf9c43ce7 Allow redunand-constraints in here for HasCallStack to work 2018-03-16 10:56:37 -07:00
Timothy Clem
624423273d Not necessary to hide this 2018-03-16 10:56:23 -07:00
Timothy Clem
fa0c72fb14 Remove some more redundant constraints 2018-03-16 10:56:15 -07:00
Timothy Clem
f3fd569a6b Implement Semigroup instances for future compatability 2018-03-16 10:55:19 -07:00
Timothy Clem
503cf9f517 Remove redundant constraint 2018-03-16 10:54:12 -07:00
Timothy Clem
1b573a196f Cleanup redundant constraints 2018-03-16 10:50:26 -07:00
Patrick Thomson
1ff123c17c implement storing class values 2018-03-16 13:00:06 -04:00
Patrick Thomson
e67590cfe6 Implement localEnv with State rather than Reader. 2018-03-16 12:48:19 -04:00
Patrick Thomson
bd24166d0f Merge remote-tracking branch 'origin/export-wrapper' into classes 2018-03-16 12:39:09 -04:00
Timothy Clem
c76eece89d No need to hide this now 2018-03-16 09:28:03 -07:00
Timothy Clem
0904796674 Add a specific Data.Abstract.Path with path/module name helpers 2018-03-16 09:27:08 -07:00
Timothy Clem
197c8d8506 Use existing toBool instead 2018-03-16 09:16:23 -07:00
Timothy Clem
cdc7cc37e8 Merge remote-tracking branch 'origin/master' into ruby-imports 2018-03-16 08:43:35 -07:00
Patrick Thomson
63a2dac3e1 start converting Environment to a stack 2018-03-16 11:25:22 -04:00
Patrick Thomson
0f1cb642f5 Merge remote-tracking branch 'origin/master' into classes 2018-03-16 10:32:59 -04:00
Patrick Thomson
0f0ae1077d Merge remote-tracking branch 'origin/master' into bitwise 2018-03-16 10:06:30 -04:00
Timothy Clem
d6036f4165 Merge remote-tracking branch 'origin/export-wrapper' into ruby-imports 2018-03-15 15:34:06 -07:00
Timothy Clem
7e2557b396 Merge remote-tracking branch 'origin/master' into export-wrapper 2018-03-15 15:25:54 -07:00
Timothy Clem
9b37eb51a5 Remove extraneous comment 2018-03-15 15:15:11 -07:00
Timothy Clem
f70ef24015 Assign and eval ruby's load syntax 2018-03-15 15:09:28 -07:00
Timothy Clem
756eff5382 Change up the shape of require for relative vs not 2018-03-15 15:07:41 -07:00
Timothy Clem
f72d7f20df Show the friendly qualified name for free variable error msg 2018-03-15 15:06:27 -07:00
Timothy Clem
6f738ee625 Bring a bunch of path parsing helpers into one place 2018-03-15 15:06:11 -07:00
Patrick Thomson
8359d4d3e4 oops 2018-03-15 16:32:48 -04:00
Patrick Thomson
9cbad7ef8f Merge remote-tracking branch 'origin/master' into maybem 2018-03-15 16:31:24 -04:00
Patrick Thomson
1ab4bd0c9d Add maybeM and maybeFail.
`maybeM act may` returns the `Just` in `may` or runs `act`.
`maybeFail str may` fails with `str` as an error or extracts the `Just`.

These combinators are so useful that I don't know why they're not in
the Prelude or some library. I use them constantly.
2018-03-15 16:25:53 -04:00
Rob Rix
0f8b874fb9 Define scatter using foldMapA. 2018-03-15 16:15:40 -04:00
Rob Rix
c81fafb184 Move foldMapA into the Prologue. 2018-03-15 16:14:51 -04:00
Rob Rix
56987f4fd2 Merge branch 'master' into jump-around,-jump-around 2018-03-15 16:10:06 -04:00
Rob Rix
4bd7bc5427 Remove the location parameter from Value. 2018-03-15 16:04:36 -04:00
Timothy Clem
5dfb19cd29 Docs, function ordering 2018-03-15 12:29:46 -07:00