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

ayazhafiz / hgb
96%
master: 95%

Build:
Build:
LAST BUILD BRANCH: i/test-dsl
DEFAULT BRANCH: master
Repo Added 29 Nov 2019 11:46PM UTC
Files 7
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

LAST BUILD ON BRANCH i/51-while
branch: i/51-while
CHANGE BRANCH
x
Reset
  • i/51-while
  • 15
  • 15-ah-patch
  • RemoveChar
  • TestAdd
  • codegen.c
  • e/floating-point
  • e/github
  • e/pedantic
  • e/scripts
  • eval
  • extend-parer
  • final_expr
  • i/32
  • i/38-char-type
  • i/38-lex-char
  • i/38-parse-char
  • i/38-string-type
  • i/40
  • i/43
  • i/47
  • i/51-for
  • i/52
  • i/52-bool
  • i/69-ts
  • i/71
  • i/87
  • i/fixup
  • i/grammar-types
  • i/hindent-incr
  • i/lex-symbol
  • i/scripts
  • i/test-dsl
  • i/ts-codegen-validate
  • i/ts-string-char-ref-asgn
  • lexer_change
  • lukas
  • master
  • nomorebits
  • numbertype
  • parse-arrays
  • patch-extend-parser
  • r/return
  • refactor-expectation
  • refactor/lexer
  • reorder
  • scripts
  • simplify_cond
  • static-typing
  • stopwastingtime
  • style
  • test/lexer
  • ts-more
  • ts/calls
  • ts/fn-decl
  • ts/types
  • typecheck
  • underscore

pending completion
463

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

Relevant lines Covered
Build:
Build:
464 RELEVANT LINES 447 COVERED LINES
0.96 HITS PER LINE
Source Files on i/51-while
  • Tree
  • List 7
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
463 i/51-while 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 ex... push 01 May 2020 11:05PM UTC ayazhafiz travis-ci-com pending completion  
See All Builds (450)
  • Repo on GitHub
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

© 2025 Coveralls, Inc