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

ethanpailes / remake / 72
81%

Build:
DEFAULT BRANCH: master
Ran 05 Jul 2018 09:52PM UTC
Jobs 1
Files 8
Run time 2s
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
72

push

travis-ci

ethanpailes
Add support for functions

This patch adds support for first class functions.
Lambda expressions can now be written as `fn(<args>) { <body> }`.
There is sugar for binding a closure to a name with
the `fn <func_name>(<args>) { <body> }` syntax. Functions
support the `return` keyword, and may refer to themselves
recursively.

Supporting Architecture Changes
-------------------------------
In order to determine the free variables of an expression
to generate a closure capture environment, we need some way
to traverse the AST. This patch adds a visitor to make that
easier. The visitor design is mostly just stolen from the
regex-syntax crate's visitors.

Unresolved Issues
-----------------
The work on this patch uncovered a number of issues with the
way that the code currently works. Mostly, these have to do
with the parser.
 - We need to allow statement blocks (that is a block in statement
    position with a body that is a list of statements). I spun
    my wheels trying to get this to fit into the current grammar
    for too long, so this will have to happen in a future patch.
 - We need to allow expression blocks in the branches of an if
    statement. Currently, they just allow expressions. :-(
 - Boolean operators need to be higher precedence than comparison
    operators. `1 == 2 || 1 == 1` should parse in the way you
    expect.

Potential Future Improvements to Functions
------------------------------------------
 - Support mutal recursion. Currently, we allow one function to
    be defined recursivity, but I'm not sure that multiple
    function definitions will work. It is at least worth testing.

4542 of 5507 relevant lines covered (82.48%)

2.29 hits per line

Jobs
ID Job ID Ran Files Coverage
4 72.4 05 Jul 2018 09:52PM UTC 0
82.48
Travis Job 72.4
Source Files on build 72
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #72
  • 05cbf644 on github
  • Prev Build on master (#60)
  • Next Build on master (#75)
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