1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00
Commit Graph

127 Commits

Author SHA1 Message Date
Rob Rix
0e68767028 Close over the function. 2015-11-26 16:27:57 -05:00
Rob Rix
fdc2942411 Just return the result directly. 2015-11-26 16:27:22 -05:00
Rob Rix
3b24a3cd34 Parsing returns a Term. 2015-11-26 16:25:55 -05:00
Rob Rix
ae7235eb69 Use withCString instead of copying and freeing. 2015-11-26 16:24:57 -05:00
Rob Rix
4fd4c66f08 Rename parse to documentToTerm. 2015-11-26 16:22:27 -05:00
Rob Rix
253c461b12 Handle the alloca in parse. 2015-11-26 16:22:01 -05:00
Rob Rix
f27f35c683 Better error messages. 2015-11-26 16:21:54 -05:00
Rob Rix
ac470d3fbb We no longer require a Storable instance for TSLength. 2015-11-26 16:17:25 -05:00
Rob Rix
8a2fac6816 Construct a singleton set. 2015-11-26 16:15:56 -05:00
Rob Rix
4505c0f7e3 Don’t qualify member and fromList. 2015-11-26 16:15:39 -05:00
Rob Rix
f6f4ea05ed Don’t import Data.Map. 2015-11-26 16:14:34 -05:00
Rob Rix
54e931eabe Handle the allocation within parseTreeSitterFile. 2015-11-26 16:09:16 -05:00
Rob Rix
be6dc5e627 Once more remove withAlloc. 2015-11-26 16:07:25 -05:00
Rob Rix
ab7fa792ed Use alloca instead of withAlloc. 2015-11-26 16:07:21 -05:00
Rob Rix
018f4dcbd5 Operate strictly recursively.
This means we’re ensured of using allocations solely within the scopes
in which they are valid.
2015-11-26 16:07:04 -05:00
Rob Rix
19818231f5 We can safely alloca the root. 2015-11-26 15:37:57 -05:00
Rob Rix
49133ad240 Don’t import Generic. 2015-11-26 14:03:57 -05:00
Rob Rix
aaf4164e92 Don’t derive Generic. 2015-11-26 14:03:53 -05:00
Rob Rix
4d314d6729 Don’t import GHC.Prim. 2015-11-26 14:02:33 -05:00
Rob Rix
755cae0ae4 Don’t import CStorable. 2015-11-26 14:01:46 -05:00
Rob Rix
f15af07f2e Don’t bother deriving CStorable. 2015-11-26 14:01:42 -05:00
Rob Rix
1e8c4b54ac Just cheer when we’re done. 2015-11-26 14:01:16 -05:00
Rob Rix
1df3b71e2c Rename the variable. 2015-11-25 18:42:21 -05:00
Rob Rix
5162128c40 What if malloc?
It no longer crashes, so, that’s cool.
2015-11-25 18:32:48 -05:00
Rob Rix
1eac4a8ab3 Fake out the storable instances. 2015-11-25 18:32:17 -05:00
Rob Rix
bf3fac3d53 What if these were records? 2015-11-25 18:32:05 -05:00
Rob Rix
b4bcc9ef47 Tidy up toTerm. 2015-11-25 18:31:54 -05:00
Rob Rix
d4d6210a19 Restore withAlloc. 2015-11-25 18:30:55 -05:00
Rob Rix
88e78d00d8 Fetch the node’s name once per node. 2015-11-25 17:11:43 -05:00
Rob Rix
7039beceea Return fast on empty children lists. 2015-11-25 17:09:42 -05:00
Rob Rix
caf06cef5e Don’t import the Haskell parser stuff. 2015-11-25 16:41:06 -05:00
Rob Rix
5158e28349 Up to but not including the count. 2015-11-25 15:22:18 -05:00
Rob Rix
4aadaae7b6 Convert name to a Haskell string. 2015-11-25 15:17:51 -05:00
Rob Rix
2fef254244 Disambiguate which member we mean. 2015-11-25 15:17:40 -05:00
Rob Rix
854225666b Produce Fixed nodes. 2015-11-25 15:10:49 -05:00
Rob Rix
3f97be8df8 Remove withAlloc. 2015-11-25 15:05:24 -05:00
Rob Rix
ac6173fd8a Just use alloca. 2015-11-25 15:05:10 -05:00
Rob Rix
debae6d3d4 Everything else is Indexed (for now). 2015-11-25 15:02:42 -05:00
Rob Rix
aa4de17445 Only use leaves for empty nodes. 2015-11-25 15:02:30 -05:00
Rob Rix
d6860a8934 Unpack the node and category another layer deep. 2015-11-25 15:02:11 -05:00
Rob Rix
855a8bc51b Annotate terms with ranges. 2015-11-25 12:56:22 -05:00
Rob Rix
3f5ce3806d Populate leaves with the substring for the node. 2015-11-25 12:54:42 -05:00
Rob Rix
8bc51c2f86 Compute a substring from a range. 2015-11-25 12:53:56 -05:00
Rob Rix
40a0bc0b91 Pass the contents of the file to toTerm. 2015-11-25 12:53:48 -05:00
Rob Rix
ba3e2d8256 Compute the range of a given node. 2015-11-25 12:51:11 -05:00
Rob Rix
c57dd1ef8f Return the position & size directly.
Copying into TSLengths ended up being worst of both worlds.
2015-11-25 12:50:22 -05:00
Rob Rix
93e05435e5 Import position/size functions. 2015-11-25 12:25:06 -05:00
Rob Rix
5667f4d687 That is not where these live. 2015-11-25 12:24:07 -05:00
Rob Rix
1bb38abd71 Generalize withNode to withAlloc. 2015-11-25 12:19:39 -05:00
Rob Rix
2d60fea921 Remove the Kliesli import as we don’t actually use it. 2015-11-25 12:08:30 -05:00