orangeduck / BuildYourOwnLisp

Learn C and build your own programming language in under 1000 lines of code!
http://www.buildyourownlisp.com/
Other
2.93k stars 396 forks source link

Change the grammar to recognize decimal numbers such as 0.01, 5.21, or 10.2. #122

Closed datomnurdin closed 7 years ago

datomnurdin commented 7 years ago

I already set regular expression for number, the compiler can receive decimal number but the output not in decimal format.

/-?[0-9]+(\\.[0-9]*)?/

Please advice. Thank you.

orangeduck commented 7 years ago

Please see previous issues: https://github.com/orangeduck/BuildYourOwnLisp/issues/110

datomnurdin commented 7 years ago

I'm using this guideline (https://github.com/ethan-thames/ploi-lang/blob/master/ploi.c), thanks!