Commit Graph

11079 Commits (a9866e11875986a4e7be73fd38f535fedea318d0)
 

Author SHA1 Message Date
Wilfred Hughes f10cfa00cc Limit the graph size based on the number of predecessors found
Fixes #183
Fixes #306
2022-07-03 18:23:17 +07:00
Wilfred Hughes 338e815e9b More clippy fixes 2022-07-03 11:23:18 +07:00
Wilfred Hughes 51ddcef393 Make clippy happier 2022-07-03 11:20:44 +07:00
Wilfred Hughes 186a2f98f1 Take the shortest edge when constructing the path
Previously we assumed that there was a single edge between nodes. This
is true of the current implementation, but not in all experiments.

This is also a tiny performance win (0.2% instruction count reduction).
2022-07-03 11:16:33 +07:00
Fisher Sun cf394604ae
Use nvim-treesitter version of highlights.scm (#87)
This commit replaces highlights.scm with nvim-treesitter's version.
To comply with nvim-treesitter's Apache license,
I have added a copy of the Apache License.
I have also added the Apache boilerplate to the top of highlights.scm
to clarify its license.
2022-07-02 11:46:11 +07:00
Benjamin Manns 99813e7ff0 Add entry to adding_a_parser.md about sliders 2022-07-01 12:23:36 +07:00
Benjamin Manns d131ae1d35 Add HTML parser 2022-07-01 12:23:20 +07:00
Benjamin Manns edce245beb Add 'vendor/tree-sitter-html/' from commit '29f53d8f4f2335e61bf6418ab8958dac3282077a'
git-subtree-dir: vendor/tree-sitter-html
git-subtree-mainline: 5c19ac600d
git-subtree-split: 29f53d8f4f
2022-07-01 12:23:11 +07:00
Maksim Novikov 218b672499
Merge branch 'window-function-calls' 2022-06-30 19:50:55 +07:00
Maksim Novikov d47bb2f1cd
Merge branch 'aggregate-expressions' 2022-06-30 19:47:36 +07:00
Wilfred Hughes 5c19ac600d Fix duplicate newlines when a whole file is novel
Broken in trunk but works fine in 0.29.1. Fixes #302
2022-06-29 21:36:52 +07:00
Jonathan Arnett 85c0753e8e Version 0.22.1 2022-06-29 21:57:03 +07:00
Jonathan Arnett 08901b401c Version 0.22.0 2022-06-29 21:57:03 +07:00
Jonathan Arnett ac8c9438f8 Add scanner.c to files to be compiled for release 2022-06-29 21:57:03 +07:00
Tim Luo 1cdb6abb48 Support window definitions & window function calls 2022-06-29 10:58:25 +07:00
Tim Luo bf3ea7293f Improve function call to support aggregate expressions 2022-06-29 10:43:45 +07:00
Maksim Novikov 15ee655c3b
Merge branch 'improve-group-by-clause' 2022-06-28 20:52:23 +07:00
Maksim Novikov 5fcf2fd261
Merge branch 'improve-order-by-clause' 2022-06-28 20:46:41 +07:00
Maksim Novikov a188ac6e94
Merge branch 'improve-values-clause' 2022-06-28 20:44:08 +07:00
Maksim Novikov 76cdf7cdb3
Merge branch 'support-create-view' 2022-06-28 20:37:53 +07:00
Max Brunsfeld de221eccf9 0.20.2 2022-06-27 15:09:45 +07:00
Arthur Baars 5b305c3cd3
Merge pull request #220 from aibaars/parser-improvements-2
Parser improvements: `!=` operator and `key: [line_break]`
2022-06-27 12:03:05 +07:00
Tim Luo abb393f693 Support select subexpressions in view body 2022-06-26 23:30:11 +07:00
Tim Luo 7d0f8f4602 Support CREATE MATERIALIZED VIEW statement 2022-06-26 23:29:00 +07:00
Tim Luo a9b8dcea43 Support CREATE VIEW statement 2022-06-26 23:28:55 +07:00
lilydjwg c72626808f use unicode-width to align CJK characters 2022-06-26 21:51:26 +07:00
lilydjwg f88cb8c018 fix that continuation line numbers (....) are colored when colors should not be used 2022-06-26 21:12:07 +07:00
Maksim Novikov d0a47edcb1
Merge branch 'improve-drop-statement' 2022-06-25 18:12:56 +07:00
Maksim Novikov f622fb6a0e
Merge branch 'improve-create-type-statement' 2022-06-25 18:05:40 +07:00
Max Brunsfeld 188b6b062d Ensure dedent tokens are returned even amid syntax errors 2022-06-24 18:47:17 +07:00
Max Brunsfeld ece74b2094
Fix infinite loops with unterminated strings (#143) 2022-06-24 15:38:28 +07:00
Max Brunsfeld 597c4bb7e2 Always allow dedents to be recognized during error recovery 2022-06-24 15:36:58 +07:00
Yoann Padioleau 391803ed80
Merge pull request #214 from tree-sitter/object_is
Support predefined types in type predicates
2022-06-24 15:05:21 +07:00
pad 5caf25eea2 npm build 2022-06-24 14:03:27 +07:00
Arthur Baars 72bf3a1424 Handle newlines after pair-keys 2022-06-24 13:22:14 +07:00
Yoann Padioleau 22167c22da
Merge pull request #213 from nmote/typeof-prec
Fix type_query precedence
2022-06-24 13:13:47 +07:00
pad 46e9c43848 Merge branch 'master' into object_is 2022-06-24 13:13:28 +07:00
Arthur Baars 4a7d06be6a Add test case for pair-key followed by a newline 2022-06-24 12:46:53 +07:00
Arthur Baars cbd998cf66 Move constant_suffix and identifier_suffix to scanner 2022-06-24 12:41:07 +07:00
Arthur Baars 6fa63322f5 Add test-case for unspaced != operator 2022-06-24 12:39:30 +07:00
Logan Wemyss 45ce22c16e Generate bindings 2022-06-23 20:50:13 +07:00
Max Brunsfeld 7473026494 0.20.1 2022-06-23 11:10:26 +07:00
Max Brunsfeld acafb36582
Fix parsing of string literals immediately after syntax errors (#172) 2022-06-23 10:58:31 +07:00
pad 3e83446ec2 Support predefined types in type predicates
In `function (): object {...}` object is a predefined type, but
in `function (object: any): object is foo{}` object is now
a regular identifier. The previous grammar was not able
to parse the second example, probably because when the parsers
sees the second ':' for the return type, the contextual lexual
does not know yet if it's a type predicate or predefined type, so
it accepts 'object' as a predefined type and only fail later when
it sees 'is'.

test plan:

I tried in astexplorer.net and the second example is valid typescript
code (sadly).
2022-06-23 14:26:27 +07:00
Tim Luo c8b9c3f36a Refactor group_by clause 2022-06-23 02:56:31 +07:00
Tim Luo 1db9ca58f8 Refactor order_by clause 2022-06-23 00:24:31 +07:00
Yoann Padioleau 6ff54a9b15
Merge pull request #121 from cfroystad/heredoc
Adds support for interpolated strings to HEREDOC
2022-06-22 14:39:16 +07:00
Nat Mote 0a90858cc7
Fix type_query precedence
The precedence for `type_query` needs to be higher than that of
`_type_query_subscript_expression`. Otherwise, the parser will generate
incorrect parses, and even fail to parse valid code in some cases.

The code `type X1 = typeof Y[keyof typeof Z];` should actually have
`typeof Y` grouped together. I verified this in astexplorer.net, and I
verified that TypeScript itself does parse this line. Currently, it
fails to parse using this tree-sitter grammar. Because of the incorrect
precedence, it expects an expression between the brackets instead of a
type.

I also used AST Explorer to check how TypeScript parses the other tests
that changed. In both cases, the updated parse is correct.
2022-06-21 19:03:39 +07:00
Calvin Lee b7bd692853 Parse Enum Class Labels
This commit adds parsing code for enum class labels, which use the `#`
character to separate a class from a label.

Fixes #50
2022-06-21 17:38:28 +07:00
Calvin Lee e6ced83a5b Remove # comments from corpus
It has not been valid to start a comment with a `#` character for a [quite a
while](https://docs.hhvm.com/hack/source-code-fundamentals/comments). Remove
this usage from the test corpus.
2022-06-21 17:38:28 +07:00