64 Commits

Author SHA1 Message Date
Kasper
eaaee87b2c Fix multi-word parsing, revamp lexer to be recursive 2021-07-05 17:03:17 +02:00
Kasper
31077f669e Fix LightSecond parsing 2021-07-05 15:29:15 +02:00
Kasper
541e38dc65 Attempt at improving multi-word handling (incomplete) 2021-07-05 09:22:21 +02:00
Matthew Gamble
7895d70268
Add initial set of tests for the lexer 2021-07-03 12:11:26 +10:00
Matthew Gamble
2805185317
Add non-US spellings of various "metre"-like words
Also fix a bug where decimeter units were being parsed into centimetres.
2021-07-03 09:09:43 +10:00
Kasper
1abe436f52 Remove TokenVector type 2021-04-21 21:57:02 +02:00
Kasper
6585366b0d Fix panic when input contains only whitespace and/or commas 2021-04-21 21:06:02 +02:00
Kasper
8d70be0967 Fix d128 errors due to d128 error status not being cleared 2021-04-08 01:54:29 +02:00
Kasper
5d08f59083 Fix panic when input is empty string 2021-04-08 00:45:52 +02:00
Kasper
5e72a86ced Make cpc case insensitive 2021-03-15 00:48:06 +01:00
Kasper
1db9598cd2 Switch back to official decimal
Switch back to official `decimal` because https://github.com/alkis/decimal/issues/59 is fixed
2021-03-15 00:45:08 +01:00
joseLuís
1065d024dd fix spelling: Celcius → Celsius 2021-01-14 17:12:11 +01:00
Kasper
72037bfd15 Added unit of mass stone 2020-11-26 18:28:34 +01:00
Kasper
dcc948b5d5 Remove unused LexerKeyword PoundWord 2020-11-26 18:26:55 +01:00
Kasper
6cc278a829 Add keyword pounds-force 2020-11-26 18:23:47 +01:00
Kasper
7826834447 Fixed lexing of pound 2020-11-26 18:22:17 +01:00
Kasper
25d151465e Fix cargo doc links 2020-11-26 02:04:35 +01:00
Kasper
ef97410fe5 Updated decimal dependency to decimal_fixes_mirror
Fixed panics in Rust 1.48.0
2020-11-26 01:24:51 +01:00
Kasper
6553c50d1d Added units of voltage 2020-11-21 02:47:31 +01:00
Kasper
f03850f006 Added more keywords for units of current and resistance 2020-11-21 02:47:03 +01:00
Kasper
50cac79d7a Fixed lexing of "µs" 2020-11-21 02:10:20 +01:00
Kasper
5da0c5e3d7 Added units of resistance (ohm) 2020-11-21 01:22:25 +01:00
Kasper
5371f8d5ac Added units of electric current 2020-11-20 20:19:31 +01:00
Kasper
7284422ec0 Fixed consecutive percentage signs error 2020-11-14 05:00:22 +01:00
Kasper
03b9df2362 Fixed trailing percentage sign being ignored 2020-11-14 04:10:56 +01:00
Kasper
961daae9d5 Added named numbers (hundred, quadrillion etc) 2020-11-14 04:08:27 +01:00
Kasper
802ad3d88f Added units of frequency 2020-11-13 18:13:56 +01:00
Ethan Wu
d24d4af969 Fix bugs caused by typos
- Fix spelling of *quarter* in lexer and assign `Unit::Quarter` correctly
- Use division instead of multiplication when dividing a number by another
  number of the same unit
2020-10-12 00:19:19 -07:00
Kasper
56ea8380b7 Code improvements, added a bunch of doc comments
There are technically no breaking changes because everything was broken in the first place
2020-08-20 17:11:19 +02:00
Kasper
025b1b9169 Pow with units 2020-01-18 20:33:57 +01:00
Kasper
febd5366e8 Turned panics into errors 2020-01-15 17:45:53 +01:00
Kasper
c7141e87ad Added "degree" keyword with option to choose which unit that is 2020-01-14 13:53:06 +01:00
Kasper
22a5faa6be Ignoring operators at the end (with option to disable) 2020-01-14 02:50:10 +01:00
Kasper
adaf4eb4ac Support for writing multidimensional lenghts as km2 etc 2020-01-13 18:13:43 +01:00
Kasper
388825f9ac Lexing of keywords now uses is_ascii_alphabetic instead of is_alphabetic 2020-01-13 15:50:54 +01:00
Kasper
73861a1848 Removed unnecessary chars enumeration from lexer 2020-01-13 15:49:49 +01:00
Kasper
3c53a22cfc Support for 6'4" syntax 2020-01-13 03:35:54 +01:00
Kasper
a0a33d175b Fixed Inch being lexed as InchOfMercury 2020-01-13 01:55:48 +01:00
Kasper
5360318bfc Added unit of pressure, improved lexer "post-fix" loop
Previously the lexer's post-fix loop was really weird, incrementing in the middle of the function. No more
2020-01-12 22:57:49 +01:00
Kasper
02e74806e1 Support for using "in" as To operator (like "5in in cm") 2020-01-12 03:03:26 +01:00
Kasper
efa76e93c5 Lexer ignores commas 2020-01-12 00:07:10 +01:00
Kasper
8a232f72f0 Added newton meter 2020-01-11 04:50:31 +01:00
Kasper
539568c5b5 Added unit of power 2020-01-11 04:46:43 +01:00
Kasper
0758611dfb Added lexing of energy and speed units 2020-01-11 04:31:30 +01:00
Kasper
35043932d5 Fixes/additions for lexing units 2020-01-10 17:45:06 +01:00
Kasper
83fd5c233a Added support for all units in lexer 2020-01-10 17:31:38 +01:00
Kasper
fbbb895c64 Greatly improved parsing of multi-word units 2020-01-09 23:01:31 +01:00
Kasper
93e80e6f76 Removed unnecessary adding of () around input 2020-01-08 19:51:52 +01:00
Kasper
a0014f9afc Added area, volume, mass units 2020-01-08 19:33:51 +01:00
Kasper
26992c9e32 Evaluation of sin, cos, tan 2019-12-28 06:31:50 +01:00