Skip to content

Commit 5df3ef1

Browse files
authored
Merge pull request #1426 from herbie-fp/autofix-54-1
Automated Resyntax fixes
2 parents 621c69a + 86bd513 commit 5df3ef1

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

infra/convert-json.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
(let loop ([expr expr])
88
(match* (pre-fpcore? expr)
99
[(_ (? string?))
10-
(or (string->number expr) (error 'fix-expr "string that is not a num: ~a" expr))]
10+
(or (string->number expr) (raise-arguments-error 'fix-expr
11+
"string that is not a num"
12+
"expr"
13+
expr))]
1114
[(#t (list 'expt (app loop a) (app loop b))) (list 'pow a b)]
1215
[(#t (list 'cube (app loop a))) (list 'pow a 3)]
1316
[(#t (list 'cot (app loop a))) (list '/ 1 (list 'tan a))]

src/syntax/platform.rkt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
(define reprs (platform-representations platform))
257257
(define repr-costs (platform-representation-costs platform))
258258

259-
(printf "Representations:\n")
259+
(displayln "Representations:")
260260
(define reprs-data
261261
(for/list ([repr (in-hash-values reprs)]
262262
[n (in-naturals)])
@@ -265,7 +265,7 @@
265265
(list n name type total-bits cost)))
266266
(write-table reprs-data (list "idx" "name" "type" "#bits" "cost"))
267267

268-
(printf "\nImplementations\n")
268+
(displayln "\nImplementations")
269269
(define impls-data
270270
(for/list ([impl (in-hash-values impls)]
271271
[n (in-naturals)])
@@ -298,15 +298,15 @@
298298
(printf "~a" (~a (list-ref headers 0) #:width (vector-ref cell-widths 0)))
299299
(for ([i (in-range 1 row-length)])
300300
(printf "|~a" (~a (list-ref headers i) #:width (vector-ref cell-widths i))))
301-
(printf "\n")
301+
(newline)
302302
(printf "~a" (~a "" #:width (vector-ref cell-widths 0) #:right-pad-string "-"))
303303
(for ([i (in-range 1 row-length)])
304304
(printf "+~a" (~a "" #:width (vector-ref cell-widths i) #:right-pad-string "-")))
305-
(printf "\n")
305+
(newline)
306306

307307
; Content
308308
(for ([row data])
309309
(printf "~a" (~a (list-ref row 0) #:width (vector-ref cell-widths 0)))
310310
(for ([i (in-range 1 row-length)])
311311
(printf "|~a" (~a (list-ref row i) #:width (vector-ref cell-widths i))))
312-
(printf "\n")))
312+
(newline)))

src/syntax/syntax.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@
4242
(define/contract (operator-info op field)
4343
(-> symbol? (or/c 'itype 'otype) any/c)
4444
(define info
45-
(hash-ref rival-functions op (lambda () (error 'operator-info "Unknown operator ~a" op))))
45+
(hash-ref rival-functions op (lambda () (raise-arguments-error 'operator-info
46+
"Unknown operator"
47+
"op"
48+
op))))
4649
(match-define (cons otype itypes) info)
4750
(case field
4851
[(itype) itypes]

0 commit comments

Comments
 (0)