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

ayazhafiz / hgb / 535
95%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2020 03:40PM UTC
Jobs 1
Files 8
Run time 1min
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

pending completion
535

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

Jobs
ID Job ID Ran Files Coverage
1 535.1 14 Aug 2020 03:40PM UTC 0
96.16
Travis Job 535.1
Source Files on build 535
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #535
  • d2f34ca3 on github
  • Prev Build on master (#526)
  • Next Build on master (#544)
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