1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00
Commit Graph

313 Commits

Author SHA1 Message Date
Rob Rix
ab059af248 Assignment receives ranges. 2017-04-21 09:54:17 -04:00
Rob Rix
2f696ef88d Pass the symbol in a record. 2017-04-21 09:52:23 -04:00
Rob Rix
b5575d7298 📝 parseRubyToAST. 2017-04-21 09:44:05 -04:00
Rob Rix
a29b7b6f2b Return the Source alongside the AST.
This makes for easier chaining.
2017-04-21 09:43:29 -04:00
Rob Rix
9a42d8f4c8 Replace Node with its symbol, dropping the source. 2017-04-20 15:53:01 -04:00
Rob Rix
c46e0904d1 Slice in linear time. 2017-04-12 16:18:26 -04:00
Rob Rix
da022960f4 toAST unfolds the whole tree. 2017-04-12 16:02:12 -04:00
Rob Rix
12eca8a3b0 Structure Ruby AST importing as an unfold(ish). 2017-04-12 15:03:35 -04:00
Rob Rix
e50ec88a01 Export parseRubyToAST. 2017-04-12 14:32:32 -04:00
Rob Rix
ce075494cf Stub in a function to produce AST for Ruby. 2017-04-12 14:31:55 -04:00
Rob Rix
5b755aa355 Use the DefaultFields synonym everywhere. 2017-03-31 15:22:26 -04:00
joshvera
461b1c665b Merge remote-tracking branch 'origin/master' into typescript 2017-03-29 10:17:53 -04:00
joshvera
f86d43a6e5 Add namespace mapping 2017-03-28 15:43:21 -04:00
Rob Rix
a8410e8829 🔥 various uses of LambdaCase. 2017-03-28 15:32:45 -04:00
joshvera
3e0efb7b61 Merge remote-tracking branch 'origin/batch-copy-terms' into typescript 2017-03-28 15:07:15 -04:00
Rob Rix
e1c914d90a Bump haskell-tree-sitter. 2017-03-28 09:45:19 -04:00
Rob Rix
02828cb949 Pass the TSNode through instead of copying the whole Node back over. 2017-03-27 18:19:24 -04:00
Rob Rix
f207a70e1c Spacing. 2017-03-27 16:56:28 -04:00
Rob Rix
5c3a8cac21 Bind the copying functions in the where clause. 2017-03-27 16:19:09 -04:00
Rob Rix
bbc488d12a Pull getChildren, childNodeToTerm, and range into a where clause. 2017-03-27 16:17:10 -04:00
Rob Rix
bf68679f20 Tidy up the source span. 2017-03-27 16:04:43 -04:00
Rob Rix
23c4a8b6c3 Tidy up how we get child terms. 2017-03-27 16:03:35 -04:00
Rob Rix
32b6ff17e0 Filter non-empty children in getChildren. 2017-03-27 16:02:25 -04:00
Rob Rix
72b5b056de Don’t pass the range in. 2017-03-27 15:59:48 -04:00
Rob Rix
e6b85848da We no longer need to evaluate these strictly. 2017-03-27 15:57:11 -04:00
Rob Rix
fa68774cbd Take a Node, not a Ptr Node. 2017-03-27 15:54:34 -04:00
Rob Rix
19ce10451a Batch-copy nodes. 2017-03-27 15:48:24 -04:00
joshvera
fcb1847671 Add TypeScript module to list of langauges 2017-03-15 17:32:31 -04:00
Rob Rix
598b933aea Byte ranges, not character ranges. 2017-02-15 16:17:01 -05:00
Rob Rix
566891afb7 Offset by the parent’s starting index. 2017-02-13 13:51:07 -05:00
Rob Rix
7cf8a7ddbb Compute the child node’s range, not the parent’s. 2017-02-13 12:28:05 -05:00
Rob Rix
d18dfe453e Use the correct offset for child ranges.
This also ensures that getChild must close over the correct range & source.
2017-02-13 11:41:57 -05:00
Rob Rix
b473e4eafe Extract isNonEmpty & nodeRange. 2017-02-13 11:41:10 -05:00
Rob Rix
2bfc2d91c8 Offset the child range correctly. 2017-02-10 16:57:33 -05:00
Rob Rix
f8cc3b8933 Close over the right source. 2017-02-10 16:53:40 -05:00
Rob Rix
00c14e403a Revert "Source carries its Range."
This reverts commit 6e075787935c10b0bd7256673a5623cb5d1a4945.
2017-02-10 16:44:09 -05:00
Rob Rix
f3bad55fee Revert "Close over the correct source."
This reverts commit 6770d9970d9e4aee6029e9b739583c1dc8cfc372.
2017-02-10 16:44:07 -05:00
Rob Rix
46aa3b8fc0 Revert "Take the range from the source."
This reverts commit fd59885f1dc0a4dba976617ed6791d76ad44f708.
2017-02-10 16:44:06 -05:00
Rob Rix
aa78d3215f Revert "Make doubly sure we don’t close over the wrong variable."
This reverts commit 9d24a050f33ad4e123f82a272331d39fd75de68b.
2017-02-10 16:44:03 -05:00
Rob Rix
d1a5167999 Make doubly sure we don’t close over the wrong variable. 2017-02-10 15:45:02 -05:00
Rob Rix
94c448bef3 Take the range from the source. 2017-02-10 15:42:16 -05:00
Rob Rix
26efa43611 Close over the correct source. 2017-02-10 15:35:10 -05:00
Rob Rix
672ff179ed Source carries its Range. 2017-02-10 15:33:41 -05:00
Rob Rix
f723b576e1 Pass the getter in. 2017-02-10 12:59:22 -05:00
Rob Rix
ad5d659941 Cut down on crossing the FFI. 2017-02-10 12:58:15 -05:00
Rob Rix
5688c2b447 Pre-slice the source passed to toTerm. 2017-02-10 12:26:02 -05:00
Rob Rix
9bcabf21b7 Extract a function to retrieve the range for a node. 2017-02-10 12:24:10 -05:00
Rob Rix
bc2a29d84e Source is no longer parametric in the character type. 2017-02-10 11:21:24 -05:00
Rob Rix
e85eb49e0e Tidy up the imports a bit. 2017-02-10 11:02:38 -05:00
Rob Rix
060680f070 🔥 a redundant import. 2017-02-10 09:32:10 -05:00
Rob Rix
42871bcc94 Fix do notation. 2017-02-10 09:28:57 -05:00
Rob Rix
2108d7287a Use the new input string with length API. 2017-02-10 09:23:51 -05:00
Timothy Clem
d6796afd6f Pass Text to tree-sitter 2017-02-09 21:31:29 -08:00
Rob Rix
2929fb3cb4 Rename Syntax.Error to ParseError. 2017-01-25 03:09:53 -05:00
Rob Rix
296c53f187 Rename Category.Error to ParseError. 2017-01-25 03:08:06 -05:00
Rob Rix
833f2f755e Add a language-agnostic assignment of Throw. 2017-01-25 03:02:03 -05:00
Rob Rix
6207e474b6 Add a language-agnostic Yield assignment. 2017-01-25 02:58:04 -05:00
Rob Rix
9a4c92d735 Only pass the category to term assignment. 2017-01-23 16:04:31 -05:00
Rob Rix
a27edde9e4 Return Syntax from Go term assignment. 2017-01-23 16:01:42 -05:00
Rob Rix
281df3178f Handle Case language agnostically. 2017-01-23 15:12:38 -05:00
Rob Rix
e95ae2c5d9 Ruby uses Switch/Case like anyone else would. 2017-01-23 15:06:05 -05:00
Rob Rix
974020891a Assign Switch terms language-agnostically. 2017-01-23 15:04:05 -05:00
Rob Rix
a7cbea7051 Handle break/continue statements language-agnostically. 2017-01-23 14:09:07 -05:00
Rob Rix
a0bdcb9f60 Handle pairs in the default term assignment. 2017-01-23 14:07:47 -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
24753de48d Add a default handler for if statements. 2017-01-20 15:20:36 -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
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
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
af8b3bf268 Go term assignment is (notionally) partial. 2017-01-20 13:51:52 -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
c93d9abe0b Pass the annotations in whole. 2017-01-19 16:36:49 -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
4d1d84ef9f Map parse error categories in one place. 2017-01-19 15:09:22 -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
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
Timothy Clem
5c0ee56565 Bring in new tree-sitter API to query all child nodes 2016-12-06 11:21:31 -08:00
joshvera
30a3961409 Add go, defer, and subscript access statements 2016-11-14 19:05:02 -05:00
joshvera
0d58e97070 Merge remote-tracking branch 'origin/master' into go-parser 2016-11-02 15:25:50 -04:00