86 Commits

Author SHA1 Message Date
Kasper
a86865e856 Fix implicit start/end parentheses 2021-08-16 06:32:40 +02:00
Kasper
d8af50d991
Merge pull request #23 from Pyther99/fix-clippy-lints
Fix clippy lints
2021-08-16 06:15:52 +02:00
Matthew Gamble
45dfe129dc
Add support for data rate units
This permits the following calculations:

10 kilobytes per second * 6 seconds = 60 kilobytes
500 megabytes / 100 megabytes per second = 5 seconds
1 gibibit per second * 1 hour = 3600 gibibits
2021-07-25 10:36:04 +10:00
Pyther99
6b46d69c72 remove usage of matches! macro 2021-07-14 20:55:05 +02:00
Pyther99
07bf7b48e1 Remove cmp comparison 2021-07-14 07:50:20 +02:00
Pyther99
634dff682b more idiomatic syntax 2021-07-13 19:55:42 +02:00
Pyther99
beb1ea7506 improve comparisons 2021-07-13 19:55:29 +02:00
Pyther99
3ee5e00b11 remove return statements 2021-07-13 19:55:04 +02:00
Matthew Gamble
59b20389ba
Further improvements to operator parsing in lexer
- Add support for phrases 'multiplied by' and 'divided by'
- Add support for the division operator symbol ÷
- Fixed lexing of revolutions per minute units
2021-07-07 23:23:16 +10:00
Kasper
99943ecacd Fix Ω lexing 2021-07-07 05:36:57 +02:00
Kasper
f25c88cf0e Remove debug logs 2021-07-06 22:35:03 +02:00
Kasper
c4d1cb1371 Match alphabetic characters directly, make stuff private 2021-07-06 20:25:29 +02:00
Kasper
c3f7166d28 Fix lexing of π with unit afterwards
e.g `πm`
2021-07-06 19:59:20 +02:00
Kasper
10f79dc78f Fix π lexing 2021-07-06 19:49:52 +02:00
Kasper
0c1d2b38c1 Add more tests by @djmattyg007 2021-07-06 19:06:50 +02:00
Kasper
84f604a96e Remove unnecessary lexer recursion 2021-07-06 17:59:54 +02:00
Kasper
1973c7281f Fixed suggested by @djmattyg007 2021-07-06 17:59:07 +02:00
Kasper
e30810c997 Add tests by @djmattyg007 2021-07-06 07:17:43 +02:00
Kasper
c550f279c1 Add operator words plus, minus, times 2021-07-06 07:17:30 +02:00
Kasper
8a7603bc6e Fix watt parsing 2021-07-06 07:07:37 +02:00
Kasper
b435833b98 Fixed pound not lexed at the end of the input 2021-07-06 06:16:43 +02:00
Kasper
c34a21afe1 Re-add PoundForce and NewtonMeter parsing 2021-07-05 17:49:08 +02:00
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