DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

Generator operators #1248

Closed bbrk24 closed 4 months ago

bbrk24 commented 4 months ago
operator foo (a)
  yield a

Actual output:

function foo(a) {
  return yield a;
}

Expected output:

function* foo(a) {
  return yield a;
}

operator* also doesn't work

Workaround:

operator foo (a)
  (->
    yield a
  )()