• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ayazhafiz / hgb / 535 / 1
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2020 03:40PM UTC
Files 8
Run time 29s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Aug 2020 03:35PM UTC coverage: 96.161% (+0.09%) from 96.067%
535.1

push

travis-ci-com

ayazhafiz
Transform GB blocks as TS IIFEs

Lukas and I discussed this a bit in #81 and came to the conclusion that
the best way to proceed is to first translate block expressions to
IIFEs. For example,

```
{
  a : int = 1!
  a = a + 1!
  a
}
```

would become the TypeScript code

```ts
(() => {
  let a: number = 1;
  a = a + 1;
  return a;
})();
```

this is the most straightforward translation and will enable trivial
composition to other structures like if statements, etc.

Coming out of this, though, I am more convinced of several things that
should be changed in GB and this project:

1. Blocks should end with `!` to be treated as an expression. So in the
   example above, the GB code should look like `{ ... }!` to be a
   statement. I think this is more consistent with how all the other
   statements are specified.
2. We should add some golden text-generation tests. So create a test
   corpus, with a bunch of .gb text files, and target .ts files that we
   translate code to and verify in our tests. This will make th tests
   prettier and stuff.

Part of #69

526 of 547 relevant lines covered (96.16%)

0.96 hits per line

Source Files on job 535.1
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 396
  • Travis Job 535.1
  • d2f34ca3 on github
  • Prev Job for on master (#526.1)
  • Next Job for on master (#544.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc