effekt-lang / effekt-lang/effekt

Separators of operations are parsed inconsistently

Open
#595 2 comments 0 reactions 0 assignees View on GitHub
area:parser/lexer requires-design
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

The following program using a space to separate two operations (both in their definition and implementation) is currently syntactically valid:
```scala
interface Foo { def foo(): Int def bar(): Int }
def main() =
try { do foo() + do bar() }
with Foo { def foo() = resume(42) def bar() = resume(100) }
```

Proof
Screenshot 2024-09-17 at 17 38 42

Inserting semicolons in order to separate the two operations is **not** allowed: neither in their definition, nor in their implementation.

---

In contrast, if you write:
```scala
type Quux { Bar() Baz() }
```
then you actually **must** insert a semicolon or a newline to get a successful parse.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.