Commit graph

341 commits

Author SHA1 Message Date
30a876a3f9 [types] Add test for multiplying Fracs 2018-09-07 17:54:24 -07:00
d5e6913197 [types] Fix up tests for Frac type 2018-09-07 17:50:02 -07:00
5aca4cfbe4 [types] Implement Add for Frac 2018-09-07 08:48:46 -07:00
a5ed11ea77 [types] More operations on Ints and some tests for Frac
Implement Div on Int
Make sure Fracs are reduced when they are produced, plus some error handling if you create a x/0 Frac
2018-09-07 08:30:13 -07:00
1aabce4f60 [types] Add GCD and LCM to Int; implement Rem on Int 2018-09-07 08:14:33 -07:00
45bc366a41 [types] Add Frac type 2018-09-07 06:59:13 -07:00
34d612a832 [lexer] Add state for finding Dots at the beginning of input
This happens to be a valid token by itself and the beginning of a decimal number.
2018-09-06 18:07:40 -07:00
15e275513d [lexer] Pass Builders around by reference instead of implicitly Copying 2018-09-06 17:21:30 -07:00
9365e51893 [lexer] Correctly set line/offset for emitted Lexes 2018-09-05 22:18:27 -07:00
8b96eb190c [lexer] Continue on to Digit state after lexing Prefix characters 2018-09-05 22:17:18 -07:00
c8de135d2f [lexer] Update failing integer lexing test after fixing #12 2018-09-05 17:36:29 -07:00
e139cf0c6b [lexer] Lex and discard whitespace
Closes #12.
2018-09-04 20:09:47 -07:00
0bdfc24abd [lexer] Simply some Option logic 2018-09-03 19:24:06 -07:00
569fe82c1a [lexer] Identify delimiters and emit numbers 2018-09-03 17:20:27 -07:00
853312ce67 [lexer] We can lex integers! 2018-09-03 17:17:49 -07:00
d272b211ae [lexer] WIP number::Digit state 2018-09-03 17:08:07 -07:00
176686b3a7 [lexer] Let states handle their own creation in from_char 2018-09-03 16:06:52 -07:00
eabc8f98e8 [lexer] Add number::Sign state 2018-09-03 15:49:13 -07:00
663ae3a9f1 [lexer] move char::is_hash() to chars::Lexable 2018-09-03 15:48:48 -07:00
dc8f5a7686 [lexer] Replace String error messages with Error type 2018-09-03 15:30:48 -07:00
def35966eb [lexer] Re-kajigger the states for numbers 2018-09-03 15:19:28 -07:00
b759ee4c57 [lexer] Add Error::invalid_char constructor 2018-09-03 15:18:15 -07:00
469929fb8f [lexer] Make a states::number module
There will be several number-specific states.
2018-09-03 14:05:57 -07:00
14ea07e441 [lexer] Move Bool state to its own file 2018-09-03 12:27:09 -07:00
e339b519de Abort trying to do complex numbers in the DOT graph for now 2018-09-03 12:26:01 -07:00
92df0d9cfd [lexer] Attempt to add complex numbers to the DOT graph -- this is dumb 2018-09-03 11:46:45 -07:00
fb77e7e203 [lexer] Add fractionals and prefix fixes
- Add states to handle fractionals. Easy.
- Add states to properly handle the prefixes. You can have #i#x and #x#i. It
  should now reflect that...
2018-09-03 11:10:29 -07:00
0b5fb57ba9 [lexer] Ignore lexer DOT .pdf output 2018-09-03 10:44:23 -07:00
4341268d0d [lexer] DOT graph of lexer states: numbers, bools, and parens so far 2018-09-03 10:43:41 -07:00
ebee8c8646 [lexer] Add Num token type, which only takes ints for now... 2018-09-02 17:24:07 -07:00
0f18569292 [lexer] Add (failing) test for integers 2018-09-02 17:23:48 -07:00
04f2eb0937 [lexer] Remove empty Lexer impl 2018-09-02 17:23:32 -07:00
757f943fff [lexer] Oops forgot a return type on Hash::new() 2018-09-02 14:05:56 -07:00
7a6c2b91d1 [lexer] Bit of code cleanup in Lexer 2018-09-02 14:05:35 -07:00
f35fe5fd08 [lexer] Implement Hash::new() 2018-09-02 13:50:33 -07:00
aa4de7d4bd [lexer] Laying groundwork for lexing numbers... 2018-09-01 22:25:40 -07:00
7b6259977f [lexer] Add fail() constructor to StateResult 2018-09-01 22:21:21 -07:00
d69c3dbc31 [lexer] Obey Rust book recommendation about order of leading lines 2018-09-01 22:21:05 -07:00
0ed4aa3ae5 [types] Implement Add and Mul on Int 2018-09-01 20:00:09 -07:00
1dfc6823f0 Merge branch 'port-numbers' 2018-09-01 12:22:46 -07:00
68eec8578c [types] Passing integer tests and build fixes 2018-09-01 12:21:13 -07:00
3bdf14720c [types] Expand the documentation of Numbers 2018-09-01 12:03:26 -07:00
9801113c01 [types] Move exactness flag to is_exact() method on Number 2018-09-01 11:58:25 -07:00
f18b6a5719 [types] Simplify explicit lifetimes for Int::eq(Obj) 2018-09-01 11:52:49 -07:00
576b81e52c [types] OMG SO MUCH LIFETIME NONSENSE 2018-09-01 08:33:45 -07:00
1e12508348 [types] Number trait, Int type (which does not work), and some API improvements for Objects 2018-08-31 19:15:12 -07:00
683e2504b9 WIP 2018-08-31 19:10:54 -07:00
e61dc0b6a4 [lexer] Add failing test for issue #12 2018-08-27 06:56:48 -07:00
c14c939ad3 [parser] ListParser can handle lists of more than 2 elements 😮
As ListParser sees items within its list, it assembles a vector of Pairs. When
the parser encounters ')', it assembles the pairs into an actual linked list and
returns the root Pair.

This work also revealed that I was asserting incorrectly in my single_pair test.
It should return Null instead of an empty Pair. Neat.

Closes #17.
2018-08-26 22:24:17 -07:00
c02706e36f [parser] Add failing test for #17 2018-08-26 18:23:40 -07:00