From 4289c5c6e8ec5665475b153333e30758917d1a75 Mon Sep 17 00:00:00 2001 From: Steve Dunham Date: Thu, 19 Dec 2024 16:36:59 -0800 Subject: [PATCH] negative integers --- TODO.md | 2 +- src/Lib/Tokenizer.idr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 5bc8985..b3d99f5 100644 --- a/TODO.md +++ b/TODO.md @@ -18,7 +18,7 @@ More comments in code! This is getting big enough that I need to re-find my bear - need to flag internal functions to not search (or flag functions for search). I need to decide on syntax for this. - for something like an `isEq` field in `Ord`, auto-search is picking up the function being defined. - [ ] default implementations (use them if nothing is defined, where do we store them?) e.g. Ord compare, <, etc in Idris -- [ ] syntax for negative integers +- [x] syntax for negative integers - [ ] White box tests in `test` directory - [x] Put worker in iframe on safari - [ ] Warnings or errors for missing definitions diff --git a/src/Lib/Tokenizer.idr b/src/Lib/Tokenizer.idr index 33e8f61..eb4c5e5 100644 --- a/src/Lib/Tokenizer.idr +++ b/src/Lib/Tokenizer.idr @@ -90,7 +90,7 @@ rawTokens -- TODO Drop MixFix token type when we support if_then_else_ <|> match (exact "_,_" <|> exact "_._") (Tok MixFix) -- REVIEW - expect non-alpha after? - <|> match (some digit) (Tok Number) + <|> match (opt (exact "-") <+> some digit) (Tok Number) -- for module names and maybe type constructors <|> match (charLit) (Tok Character . unquoteChar) <|> match (is '#' <+> many alpha) (Tok Pragma)