110 Commits

Author SHA1 Message Date
Matthew Gamble
d60d534014
Various bits of cleanup suggested by clippy
It would be good to incorporate clippy into the CI pipeline once it's up
and running.
2021-07-06 23:30:49 +10:00
Matthew Gamble
7895d70268
Add initial set of tests for the lexer 2021-07-03 12:11:26 +10:00
Kasper
87c10619b5 Add help menu 2021-07-03 02:51:03 +02:00
Kasper
cedc70af3a Add --version flag 2021-07-03 02:09:28 +02:00
Kasper
ef4738061e Freak out instead of ignoring unexpected arguments 2021-07-03 01:55:10 +02:00
Kasper
9bf7c69c03
Merge pull request #11 from djmattyg007/use_stderr
Print 'no argument supplied' message on STDERR
2021-07-03 01:31:37 +02: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
Matthew Gamble
c545468b90
Print 'no argument supplied' message on STDERR 2021-07-03 09:07:25 +10:00
Kasper
e4fc479091 Fix numbers unnecessarily displayed in E notation 2021-06-10 21:36:14 +02:00
Kasper
1abe436f52 Remove TokenVector type 2021-04-21 21:57:02 +02:00
Kasper
c7ee968e6c Allow --verbose in front of input 2021-04-21 21:11:05 +02:00
Kasper
ca273773ef Rename --debug to --verbose and -v 2021-04-21 21:10:06 +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
Kasper
b9a1e13146 Fix incorrect parsing of named numbers Duodecillion and greater
Named numbers `Duodecillion` and greater had an extra zero in them
2021-02-08 02:29:07 +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
bf30ffa00b Fixed dividing a unit by NoUnit resulting in NoUnit 2020-11-26 00:10:04 +01:00
Kasper
269d3cc70f Added support for Power * Time and Energy / Time 2020-11-22 01:52:32 +01:00
Kasper
850e2cede5 Multiplication and division support for electric units 2020-11-22 00:28:12 +01:00
Kasper
3a0518e82d Made multiply function more DRY 2020-11-21 20:46:55 +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
34de6af711 Improved parsing of foot-inch syntax
- Added support using foot-inch syntax with addition, like `2"+6'4"`
- Unsupported foot-inch syntax like `(6)'4"` and `6'4!"` now cause errors
2020-11-13 20:42:49 +01:00
Kasper
8378364dff Added tests for units of frequency 2020-11-13 18:18:25 +01:00
Kasper
802ad3d88f Added units of frequency 2020-11-13 18:13:56 +01:00
Kasper
5f85d32f65 v1.0.2 2020-10-12 20:45:48 +02: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
9cbf5cbb83 Fixed error in main example usage 2020-08-20 22:10:07 +02:00
Kasper
a5aa85c1c0 Documented most things, small code improvements 2020-08-20 21:59:44 +02: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
04e61cafd7 Now using lib.rs to fix "this crate is not a library" issue
Instead of just having main.rs, we now have lib.rs and then main.rs is just the CLI part
2020-08-20 14:23:54 +02:00
Kasper
ba2c1ce84e Added cli/api installation and usage to readme 2020-08-20 10:29:57 +02:00
Kasper
5830904a45 Added --debug flag, eval returns Result 2020-08-20 06:49:10 +02:00
Kasper
f082939d5a Multiplication and division with speed and time ( 1km/2s*5s ) 2020-01-18 21:11:11 +01:00
Kasper
025b1b9169 Pow with units 2020-01-18 20:33:57 +01:00