Commit Graph

32 Commits (361f45bd37b2cf4fd0dfd260444c0977034493f3)

Author SHA1 Message Date
eugene yokota 361f45bd37
Merge pull request #240 from eed3si9n/wip/smoke
Fix smoke test
2023-05-25 19:32:54 +07:00
Eugene Yokota dfc9e46ba5 Fix smoke test
Problem
-------
Unfortunately the smoke test hasn't been accurate.
Apparently it's been looking at only the top directories.

Solution
--------
This should fix it.
2023-05-25 19:22:13 +07:00
susliko 2636cd3469 Set 78% accuracy for dotty compiler codebase smoke test 2023-05-25 18:35:31 +07:00
Ondra Pelech 2eb3becc4e lower ceiling 2023-05-25 01:54:26 +07:00
Ondra Pelech 216b2d7105 better message 2023-05-25 01:45:10 +07:00
Ondra Pelech 426910ed55 smoke_test.sh: attribute the definition complexity to proper line 2023-05-25 01:34:43 +07:00
Ondra Pelech f35b1102e7 Add complexity check to smoke_test.sh 2023-05-25 00:37:52 +07:00
Ondra Pelech 28a0d2121c Shellcheck 2023-05-24 23:58:09 +07:00
susliko 36b4696c0a Smoke test is now 84% for Scala and 71% for Dotty compilers 2023-05-24 19:02:20 +07:00
Eugene Yokota c9f004e38b Smoke test is now 66% for Dotty 2023-05-23 22:08:30 +07:00
Anton Sviridov cb34635bca Abstract type definitions 2023-01-28 08:50:35 +07:00
Anton Sviridov 0ca302070e Up the scala compiler success percentage 2023-01-22 16:18:12 +07:00
Eugene Yokota 944196126a Trailing commas
Problem
-------
Trailing commas are not supported.

Solution
--------
This adds support for that.
2023-01-19 01:39:30 +07:00
Eugene Yokota b5fd12eaab Fixes extends clause
Problem
-------
1. In Scala 3, extends clause can be comma separated.
2. In Scala 2 or 3 extends clause can ctor with parameters:
   `class D with E(x) with F(y)`.

Solution
--------
`extends` is now followed by *constructor applications* separated by
either `with` or `,` as opposed to treating them as a compound type.
2023-01-13 14:40:20 +07:00
Eugene Yokota fe6ff49ee8 Fix operator_identifier
Problem
-------
1. Currently `//` ends up matching `operator_identier`
2. There's also a bug in regex.

Solution
--------
1. Implement a workaround to avoid `//`.
2. Escape `-`, copying from the identifier regex.
2023-01-13 04:04:58 +07:00
Eugene Yokota 77ea27edbe Fixes instance_expression
Problem
-------
Current grammar accepts expression immeidately after `new`,
which is not correct, and doesn't work for Scala 3 syntax.

Solution
--------
This fixes it by actually using `$.template_body`.
It does create a tricky conflict between `new A: <block>`
construct and `new A: <type>`.
To deal with that, we are using `prec.dynamic`.
2023-01-11 19:15:42 +07:00
Anton Sviridov accc6c0132 Output expected % regardless 2023-01-10 10:42:00 +07:00
Eugene Yokota 996b7849eb Fixes for expression
Fixes https://github.com/tree-sitter/tree-sitter-scala/issues/123

Problem
-------
Guard `if something` isn't supported in the for expression.

Solution
--------
This implements it.
2023-01-10 05:18:28 +07:00
Eugene Yokota 57a0e420aa dotty/compiler/: expected 72, but got 71.99 instead 2023-01-10 04:45:01 +07:00
Eugene Yokota 0c6d589a17 Spec-correct identifier
Problem
-------
The `identifier` token is hacked together, so we never quite get the
parsing right.

Solution
--------
My friend Ethan Atkins at some point experimented with generating
tree-sitter grammar out of EBNF (https://github.com/eatkins/tree-sitter-ebnf-generator/tree/master/examples/scala)
and his identifier, as far as I know is spec-correct.
We simplified the regex a bit to fit into the tree-sitter's unsigned
short int count, but it should be comparable.
2023-01-10 04:39:47 +07:00
Eugene Yokota bf4102c863 Include operator-like identifier as simple expression
Problem
-------
Currently operator-like identifiers are not part of the simple
expression, so you can't call `::(123)`.

Solution
--------
This includes `$.operator_identifier` into `_simple_expression`,
and further improves the expression hierarchy.

Note that this removes test on double-prefix-expression.
It's not allowed in Scala spec to have double-prefix.
2023-01-09 18:54:50 +07:00
Anton Sviridov 71e8ac0974 Test and use shadow node
- Bump dotty/scala library percentage
2023-01-09 21:04:58 +07:00
Eugene Yokota 9045975b8d Scala 2 compiler smoke test regressed 2023-01-09 14:36:15 +07:00
Chris Kipp 8770d85333 chore: bump dotty coverage to 60 2023-01-09 10:25:23 +07:00
Anton Sviridov 0dd7134e44 Dotty is now on 59% 2023-01-09 07:49:12 +07:00
Anton Sviridov fc77eb0c5d See if we can run on Linux now.. 2023-01-09 07:46:55 +07:00
Anton Sviridov 31f172c295 Make smoke_test.sh script better for diffing results 2023-01-09 07:46:55 +07:00
Eugene Yokota efa49c8c73 Improve expression hierarchy
Problem
-------
Currently we use `$.expression` everywhere even though it often
requires much narrower set of expressions.

Solution
--------
Now that we've gained some memory budget, this adds
`_simple_expression`, mirroring the EBNF, and adjusts
`infix_expression` etc to use narrower choice of expression tokens.
With this change, the smoke test for Scala 2 library jumps to 95%.
2023-01-08 23:24:35 +07:00
Eugene Yokota ea144d8c84 Givens instance
This implements support for givens instances.
2023-01-08 02:43:13 +07:00
Eugene Yokota 117ef96a09 1% regression in Scala 2 compiler parsing 2023-01-08 00:31:10 +07:00
Eugene Yokota dfd7e41cbe Fix grep to detect C changes
Problem
-------
My grep has a bug, so *.sh file changes are detected as C change.

Solution
--------
1. Add backslash before dot.
2. Bump up the expected Dotty score.
2023-01-07 10:08:52 +07:00
Eugene Yokota 1f325efc31 Smoke test
This adds real-world integration test using scala/scala and Dotty
compiler code base.
The expected parse success% is currently hardcoded, but at least
we'll catch if this number degrades.
2023-01-06 10:16:51 +07:00