1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00
Commit Graph

26620 Commits

Author SHA1 Message Date
joshvera
14347215cb Set the declaration's scope in runFunction 2018-11-05 16:09:39 -05:00
Timothy Clem
bdb7ee0430 More tests 2018-11-05 13:09:37 -08:00
joshvera
95204199fb rename address to frameAddress 2018-11-05 16:09:14 -05:00
joshvera
674d835ad9 import AllocatorC 2018-11-05 16:09:02 -05:00
joshvera
652461a65f asArray returns values 2018-11-05 16:08:56 -05:00
joshvera
cb0c4ac8f2 address returns a slot 2018-11-05 16:08:50 -05:00
joshvera
9a1fc0f063 Return () from declare 2018-11-05 16:08:34 -05:00
joshvera
cd78a2aaa7 expose runAllocator 2018-11-05 16:08:20 -05:00
joshvera
fc6c21c85e Rename address to frameAddress 2018-11-05 16:08:06 -05:00
joshvera
2beb576dd7 assign to the correct slot in define 2018-11-05 16:07:44 -05:00
joshvera
b3b7d2e5ff fix constraints 2018-11-05 16:07:23 -05:00
joshvera
1f43f15c1d Remove deref from python package 2018-11-05 16:06:18 -05:00
joshvera
3c0e7ce322 remove configurationContext 2018-11-05 16:05:39 -05:00
joshvera
2eeaf7585c parameterize eavesdrop with value 2018-11-05 16:05:11 -05:00
joshvera
e4e6451b1e Remove configurationContext and fix type params 2018-11-05 16:04:52 -05:00
Timothy Clem
d0fc88efee Some python specs for tags 2018-11-05 12:33:23 -08:00
Timothy Clem
67724b2812 Take annotation from first item in list for snippets 2018-11-05 12:33:14 -08:00
Timothy Clem
7169685d06 Always use a wrapping list for python functions and classes 2018-11-05 12:32:46 -08:00
Timothy Clem
11c145589c Give class a custom Declarations1 instance 2018-11-05 09:27:41 -08:00
joshvera
37da68d706 Show builtIn name 2018-11-05 12:22:22 -05:00
joshvera
28ee7a136d currentScope returns in Maybe 2018-11-05 12:22:09 -05:00
joshvera
0d0ef95582 type parameters 2018-11-05 12:22:01 -05:00
Patrick Thomson
15f5319252 fix stray indent 2018-11-05 12:17:05 -05:00
Patrick Thomson
76f0ef7f38 Merge remote-tracking branch 'origin/master' into revisit-matching 2018-11-05 11:07:49 -05:00
Patrick Thomson
f00d423b74 Merge pull request #2253 from github/move-annotations-into-hlint-config
Move annotations into hlint config
2018-11-05 11:07:41 -05:00
Patrick Thomson
688219e380 Arrow instance, why not 2018-11-05 11:06:59 -05:00
Timothy Clem
fa60a394b4 Fully commit to new method of generating symbols 2018-11-05 08:03:09 -08:00
Timothy Clem
0a9034e28f Space and docs 2018-11-05 07:57:21 -08:00
Timothy Clem
0cacdd84d0 Helps the warnings 2018-11-05 07:57:14 -08:00
Rob Rix
3cb4fc5711 Use pure instead of return & 🔥 the annotation. 2018-11-05 09:53:17 -05:00
Rob Rix
e86ec64c66 Correct the format of the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
2ee79706e3 Whitelist attemptUnsafeArithmetic in the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
68d87314ce Move the reduce duplication annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
4f92337221 Move the ignore use . annotation into the hlint config. 2018-11-05 09:51:56 -05:00
Rob Rix
1e5920e318 Move the ignore eta reduce thing into the hlint config. 2018-11-05 09:51:04 -05:00
Rob Rix
fe9f0b0aeb 🔥 a redundant hlint annotation. 2018-11-05 09:49:34 -05:00
Patrick Thomson
292a268b00 better name for infix operator 2018-11-04 14:46:19 -05:00
Patrick Thomson
a84b25ad6e remove Data.Algebra import 2018-11-04 14:39:38 -05:00
Patrick Thomson
8e4f9ea119 better docs 2018-11-02 19:43:12 -04:00
Patrick Thomson
7ea52dbfe3 Give Control.Matching API better ergonomics.
Given that @tclem and I have found the matcher API frustrating, I've
taken a stab at improving its ergonomics, and I've found some success
in separating composition of matchers from predicate-based narrowing
thereof.

The biggest change here is the elimination of the old `match`
combinator, which proved to be clumsy in that it complected narrowing
and composition. Top-down matching combinators are now written with
the `need` combinator and the `>>>` combinator, which is more readable
and more versatile. Here's a matcher that accepts functions with
Python docstrings:

```haskell
docstringMatcher :: ( Decl.Function :< fs
                    , [] :< fs
                    , Lit.TextElement :< fs
                    , term ~ Term (Sum fs) ann
                    ) => Matcher term term
docstringMatcher = target <*
               (need Decl.functionBody
                >>> narrow @[]
                >>> mhead
                >>> narrow @Lit.TextElement
                >>> ensure Lit.isTripleQuoted))
```

Pretty readable, right? Each step of the tree regular expression -
choosing function bodies, ensuring said bodies are lists, examining
the first element, and choosing only TextElements containing
triple-quoted strings - is made implicit. The old way would have
looked something like this:

```haskell
docstringMatcher = target <* match Decl.functionBody
                           $ narrow
                           $ matchM listToMaybe
                           $ target <* ensure Lit.isTripleQuoted
```
which is a good deal more disorganized and less flexible
in the quite-common case of applying functions during a
matching pass. Separating the act of composition from
function application is a big win here.

Further comments are inline.
2018-11-02 19:25:29 -04:00
Timothy Clem
36c7bcd678 Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-02 13:58:47 -07:00
Timothy Clem
8d12b5c242 Fix declarations to make tests pass 2018-11-02 13:55:55 -07:00
Timothy Clem
5b9b0daee3 Helper for testing ruby tags 2018-11-02 13:55:46 -07:00
Timothy Clem
0f56f33f24 Introduce some symbol/tags tests 2018-11-02 13:55:30 -07:00
Timothy Clem
bf90ef8e45 Did this 2018-11-02 13:54:55 -07:00
Patrick Thomson
a720cf06d4 Merge pull request #2250 from github/python-functions-wo-annotations
Python assignment: conditionally include annotation on functions
2018-11-02 16:42:25 -04:00
joshvera
2f3fc46e00 Remove subterm uses 2018-11-02 16:18:49 -04:00
joshvera
29383adf7a currentScope returns in Maybe 2018-11-02 16:18:35 -04:00
joshvera
42b350cc6e Remove evalQualifiedImport 2018-11-02 16:18:24 -04:00
joshvera
bb39ebde84 use withLexicalScopeAndFrame 2018-11-02 16:18:16 -04:00