Commit Graph

465 Commits (5fa09e983891a7a09bbaacaebfb88de4c5bf6034)
 

Author SHA1 Message Date
eugene yokota 5fa09e9838
Merge pull request #353 from susliko/trait-derives
Derives clause for traits
2023-09-19 01:11:40 +07:00
eugene yokota 80fe560ac4
Merge pull request #355 from tree-sitter/generation
chore: generate and sync latest changes
2023-09-19 01:07:28 +07:00
GitHub ef639d4f35 chore: generate and sync from 045ce59575 2023-09-19 05:03:49 +07:00
eugene yokota 045ce59575
Merge pull request #350 from susliko/fix-parenthesized-expr-in-braceless-if
Fix parenthesized expressions in braceless `if` conditions
2023-09-18 23:13:29 +07:00
eugene yokota c13de90a34
Merge branch 'master' into fix-parenthesized-expr-in-braceless-if 2023-09-18 23:08:48 +07:00
eugene yokota 0692d044bb
Merge pull request #354 from susliko/wildcard-bindings
Wildcards in tuple bindings
2023-09-18 23:04:02 +07:00
susliko 28666b1581 Wildcards in tuple bindings
Fixes #303
Now binding is a choice from identifier and wildcard
2023-09-18 23:18:57 +07:00
susliko 3054b9b596 Derives clause for traits
Fixes #348
`trait_definition` now includes `_class_definition` which is comprised
of extends-clause, derives-clause, and body. This also slightly reduces
parser size (from ~890Kb to ~780Kb)
2023-09-18 22:44:40 +07:00
susliko 5c54434c2a Bump dotty codebase smoke test to 84 2023-09-18 21:59:43 +07:00
susliko f8d3848919 Fix parenthesized expressions in braceless `if` conditions
Fixes #263 and #342
`_if_condition` extracted from `if_expression` and given a magic dynamic
precedence of 4
2023-09-18 21:48:31 +07:00
Chris Kipp 70afdd5632
Merge pull request #343 from tree-sitter/generation
chore: generate and sync latest changes
2023-09-01 08:14:09 +07:00
GitHub 1c82628e7e chore: generate and sync from 57f19d39a5 2023-09-01 06:09:35 +07:00
Chris Kipp 57f19d39a5
Merge pull request #341 from eed3si9n/wip/anonymous_given
Fixes anonymous givens
2023-09-01 08:07:37 +07:00
Eugene Yokota 3c4276437a Reduce the Dotty percentage to 83 2023-08-27 15:40:10 +07:00
Eugene Yokota d72cdd4032 Fixes anonymous givens
Problem
-------
Currently given uses `_function_constructor`, which expects an
identifier.
This doesn't work for anonymous given definition that has function-ish
things like `using` parameters.

Solution
--------
Create a new `_given_constructor` node with an optional name.
2023-08-27 14:47:43 +07:00
Amaan Qureshi d50b6ca5cc
Merge pull request #340 from tree-sitter/scanner-and-generate
Tidy up scanner
2023-08-20 03:15:51 +07:00
Amaan Qureshi dffe55e73c
fix(scanner): compiler warnings, lints, mark helper functions static & refactor word-reading logic 2023-08-17 23:22:01 +07:00
Chris Kipp 3a67773e20
Merge pull request #339 from tree-sitter/generation
chore: generate and sync latest changes
2023-08-17 10:18:44 +07:00
GitHub 8c69db238e chore: generate and sync from 5d1a186079 2023-08-17 05:04:25 +07:00
eugene yokota 5d1a186079
Merge pull request #338 from Masynchin/master
Fix indented case in given
2023-08-16 14:07:26 +07:00
Max Smirnov e76f53d744
Update definitions trees 2023-08-16 07:06:41 +07:00
Max Smirnov 2d6795cb79
Use indentable_expression in given def 2023-08-16 07:00:13 +07:00
Chris Kipp f14629b4d5
Merge pull request #335 from tree-sitter/generation
chore: generate and sync latest changes
2023-08-09 08:33:18 +07:00
GitHub efae10fd13 chore: generate and sync from f086fb0c9c 2023-08-09 06:32:08 +07:00
Chris Kipp f086fb0c9c
Merge pull request #333 from susliko/newline-before-return-type
Allow return types on new lines in definitions
2023-08-09 08:28:24 +07:00
Chris Kipp b20f13367b
Merge pull request #334 from tree-sitter/generation
chore: generate and sync latest changes
2023-08-09 08:27:10 +07:00
GitHub 991180ff2d chore: generate and sync from 46e08442cd 2023-08-09 05:03:48 +07:00
susliko ce7e098a0b Allow return types on new lines in definitions
Resolves #318

Summary
----
Optional trailing `$._automatic_semicolon` in `$._function_cunstructor`.
This enables correct parsing of the code like:
```scala
def foo()
  : Int = 42
given foo(using foo: Foo)
  : Foo = foo
```
2023-08-09 00:42:33 +07:00
Vasil Markoukin 46e08442cd
Allow `$.stable_type_identifier` in `derives_clause` (#331)
Resolves #323

Summary
----
Support for dot-separated type references in derives clause
```scala
case class A() derives B.C
```
2023-08-08 16:38:19 +07:00
Chris Kipp 3f75f6202e
Merge pull request #330 from susliko/given-in-for
feat: `given` pattern
2023-08-08 15:23:55 +07:00
susliko 88501742c3 Bump DOTTY_COMPILER_EXPECTED to 84 2023-08-08 15:57:47 +07:00
susliko c14e2d4aad feat: `given` pattern
Resolves #322

Summary
----
- `given_pattern` now handles cases like:
```scala
for
  given Int <- Some(1)
yield summon[Int]
```
- `corpus/patterns.txt` reformatted with `tree-sitter test -u`
2023-08-07 22:27:27 +07:00
Chris Kipp a2f36c2477
Merge pull request #327 from tree-sitter/generation
chore: generate and sync latest changes
2023-07-24 11:23:04 +07:00
GitHub ac08834b29 chore: generate and sync from 8137adbfba 2023-07-24 08:42:32 +07:00
Chris Kipp 8137adbfba
Merge pull request #325 from eed3si9n/wip/macros
Scala 2 macros
2023-07-24 09:24:30 +07:00
eugene yokota c7b110d664
Merge pull request #326 from tree-sitter/generation
chore: generate and sync latest changes
2023-07-24 02:09:13 +07:00
GitHub ebe8596fa3 chore: generate and sync from 8cdd8bdd7f 2023-07-24 05:04:02 +07:00
Eugene Yokota 7afd059843 Scala 2 macros
Problem
-------
Scala 2 macro definition is not supported.

Solution
--------
This adds macro_body as an expression.
2023-07-23 14:15:57 +07:00
eugene yokota 8cdd8bdd7f
Merge pull request #324 from johannescoetzee/fix/string-interpolation
fix: handle interpolations without spaces and $$ in interpolated strings
2023-07-23 13:09:14 +07:00
Johannes Coetzee 6f9683bbfb Handle quote dollar escape case as well 2023-07-21 10:01:38 +07:00
Johannes Coetzee 9e30051ef7 Alias interpolation_identifier to identifier to avoid query badness 2023-07-20 23:22:12 +07:00
Johannes Coetzee f894d1d0cd Add highlighting test 2023-07-20 18:47:29 +07:00
Johannes Coetzee dda875eae9 Rename interpolation_identifier 2023-07-20 14:42:40 +07:00
Johannes Coetzee f1c0764722 Remove unnecessary highlighting queries 2023-07-20 14:22:48 +07:00
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