Problem
-------
Given something like
class A:
def a() =
()
def a() = 1
the scanner only outdents once, so it fails to parse the above.
Solution
--------
Track `last_indentation_size` in the payload to indicate last
outdent (default: -1). If it's not -1 that means there was an outdent.
This then checks if the last_indentation_size qualified for another
outdent.
Problem
-------
Currently Scala 3 optional braces syntax does not work.
Specifically, in this PR I want to address decls/defns not
properly grouped under the right owner in part 1.
Solution
--------
1. This brings in indent/outdent impl by keynmol
2. Introduce `_indentable_expression`.
This allows us to limit where indent/outdent shows up without
confusing tree-sitter too much. To start, val/def/var defn
and if-expressions are given indentable expression.
Problem
-------
Currently Scala 3 optional braces syntax does not work.
Solution
--------
This implements initial attempt on dealing with colon
instead of braces.
Note that this does not implement any indent/outdent tracking
so the second `val` onwards will not be added in `template_body`
but it should improve the highlighting a bit.
Fix call expression to allow block as arguments (#21)
Update for comprehension to handle patterns
Fix for comprehension to detect assignment as an enumerator
Add access modifiers
Update trait, object and class parameter to support modifiers
Update scanner to support `with` on a new line
Update function definition/declaration to support operator naming
Update field expression to support operators as methods
Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>
* Fix typo
* Rework literals part of grammar
Introduce hierarchy of literals as it is done in Scala language grammar.
Move existing literal types into hierarcy under `literal` parent.
Add and extend literals for integer and floating point numbers.
Add test cases for integer and floating point numbers in corpus.
Adjust existing test cases to changes.
Also fixes#24
* Apply review comments
Hide `literal` node from appearing in s-expressions and increasing
amount of states.
Update test cases according to grammar change.
* Add automatic changes
Add tree-sitter dependency update by npm.
Add atomatic changes in parser and grammar from building the parser.
* This adds in support for boolean, character, and symbol literals.
Previously we would just handle boolean literals and character literals
as identifiers, and wouldn't handle symbol literals.
* Fix CI
* Add supertypes
* Support multi-line case clauses
* Allow definitions in case clauses, expressions in class/object bodies
* Add annotations, infix patterns, implicit parameters
* Add tree-sitter CLI declaration to package.json
* Add annotations on type parameters
* Add type annotations, type projections; fix compound types
* Fix operator_identifier regexp
* Add tuple types and repeated parameter types
* Give infix_pattern higher precedence than capture_pattern
* Make infix_type nestable
* Allow body-less trait_definition
* Allow omitting parens when function_type's input is a single type
* Put all alternatives function_type's parameters under parameter_types
* Give alternative_pattern lower precedence than typed_pattern
* Remove parenthesized_pattern
* Allow empty body in case_clause
* Regenerate parser