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

13228 Commits

Author SHA1 Message Date
Charlie Somerville
3685e9d1c4 php: make NamespaceName's value a NonEmpty rather than list 2018-04-04 16:54:09 +10:00
joshvera
dd1c39dbd0 Resolve through ruby module resolution errors 2018-04-03 20:03:42 -04:00
joshvera
c759c065be Add another analysis to recover from RubyError 2018-04-03 19:59:39 -04:00
joshvera
a46a40c14c Rename ValueExc to ValueError 2018-04-03 19:33:12 -04:00
joshvera
f46a7f1ae6 Handle StringErrors 2018-04-03 19:32:51 -04:00
joshvera
929b11cba2 Handle call errors from call 2018-04-03 19:32:37 -04:00
joshvera
4c44a3eda4 Handle CallErrors 2018-04-03 19:32:20 -04:00
joshvera
2ca86df7c5 Store the filename as the entry point for now 2018-04-03 19:17:13 -04:00
Rob Rix
0ca31ebbee Rename the log/stat queue synonyms. 2018-04-03 19:12:12 -04:00
Rob Rix
341d36a0ce Factor the distribute effects into a new type. 2018-04-03 19:09:45 -04:00
Rob Rix
be9c27a32d Generalize go to eliminate TaskF. 2018-04-03 19:07:20 -04:00
Rob Rix
6f8fb5885b runParser operates in the underlying eff. 2018-04-03 18:53:42 -04:00
Rob Rix
5fbd6f36b4 Define writeStat shallowly. 2018-04-03 18:49:43 -04:00
Timothy Clem
218ef15860 Make it easier to test python locally with a dummy print in the prelude 2018-04-03 15:46:19 -07:00
Rob Rix
8250cedcdc Define writeLog shallowly. 2018-04-03 18:45:44 -04:00
Timothy Clem
edc00cff27 Trace out the module table for easy debug/dev of import resolution 2018-04-03 15:44:57 -07:00
Rob Rix
40e152f0e7 Factor error logging out. 2018-04-03 18:43:21 -04:00
Timothy Clem
0d29d38c50 Implement .. and ..., etc python relative imports 2018-04-03 15:42:19 -07:00
Rob Rix
8eeb6dddec Simplify runParser. 2018-04-03 18:35:24 -04:00
Rob Rix
c377d2870b Get the options from the environment when we need them. 2018-04-03 18:33:09 -04:00
Rob Rix
4d27b1d72f Make the options available via a Reader. 2018-04-03 18:30:26 -04:00
Rob Rix
5d6c75188d Make the logger available via a Reader effect. 2018-04-03 18:29:10 -04:00
Rob Rix
9c7b695729 Embed time tasks shallowly. 2018-04-03 18:24:56 -04:00
Rob Rix
77c284c3b8 Make the statter available via a Reader. 2018-04-03 18:23:21 -04:00
Rob Rix
7e5f448027 Add type synonyms for the logging & statting queues. 2018-04-03 18:17:36 -04:00
joshvera
67504eec91 Add evaluateRubyProjectGraph 2018-04-03 18:15:01 -04:00
Rob Rix
5b5d5153a5 Generalize the Task smart constructors. 2018-04-03 18:08:47 -04:00
joshvera
675f3390ea Remove import 2018-04-03 18:02:16 -04:00
joshvera
c81f57829a Remove evaluate helpers 2018-04-03 17:57:03 -04:00
Rob Rix
0a587f0949 Interpret TaskF using a helper. 2018-04-03 17:54:29 -04:00
joshvera
a291a5c3f6 Compose runAnalysis and project parsing 2018-04-03 17:53:40 -04:00
joshvera
633d20fa2a Add fromModulesWithEntryPoint 2018-04-03 17:53:05 -04:00
joshvera
b227289a0e Export evaluatePackageBody 2018-04-03 17:52:54 -04:00
Timothy Clem
a361ebd7a6 Assign and eval relative python imports 2018-04-03 14:51:00 -07:00
Patrick Thomson
e1b5c929cd forgot to call done in the decimal parser 2018-04-03 17:18:10 -04:00
Patrick Thomson
c36256e943 Standardize and fix floating-point parsing.
The existence of #1705 showed me that it's time to remove the bandaid
of a fix that was `normalizeFloatString` in #1537. This patch
introduces a proper Attoparsec parser for Scientific values that
handles the vaguaries of cross-language floating-point syntax. We
already depended on Attoparsec indirectly, so adding it as an explicit
dependency is fine.

A unit test is included, with examples taken from the tree-sitter corpora.
2018-04-03 17:02:56 -04:00
joshvera
bc91a5f320 Merge remote-tracking branch 'origin/module-resolution' into repo-import-graph 2018-04-03 16:35:33 -04:00
Rob Rix
532203621e 🔥 ><. 2018-04-03 16:35:03 -04:00
Rob Rix
5a4c9b3f91 📝 the helper functions. 2018-04-03 16:34:36 -04:00
Rob Rix
4d03abeab2 Rename/extract helpers. 2018-04-03 16:32:59 -04:00
Timothy Clem
cb1e06b457 Add a few notes 2018-04-03 13:24:09 -07:00
Timothy Clem
3cf9e67ab7 Assign relative python imports, deal only with nonempty lists 2018-04-03 13:23:54 -07:00
Rob Rix
a71c3ffaea 📝 rethrowing. 2018-04-03 16:23:19 -04:00
Rob Rix
01c6d93111 📝 catchException. 2018-04-03 16:22:28 -04:00
joshvera
7b9de5d151 Merge remote-tracking branch 'origin/master' into repo-import-graph 2018-04-03 16:19:22 -04:00
Rob Rix
1c4a8d3d9b Rename catchDynE to catchException. 2018-04-03 16:18:59 -04:00
Rob Rix
c31e523473 Define Task using Eff. 2018-04-03 16:07:38 -04:00
Rob Rix
be84d40302 Generalize Stat over MonadIO. 2018-04-03 14:18:34 -04:00
Rob Rix
3b2c8577a4 More beautification. 2018-04-03 14:16:36 -04:00
Rob Rix
0ce1bdcaeb Generalize Semantic.Log to MonadIO. 2018-04-03 14:11:30 -04:00
Timothy Clem
1d7d7df112 Remove comments 2018-04-03 11:11:13 -07:00
Rob Rix
a63efe7c78 Further beautification. 2018-04-03 13:58:18 -04:00
Timothy Clem
3bf3963c2b s/ModuleName/ModulePath 2018-04-03 10:34:10 -07:00
Timothy Clem
208d16e131 Disable import-graph specs for now 2018-04-03 10:12:20 -07:00
Timothy Clem
55cd6e4549 Dry up Ruby resolving 2018-04-03 09:00:07 -07:00
Timothy Clem
f98f7a403d Whitespace, remove extra import 2018-04-03 08:59:56 -07:00
Rob Rix
3d9727c3f4 Beautify. 2018-04-03 11:49:52 -04:00
Timothy Clem
fc5097a998 Fix up docstests 2018-04-03 08:03:29 -07:00
Timothy Clem
094359bb2d Bring back ability to get the currently evaluating module 2018-04-02 19:22:28 -07:00
Timothy Clem
69a46e4edc Merge remote-tracking branch 'origin/master' into module-resolution 2018-04-02 16:28:35 -07:00
Rob Rix
d8da29d42c Set edge attributes. 2018-04-02 18:59:29 -04:00
Rob Rix
e09c9e2ec7 Specialize the attributes for package/module vertices. 2018-04-02 18:50:18 -04:00
Rob Rix
1de632117b Extract the style. 2018-04-02 18:34:24 -04:00
Rob Rix
29159c7752 🔥 parentGraph. 2018-04-02 18:31:37 -04:00
Rob Rix
6d7b41170c Tweak the modify helper to append. 2018-04-02 18:30:21 -04:00
Rob Rix
a230af496b Wrap up definition edges in a new helper. 2018-04-02 18:28:40 -04:00
Rob Rix
b907fabbf0 Rename insertVertex to inclusion. 2018-04-02 18:20:51 -04:00
Rob Rix
92b4cb9168 Insert vertices rather than names. 2018-04-02 18:19:56 -04:00
Rob Rix
1d375d8d61 Compute the parent graph. 2018-04-02 18:17:58 -04:00
Rob Rix
40269c8fc5 Abstract the selection of the module graph. 2018-04-02 18:16:25 -04:00
Rob Rix
d2713eca19 Rename packageVertex to packageGraph. 2018-04-02 18:15:30 -04:00
Rob Rix
a87fe24e2f Use the Vertex type to contextualize names. 2018-04-02 18:14:01 -04:00
Timothy Clem
b8cd98521f Simplify TS import assignment by putting from on the end 2018-04-02 15:09:47 -07:00
Rob Rix
4449a44cb3 📝 Vertex. 2018-04-02 18:08:26 -04:00
Rob Rix
9186742ba1 Define a Vertex datatype. 2018-04-02 18:08:02 -04:00
Rob Rix
52009b0c89 Merge branch 'package-abstraction' into resolved-symbols-in-import-graph 2018-04-02 18:02:31 -04:00
Rob Rix
0c3f3c351a 📝 pushOrigin. 2018-04-02 17:56:51 -04:00
Timothy Clem
f3b196f962 Bring TS assignment and eval of imports up-to-date 2018-04-02 14:54:23 -07:00
Rob Rix
5b971ce463 📝 evaluatePackage. 2018-04-02 17:54:19 -04:00
Rob Rix
5667500a1a 📝 evaluatePackageBody. 2018-04-02 17:54:01 -04:00
Timothy Clem
d965179343 Don't parameterize QualifiedModuleName 2018-04-02 14:53:58 -07:00
Rob Rix
705a6b125f 📝 the Origin constructors. 2018-04-02 17:53:02 -04:00
Rob Rix
0c6bbc92e9 📝 Origin. 2018-04-02 17:49:43 -04:00
Rob Rix
4d66044cd7 📝 withSomeOrigin. 2018-04-02 17:48:32 -04:00
Rob Rix
76f4f79aab 📝 the SomeOrigin smart constructors. 2018-04-02 17:47:25 -04:00
Rob Rix
d298d63d75 📝 SomeOrigin. 2018-04-02 17:46:24 -04:00
Rob Rix
3a0f99bb17 📝 OriginType. 2018-04-02 17:45:49 -04:00
Rob Rix
b802247c48 Move OriginType up. 2018-04-02 17:44:48 -04:00
Rob Rix
f045f2e6a0 📝 liftCompareOrigin. 2018-04-02 17:44:21 -04:00
Rob Rix
2a85da46c3 Parameterize compareOrigins by the comparator. 2018-04-02 17:43:37 -04:00
Rob Rix
628c1a50b9 Define the Ord instance for SomeOrigin using compareOrigins. 2018-04-02 17:39:42 -04:00
Rob Rix
f028d48731 📝 originPackage. 2018-04-02 17:38:21 -04:00
Rob Rix
2c0807f0e5 📝 originModule. 2018-04-02 17:38:16 -04:00
Rob Rix
84dc109cde 📝 Origin. 2018-04-02 17:37:43 -04:00
Rob Rix
92116753dd Move the SomeOrigin constructors down next to SomeOrigin. 2018-04-02 17:36:11 -04:00
Rob Rix
e03461819c packageName is mandatory. 2018-04-02 17:35:33 -04:00
Rob Rix
fd8b9e6daf Move PackageBody up. 2018-04-02 17:34:42 -04:00
Rob Rix
d05e2b1e90 Project package info out of origins. 2018-04-02 17:34:15 -04:00
Rob Rix
aef145b55c Use withSomeOrigin to unpack the origin. 2018-04-02 17:33:53 -04:00
Rob Rix
4569b8a48b Define a helper to project values out of SomeOrigins. 2018-04-02 17:32:50 -04:00
Rob Rix
6d46f2f374 fromModules returns a PackageBody. 2018-04-02 17:32:07 -04:00
Rob Rix
5d6c57312e Split the evaluation of a package body out into a new function. 2018-04-02 17:30:04 -04:00
Rob Rix
9266439e7f Split a package body type out of Package. 2018-04-02 17:27:31 -04:00
Rob Rix
056a23a949 Move Version up. 2018-04-02 17:24:48 -04:00
Rob Rix
3fe2e91060 📝 PackageInfo. 2018-04-02 17:23:27 -04:00
Rob Rix
c732d30229 📝 Package. 2018-04-02 17:23:06 -04:00
Rob Rix
a96002bc25 Merge branch 'master' into package-abstraction 2018-04-02 17:13:12 -04:00
Rob Rix
eec36b64ff Add the package to the graph. 2018-04-02 17:11:36 -04:00
Rob Rix
3b8ed8b1e6 Project package info out of origins. 2018-04-02 17:05:42 -04:00
Rob Rix
d1d70bf31f Merge branch 'master' into symbol-resolution 2018-04-02 17:03:34 -04:00
Rob Rix
a16f1f7a1d Draw edges between modules and symbol references. 2018-04-02 17:02:51 -04:00
Rob Rix
c90791c188 Use withSomeOrigin to unpack the origin. 2018-04-02 17:02:34 -04:00
Rob Rix
dfecb756fe Define a helper to project values out of SomeOrigins. 2018-04-02 16:55:06 -04:00
Rob Rix
e5de98d88c Evaluate to import graphs in a package. 2018-04-02 16:48:09 -04:00
Rob Rix
7a6169d321 Revert "Evaluate to import graphs under monovariant/typechecking assumptions."
This reverts commit 964d99d4064d53e58625839750d2e672b6b44635.
2018-04-02 16:46:39 -04:00
Rob Rix
b10872a79f 🔥 a redundant comment. 2018-04-02 16:36:28 -04:00
Timothy Clem
a6eae9dc88 Fix up go imports for the new world 2018-04-02 13:32:41 -07:00
Rob Rix
a269856794 Define runAnalysis in terms of Control.Effect.run.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 16:02:51 -04:00
Timothy Clem
55fa6480d6 Fix up PHP eval specs 2018-04-02 11:37:01 -07:00
Timothy Clem
eb883770df Bring Ruby up to speed with latest import strategy 2018-04-02 11:31:26 -07:00
Timothy Clem
94448277e7 Few more python import comments 2018-04-02 11:21:06 -07:00
Timothy Clem
6c1cd03621 Align 2018-04-02 11:19:15 -07:00
Timothy Clem
e56c338c7e Clean up and document python imports 2018-04-02 11:19:09 -07:00
Timothy Clem
e54e61cea0 Python imports in the new world work again 2018-04-02 11:07:09 -07:00
Rob Rix
cc2a151e8a Simplify the RunEffects instance to eliminate the final Eff.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 13:48:32 -04:00
Timothy Clem
a3d35ac9a0 WIP: Attempt to back out Identifiers as qualified names 2018-04-02 10:40:52 -07:00
Rob Rix
af00b4fea6 Evaluate to import graphs under monovariant/typechecking assumptions.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 11:23:06 -04:00
Patrick Thomson
748c0f2e14 Merge branch 'master' into bump-haskell-tree-sitter-0.11 2018-04-02 11:12:34 -04:00
Rob Rix
27b6ba5204 Resolution edges point from names to defining modules.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 11:05:17 -04:00
Rob Rix
fad3e6e4ef Add edges for symbols.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 10:59:19 -04:00
Rob Rix
78997cdeb3 Modify the import graph strictly.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 10:52:36 -04:00
Rob Rix
3d94cbfd66 Generalize lookupWith to arbitrary returns.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 10:44:14 -04:00
Rob Rix
752e8fa413 Add a helper for evaluating Python import graphs.
Co-Authored-By: Josh Vera <vera@github.com>
2018-04-02 10:33:24 -04:00
Rob Rix
37cc2e36bb 🔥 Control.Effect.NonDet. 2018-04-02 10:14:57 -04:00
Rob Rix
cc0f73b1ed 🔥 MonadNonDet. 2018-04-02 10:14:46 -04:00
Timothy Clem
08e51919b6 Merge remote-tracking branch 'origin/bump-haskell-tree-sitter-0.11' into module-resolution 2018-03-31 17:02:27 -07:00
Rob Rix
4120622002 To-DONE 2018-03-30 20:20:59 -04:00
Rob Rix
58f2821d98 Merge fills in incomplete information everywhere. 2018-03-30 20:18:05 -04:00
Rob Rix
351f757ed4 Move pushOrigin into Evaluatable. 2018-03-30 20:05:40 -04:00
Rob Rix
1de09bbb25 termOrigin takes a whole term. 2018-03-30 20:05:30 -04:00
Rob Rix
2e18c422f5 Take a hint. 2018-03-30 19:59:37 -04:00
Rob Rix
803f36f5b2 Origin holds PackageInfo. 2018-03-30 19:50:48 -04:00
Rob Rix
c73166d089 moduleOrigin takes a Module again. 2018-03-30 19:50:38 -04:00
Rob Rix
0ebf115fae Split PackageInfo into a new datatype. 2018-03-30 19:46:25 -04:00
Rob Rix
37535b1823 Origin stores ModuleInfo. 2018-03-30 19:44:31 -04:00
Rob Rix
11c584b6ff Split module name/path into a ModuleInfo type. 2018-03-30 19:42:31 -04:00
Rob Rix
e6a63259fc Add a helper to parse a package. 2018-03-30 19:37:03 -04:00
Rob Rix
bf94bd87e4 Truncate the package modules/entry points. 2018-03-30 19:34:02 -04:00
Timothy Clem
b680076d30 Merge remote-tracking branch 'origin/master' into module-resolution 2018-03-30 16:14:48 -07:00
Rob Rix
aed9457896 🔥 withModules. 2018-03-30 19:09:37 -04:00
Rob Rix
5cf9dc20af Pass a single list of modules around. 2018-03-30 19:09:03 -04:00
Rob Rix
e86db91b5a Return the head value. 2018-03-30 19:06:13 -04:00
Rob Rix
4e3c607c37 Define evaluateModules in terms of evaluatePackage. 2018-03-30 19:05:32 -04:00
Timothy Clem
9089ad998d Turn at least this one back on 2018-03-30 16:01:49 -07:00
Rob Rix
52fa4c9c0f Define an entry point for packages constructed from modules. 2018-03-30 19:01:17 -04:00
Rob Rix
f7325120ca Define a singleton module table constructor. 2018-03-30 19:00:39 -04:00
Rob Rix
e1f9e34659 Define a helper to construct a package from a list of modules. 2018-03-30 18:58:23 -04:00
Rob Rix
be84d9ff78 Rename fromList to fromModules. 2018-03-30 18:55:15 -04:00
Timothy Clem
d84fe28ae0 New utils for evaling entire project directories 2018-03-30 15:54:55 -07:00
Rob Rix
fec4e09c25 Rename abstract to lambda. 2018-03-30 18:50:59 -04:00
Rob Rix
aa0ff616ab Rename apply to call. 2018-03-30 18:49:34 -04:00
Rob Rix
89e5183af0 Use the variable helper to call entry points. 2018-03-30 18:48:11 -04:00
Timothy Clem
e46ab3a596 Bring back php includes and requires 2018-03-30 15:48:05 -07:00
Timothy Clem
38fc4b1dc0 Format 2018-03-30 15:47:55 -07:00
Rob Rix
f3b3191969 📝 variable. 2018-03-30 18:46:48 -04:00
Rob Rix
92011e8ef2 Define a variable convenience. 2018-03-30 18:45:48 -04:00
Rob Rix
fe3b9730c4 Use maybeM to evaluate identifiers. 2018-03-30 18:41:49 -04:00
Rob Rix
0355d81065 Reformat evaluatePackage. 2018-03-30 18:38:33 -04:00
Rob Rix
c3bd31ffc7 Evaluate every entry point. 2018-03-30 18:38:21 -04:00
Timothy Clem
036677b909 Use resolution for Ruby (still can only resolve relative paths) 2018-03-30 15:34:00 -07:00
Rob Rix
22ba234010 Use maybeM. 2018-03-30 18:24:57 -04:00
Rob Rix
a165d09e7f More Functor laws. 2018-03-30 18:24:01 -04:00
Rob Rix
f488e1996e Define fromList tacitly. 2018-03-30 18:22:46 -04:00
Rob Rix
7d911bde7c Define a toPairs eliminator for ModuleTable. 2018-03-30 18:18:44 -04:00
Rob Rix
7d2fa60ae3 Semigroup. 2018-03-30 18:16:33 -04:00
Rob Rix
ccbeb00eb0 Entry points are represented as a map of module names to symbols. 2018-03-30 18:15:30 -04:00
Rob Rix
0d3dadb143 Functor laws. 2018-03-30 18:14:39 -04:00
Rob Rix
a8d03f2f3e Rename the ModuleTable symbols. 2018-03-30 18:13:21 -04:00
Rob Rix
d63d956cc8 Set up the local module table. 2018-03-30 18:05:48 -04:00
Rob Rix
b32372e1bc Reuse ModuleTable for a package’s modules. 2018-03-30 18:04:35 -04:00
Timothy Clem
215fa698a3 TypeScript gets it's own import path data type 2018-03-30 14:56:08 -07:00
Timothy Clem
ddfd66f9c6 Give go it's own import path data type too 2018-03-30 14:55:47 -07:00
Timothy Clem
3dba4c0d37 Don't worry about this for now 2018-03-30 14:54:59 -07:00
Timothy Clem
e499b2b843 Give Python it's own datatype for qualified module imports 2018-03-30 14:27:54 -07:00
Rob Rix
06b59fe9da Push the package into scope. 2018-03-30 16:48:21 -04:00
Rob Rix
60f9fe4608 Stub in an evaluator for packages. 2018-03-30 16:44:00 -04:00
Rob Rix
88749f47ce 🔥 the Semigroup/Monoid instances for Package. 2018-03-30 16:42:46 -04:00
Rob Rix
7375d18a6f Merge branch 'master' into symbol-resolution 2018-03-30 16:24:32 -04:00
Rob Rix
9499105dad Merge branch 'master' into package-abstraction 2018-03-30 16:19:45 -04:00
Rick Winfrey
06a32b3d27 Remove now unneeded keyword assignment 2018-03-30 12:31:30 -07:00
Timothy Clem
7d5047777d Specialize imports for Python and Go 2018-03-30 11:53:18 -07:00
Timothy Clem
4f9978c063 Disable this for now 2018-03-30 11:52:42 -07:00
Timothy Clem
fba2662f62 Helpful diagnostics (temporary) 2018-03-30 11:52:30 -07:00
Timothy Clem
2fb6e73e9a Move side effect imports to Go's syntax 2018-03-30 11:16:10 -07:00
Rob Rix
f1a44db139 Merge modules’ packages. 2018-03-30 13:59:05 -04:00
Timothy Clem
1f2aebe7d5 Few fixes to relative resolution 2018-03-30 10:56:13 -07:00
Timothy Clem
b7640d7649 Move over and implement qualified export with TS path resolution 2018-03-30 10:56:02 -07:00
Rob Rix
8796f915d4 Parameterize origin fields by () rather than term. 2018-03-30 13:55:21 -04:00
Timothy Clem
2ee234c627 Custom Show for Module so that I don't have to keep parsing through all those terms 2018-03-30 10:55:16 -07:00
Rob Rix
3852a7207f Define a Functor instance for Package. 2018-03-30 13:47:24 -04:00