Skip to content

Commit

Permalink
feat: intermediate type computer (#600)
Browse files Browse the repository at this point in the history
Closes partially #541.

### Summary of Changes

Port almost the entire functionality of the Xtext type computer to
Langium. Only the following tasks are still missing for feature parity,
but they require work in other areas of the language first:

* Elvis operator with nullable left side (**needs type checker**)
* Parameters of block lambdas passed as arguments (**needs scoping**)
* Parameters of expression lambdas passed as arguments (**needs
scoping**)
  • Loading branch information
lars-reimann committed Oct 5, 2023
1 parent 6ae387a commit 8d68a42
Show file tree
Hide file tree
Showing 106 changed files with 1,924 additions and 913 deletions.
6 changes: 3 additions & 3 deletions src/language/formatting/safe-ds-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class SafeDsFormatter extends AbstractFormatter {
const formatter = this.getNodeFormatter(node);

if (annotationCallsOrEmpty(node).length > 0) {
if (node.static) {
if (node.isStatic) {
formatter.keyword('static').prepend(newLine());
} else {
formatter.keyword('attr').prepend(newLine());
Expand Down Expand Up @@ -421,7 +421,7 @@ export class SafeDsFormatter extends AbstractFormatter {
const formatter = this.getNodeFormatter(node);

if (annotationCallsOrEmpty(node).length > 0) {
if (node.static) {
if (node.isStatic) {
formatter.keyword('static').prepend(newLine());
} else {
formatter.keyword('fun').prepend(newLine());
Expand Down Expand Up @@ -550,7 +550,7 @@ export class SafeDsFormatter extends AbstractFormatter {
const formatter = this.getNodeFormatter(node);

if (annotationCallsOrEmpty(node).length === 0) {
if (node.variadic) {
if (node.isVariadic) {
formatter.property('name').prepend(oneSpace());
}
} else {
Expand Down
Loading

0 comments on commit 8d68a42

Please sign in to comment.