Commit Graph

421 Commits (3aa86705b4f2379b51cfa7b9639208bebc6b8b35)
 

Author SHA1 Message Date
Johannes Coetzee 3aa86705b4 Fix double dollar escapes 2023-07-20 14:20:54 +07:00
Johannes Coetzee aa5907747b Fix interpolated string identifiers 2023-07-19 23:40:59 +07:00
Vasil Markoukin 8062487fb3
Merge pull request #320 from natsukagami/patch-1
Add "conditional" to `case` in `indented_cases`
2023-06-30 18:34:40 +07:00
Vasil Markoukin 263ce720d5
Merge pull request #321 from natsukagami/use-match
Use match? instead of lua-match? for queries
2023-06-30 18:22:10 +07:00
Natsu Kagami 25f8fdfb74
Change wrong scala3 test
Old test used to pass due to `lua-match` predicates not being run with `tree-sitter` command
2023-06-30 15:35:53 +07:00
Natsu Kagami 65fdb1743f
Use match? instead of lua-match? for queries 2023-06-30 14:47:33 +07:00
Natsu Kagami b7a63ca032
Add "conditional" to `case` in `indented_cases` 2023-06-30 13:49:59 +07:00
Chris Kipp cda0de8a03
Merge pull request #314 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-22 08:48:46 +07:00
GitHub babe7c2a95 chore: generate and sync from 4f399842e9 2023-06-22 05:04:04 +07:00
Chris Kipp 4f399842e9
Merge pull request #312 from KaranAhlawat/type-lambdas
Add support for Type Lambdas
2023-06-21 08:39:03 +07:00
Karan Ahlawat 61aa6534b2 correct result_type to return_type 2023-06-21 11:51:21 +07:00
Karan Ahlawat 2db441828f Add type lambda rule and related tests 2023-06-21 11:46:42 +07:00
Chris Kipp a5c4c29b95
Merge pull request #309 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-15 09:12:20 +07:00
GitHub c714ed3e2b chore: generate and sync from e0d5372a20 2023-06-15 05:04:08 +07:00
Vasil Markoukin e0d5372a20
Merge pull request #308 from G1ng3r/fix/implicit-arg-lambda-expr
Closes #260
2023-06-14 19:49:46 +07:00
s.bazarsadaev 662a3e9957 Closes #260 2023-06-14 19:34:29 +07:00
Chris Kipp 3c5e57a55b
Merge pull request #307 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-13 08:17:24 +07:00
GitHub 21cd33bdb3 chore: generate and sync from dd02e510e9 2023-06-13 05:03:53 +07:00
eugene yokota dd02e510e9
Merge pull request #306 from susliko/better-comments
Better comments
2023-06-12 10:16:46 +07:00
susliko 0e89e94d5f Better comments
Problem
-------
The following comment combinations are not parsed:
1. ```
// /*
// *
// */
```
2. ```
/* // */
```
Solution
-------
- set higher lexing priority for `$._comment_text` token
- include "//" as an alternative to the contents of `$.block_comment`
2023-06-12 15:51:10 +07:00
eugene yokota 199cf060ee
Merge pull request #301 from susliko/extra-spaces-before-outdents
Issue OUTDENT with extra spaces before brackets
2023-06-11 01:57:23 +07:00
eugene yokota cd42461e94
Merge pull request #304 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-11 01:57:05 +07:00
GitHub b8bd6e67d8 chore: generate and sync from 3573bf75fe 2023-06-11 05:04:25 +07:00
susliko 16974b4535 Issue OUTDENT with extra spaces before brackets
Problem
-------
```scala
{ x =>
  if (a) b.c }
```
is not parsed because OUTDENT token is not emitted in a presense of
space characters before the closing bracket

Solution
-------
Reorder space-handling and outdent-ing logic in external scanner
2023-06-11 00:00:13 +07:00
Vasil Markoukin 3573bf75fe
Merge pull request #297 from susliko/structural-types
Structural types in declarations
2023-06-10 23:39:12 +07:00
susliko bc9fb988bf Structural types in declarations
Problem
-------
Structural types in declarations are not parsed:
```
val x: F { val y: Int }
```

Solution
-------
Remove -1 precedence for `$._structural_type` branch of  `$.compount_type`, resolve conflict with `$._type` explicitly

Extra changes
-------
Removed some unused conflict resolutions
2023-06-10 22:01:47 +07:00
eugene yokota d42d40c7ad
Merge pull request #296 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-09 23:29:41 +07:00
GitHub 4f188b08e0 chore: generate and sync from b2dd83f635 2023-06-10 03:25:47 +07:00
eugene yokota b2dd83f635
Merge pull request #295 from susliko/multi-line-param-lists
Multi-line parameter lists
2023-06-09 12:48:52 +07:00
susliko 917cf8c54d Multi-line parameter lists
Problem
-------
Parameter lists spreading multiple lines are not handled:
```
class A
():
  def b
    (): Int = 1
```

Solution
-------
Match `$._automatic_semicolon` in `$._function_constructor` and
`$.class_parameters`

Side-change: reuse `$._function_declaration` in `$.function_definition`
2023-06-09 19:42:43 +07:00
eugene yokota d84b23fda3
Merge pull request #292 from susliko/multi-valvar-definitions 2023-06-09 08:10:17 +07:00
susliko 9d53ab25cb Multi-val/var definitions
Problem
-------
Definitions like the following are not supported:
```scala
val a,b,c: Int = 1
var d,e = ""
```

Solution
-------
Add `$.identifiers` as a choice option along with `$._pattern` to
`$.var_definition`.
Remove `prec(-1)` in `$.identifiers` definitions so that parser wouldn't
on declarations with more than two identifiers.
Resolve a conflict between `$.identifiers` and `$.val_declaration`
2023-06-09 13:09:23 +07:00
Chris Kipp 5fbb3f9871
Merge pull request #294 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-09 11:02:06 +07:00
GitHub 757dbd6977 chore: generate and sync from 359cfcb136 2023-06-09 05:03:42 +07:00
eugene yokota 359cfcb136
Merge pull request #293 from sideeffffect/patch-1
SYNTAX_COMPLEXITY_CEILING=1300
2023-06-08 21:13:45 +07:00
Ondra Pelech d0de6cfeaf
SYNTAX_COMPLEXITY_CEILING=1300 2023-06-09 01:12:24 +07:00
eugene yokota d24467932b
Merge pull request #277 from susliko/rework-lambda-expressions
The Gordian Knot
2023-06-08 10:50:11 +07:00
susliko a889c3c749 Rework lambda expressions
Summary
-------
`$.lambda_expression` body was changed from `$._block` to
`$._indentable_expression`. This had the following effects:
* x10 faster parser generation
* parser size reduced from 41M to 24M
* conflict with `$.self_type`, which was resolved by matching
  indent-tokens in `$.template_body`. This change, in its turn required
  scanner.c to stop emitting INDENT and OUTDENT tokens when encountering
  comments
2023-06-08 17:20:52 +07:00
eugene yokota d24edb6bf2
Merge pull request #288 from eed3si9n/wip/test_c_code
Fix C code fidelity check
2023-06-08 09:43:57 +07:00
Eugene Yokota 5029432a9e Fix C code fidelity check
Problem
-------
There's C code fidelity check in the CI process, but over time it seems
to have broken.
`needs.changedfiles.outputs.c` gets triggered for either `src/scanner.c`
or the generated `src/parser.c`, then the fidelity check logic
expects that `git diff` will be empty.
This actually won't work if you changed both `src/parser.c` and `grammar.js`
at the same time.

Solution
--------
The fix is to make a new `changedfiles.outputs.gen`. Now the new
behavior is:
1. If any C code were changed (including `src/parser.c`), run full tests
   on all 3 Oses.
2. If non-`src/parser.c` C code were changed, run fidelity check on
   Linux.
2023-06-08 09:27:01 +07:00
Chris Kipp 007a1845a4
Merge pull request #290 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-08 07:12:59 +07:00
GitHub 3f6020a1ad chore: generate and sync from cd3a29c9f7 2023-06-08 05:07:00 +07:00
eugene yokota cd3a29c9f7
Merge pull request #285 from eed3si9n/wip/extends 2023-06-07 08:10:50 +07:00
Eugene Yokota cacf8d3668 scalac to 89% 2023-06-07 04:32:32 +07:00
Eugene Yokota 7c13fa896b Optimize complexity 2023-06-07 04:13:46 +07:00
Eugene Yokota 7ca15b8b78 Fix structural type in extends
Problem
-------
Structural type in extends clause fail to parse.

Solution
--------
This adds structural_type to the simple_type.
2023-06-07 02:48:06 +07:00
eugene yokota 97d88301d3
Merge pull request #284 from tree-sitter/generation
chore: generate and sync latest changes
2023-06-07 01:29:14 +07:00
GitHub acae6ddd46 chore: generate and sync from 51377c11e4 2023-06-07 05:08:19 +07:00
eugene yokota 51377c11e4
Merge pull request #278 from eed3si9n/wip/format
Use prettier to format JavaScript file
2023-06-06 11:17:18 +07:00
Eugene Yokota c340535fef Ignore the formatting commit 2023-06-06 11:00:40 +07:00