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

ayazhafiz / hgb / 487
95%

Build:
DEFAULT BRANCH: master
Ran 04 May 2020 08:28PM UTC
Jobs 1
Files 7
Run time 3s
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
487

push

travis-ci-com

ayazhafiz
Parse while loops

While adding this feature, I realized we have a problem in some of the
ways we parse expressions. Most expressions (e.g. binary operators)
return the token stream after the expression when they are finished
parsing, but block expressions stop at their terminating brace and the
returned token stream includes the close brace.

```
while true { doWork() }
      ^^^^              parsed expr
           ^^^^^^^^^^^^ rest of token stream

while if true {true} else {false} { doWork() }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^              parsed expr
                                ^^^^^^^^^^^^^^ rest of token stream

Also fails with parened expressions:
while (if true {true} else {false}) { doWork() }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^              parsed expr
                                  ^^^^^^^^^^^^^^ rest of token stream
```

This probably isn't a big deal for now, but I think the best way going
forward for consistency would be to parse the closing token with the
expression and require that blocks end with `!` in a statement context.
This could be kinda ugly though, so I'm interested in other ideas.

```
if true {
  doSomething()
} else {
  never()
}!
```

Part of #51

447 of 464 relevant lines covered (96.34%)

0.96 hits per line

Jobs
ID Job ID Ran Files Coverage
1 487.1 04 May 2020 08:28PM UTC 0
96.34
Travis Job 487.1
Source Files on build 487
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #487
  • e37ec7cc on github
  • Prev Build on master (#452)
  • Next Build on master (#492)
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