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

abs-lang / abs / 1522 / 3
76%
master: 63%

Build:
Build:
LAST BUILD BRANCH: 2.8.x
DEFAULT BRANCH: master
Ran 28 Jul 2020 02:27PM UTC
Files 9
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

28 Jul 2020 02:23PM UTC coverage: 75.679% (-0.01%) from 75.69%
GO111MODULE=on CONTEXT=abs

push

travis-ci-com

odino
Parsing negative numbers a-la ruby, closes #383 and #382

This bugfix introduces negative numbers into our parser:
before, -10 would be parsed as (minus, number) whereas
right now it's going to be parsed as (number) only.

This fixes a bug with precedences, where `-1.str()`
would be parsed as (-, (1, str)), leading to first
calling the str method on the positive number, then
applying the minus.

Before:

```
⧐  -1.234.str()
ERROR: unknown operator: -STRING
	[1:1]	-1.234.str()

```

After:

```
⧐  -1.234.str()
-1.234
```

If a space is found between the minus and the number,
the old parsing mechanism still applies.

I found inspiration in Ruby, where:

```
$ - 1.to_s()
-@: undefined method `-@' for "1":String

$-1.to_s()
-1

$ -10.3.floor()
-11

$ - 10.3.floor()
-10
```

3622 of 4786 relevant lines covered (75.68%)

86.22 hits per line

Source Files on job 1522.3 (GO111MODULE=on CONTEXT=abs)
  • Tree
  • List 0
  • Changed 9
  • Source Changed 9
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1192
  • Travis Job 1522.3
  • 80a14952 on github
  • Prev Job for GO111MODULE=on CONTEXT=abs on 2.2.x (#1521.2)
  • Next Job for GO111MODULE=on CONTEXT=abs on 2.2.x (#1524.2)
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