dyoo / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
250 stars 30 forks source link

Allow #f as a valid source location #99

Closed jpolitz closed 10 years ago

jpolitz commented 11 years ago

The documentation for srclocs says that (or/c #f natural) are appropriate arguments. This commit adds a checker for that contract and changes the checkers on srcloc to use that instead.

http://docs.racket-lang.org/reference/exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._srcloc%29%29

(Noticed because Pyret has a few "dummy" positions with #f locations, which threw a runtime error from Whalesong-compiled Pyret.)