Retoor software development Projects Research SearchXNG
Register Sign In

10 lines
283 B
Plaintext
Raw Normal View History

feat: implement scientific notation parsing for number literals in wren compiler Add support for parsing scientific notation (e.g., 2.55e2, -2.55e-2) in the readNumber function of wren_compiler.c. The implementation handles optional negative exponents, validates that exponent digits follow 'e'/'E', and emits a lex error for unterminated scientific notation. Also adds comprehensive test cases covering valid scientific literals, missing exponents, floating exponents, missing fractional parts, and multiple exponents.
2015-07-10 18:07:48 +02:00
var x = 2.55e2
feat: replace IO class with System class and remove separate IO module - Delete wren_io.c, wren_io.h, and io.wren source files - Remove multi-arity print overloads and IO.read/IO.time methods - Add System class with print, printAll, write, writeAll methods to core.wren - Update all documentation examples and README to use System.print instead of IO.print
2015-09-15 16:46:09 +02:00
System.print(x) // expect: 255
System.print(x + 1) // expect: 256
System.print(x == 255) // expect: true
System.print(2.55e-2 is Num) // expect: true
System.print(x is Num) // expect: true
System.print(-2.55e2) // expect: -255
System.print(-25500e-2) // expect: -255
Reference in New Issue Copy Permalink
aef30ca4a1
wren/test/language/number/scientific_literals.wren
Response time: 140ms
Mail Licenses API