erlang: integer literals truncate to strict int (was float; broke integer->char)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 30s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 30s
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"language": "erlang",
|
"language": "erlang",
|
||||||
"total_pass": 759,
|
"total_pass": 761,
|
||||||
"total": 759,
|
"total": 761,
|
||||||
"suites": [
|
"suites": [
|
||||||
{"name":"tokenize","pass":62,"total":62,"status":"ok"},
|
{"name":"tokenize","pass":62,"total":62,"status":"ok"},
|
||||||
{"name":"parse","pass":52,"total":52,"status":"ok"},
|
{"name":"parse","pass":52,"total":52,"status":"ok"},
|
||||||
{"name":"eval","pass":406,"total":406,"status":"ok"},
|
{"name":"eval","pass":408,"total":408,"status":"ok"},
|
||||||
{"name":"runtime","pass":93,"total":93,"status":"ok"},
|
{"name":"runtime","pass":93,"total":93,"status":"ok"},
|
||||||
{"name":"ring","pass":4,"total":4,"status":"ok"},
|
{"name":"ring","pass":4,"total":4,"status":"ok"},
|
||||||
{"name":"ping-pong","pass":4,"total":4,"status":"ok"},
|
{"name":"ping-pong","pass":4,"total":4,"status":"ok"},
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Erlang-on-SX Scoreboard
|
# Erlang-on-SX Scoreboard
|
||||||
|
|
||||||
**Total: 759 / 759 tests passing**
|
**Total: 761 / 761 tests passing**
|
||||||
|
|
||||||
| | Suite | Pass | Total |
|
| | Suite | Pass | Total |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| ✅ | tokenize | 62 | 62 |
|
| ✅ | tokenize | 62 | 62 |
|
||||||
| ✅ | parse | 52 | 52 |
|
| ✅ | parse | 52 | 52 |
|
||||||
| ✅ | eval | 406 | 406 |
|
| ✅ | eval | 408 | 408 |
|
||||||
| ✅ | runtime | 93 | 93 |
|
| ✅ | runtime | 93 | 93 |
|
||||||
| ✅ | ring | 4 | 4 |
|
| ✅ | ring | 4 | 4 |
|
||||||
| ✅ | ping-pong | 4 | 4 |
|
| ✅ | ping-pong | 4 | 4 |
|
||||||
|
|||||||
@@ -107,7 +107,12 @@
|
|||||||
(let
|
(let
|
||||||
((ty (get node :type)))
|
((ty (get node :type)))
|
||||||
(cond
|
(cond
|
||||||
(= ty "integer") (parse-number (get node :value))
|
(= ty "integer")
|
||||||
|
(let ((n (parse-number (get node :value))))
|
||||||
|
(cond
|
||||||
|
(= n nil) (error (str "Erlang: invalid integer literal: "
|
||||||
|
(get node :value)))
|
||||||
|
:else (truncate n)))
|
||||||
(= ty "float") (parse-number (get node :value))
|
(= ty "float") (parse-number (get node :value))
|
||||||
(= ty "atom") (er-mk-atom (get node :value))
|
(= ty "atom") (er-mk-atom (get node :value))
|
||||||
(= ty "string") (get node :value)
|
(= ty "string") (get node :value)
|
||||||
|
|||||||
Reference in New Issue
Block a user