Skip to content

feat(flowc): effect/capability blocks, postfix calls - #441

Merged
godofecht merged 1 commit into
mainfrom
work
Aug 12, 2026
Merged

godofecht merged 1 commit into
mainfrom
work

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

  • effect Name { ... } and capability Name { ... } blocks are now skipped at top level and after export. Uses a new flowc_parser_skip_brace_block helper.
  • Postfix call parsing is added to flowc_parse_postfix. This handles method-style calls like Foo.bar(42) and chained calls.

Context

async.flow uses export effect Async { ... } and export capability SimulatedAsync { ... } for algebraic effect declarations. It also calls effect members like Async.delay(ms), which requires postfix call parsing on field-access expressions.

Test plan

  • ./flow run compiler/src/main.flow passes (flowc: PASS)
  • Three consecutive generation fixed-points pass (byte-identical)
  • lib/stdlib/async.flow parses and emits C (remaining C errors are missing extern declarations for flow_tcp_* functions, not compiler bugs)
  • Foo.bar(42) parses correctly

This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.

Generated with Devin

compiler/src/token.flow: add KW_EFFECT (28) and KW_CAPABILITY (29).
compiler/src/lexer.flow: add "effect" and "capability" keywords.

compiler/src/parser.flow:
- Skip effect Name { ... } and capability Name { ... } blocks at
  top level and after export. Uses new flowc_parser_skip_brace_block
  helper.
- Add call parsing to flowc_parse_postfix. This handles method-style
  calls like Foo.bar(42) and chained calls like obj.method()(args).
  The call name span is copied from the base expression for cgen.

lib/stdlib/async.flow now parses and emits C (previously failed on
export effect blocks and Foo.bar() calls).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@godofecht
godofecht merged commit 66d7f93 into main Aug 12, 2026
12 of 13 checks passed
@godofecht
godofecht deleted the work branch August 12, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant