Compare commits

..

2 commits

Author SHA1 Message Date
Pagwin
1f89316fdf
trying to do more for js parser 2026-01-01 17:03:46 -05:00
Pagwin
2d2d0c0969
TODO update 2026-01-01 17:03:22 -05:00
3 changed files with 7 additions and 3 deletions

View file

@ -4,6 +4,7 @@
- JS
- Doing our own tokenizer lol
- [ ] swap from using `draft` to using `date` for determing draft status, lack of date = draft
- [ ] Fix timestamp(s) shown to use local offset instead of absolute time https://www.rfc-editor.org/rfc/rfc3339#section-4.2
- [ ] setup fingerprinting in file names for css and js
- setup lambdas via: https://hackage-content.haskell.org/package/mustache-2.4.3.1/docs/Text-Mustache.html#v:overText
- This may require a refactor of how we handle templates to use `object` instead of just using aeson integration from the mustache crate
@ -18,6 +19,7 @@
- https://crates.io/crates/tree-sitter-highlight
- Or potentially https://docs.rs/arborium/latest/arborium/
- Alternatively consider skylighting https://hackage.haskell.org/package/skylighting
- [ ] setup font subsetting (font file minimization)
- [ ] dev server setup (with live reloading)
- https://hackage-content.haskell.org/package/warp-3.4.10
- https://hackage.haskell.org/package/file-embed

View file

@ -12,7 +12,7 @@ import Control.Applicative (Alternative (many), optional, (<|>))
import Control.Monad.Trans.Class (MonadTrans (lift))
import Control.Monad.Trans.State (StateT, evalStateT, put)
import Data.Data (Proxy (Proxy))
import Data.Functor ((<&>))
import Data.Functor (void, (<&>))
import Data.Maybe (maybeToList)
import Data.String (IsString (fromString))
import Data.Void (Void)
@ -20,7 +20,7 @@ import Logger
import Text.Megaparsec (MonadParsec (notFollowedBy, try), ParseErrorBundle, ParsecT, Stream (tokensToChunk), anySingle, choice, parse, runParserT)
import qualified Text.Megaparsec as MP
import Text.Megaparsec.Char (char, digitChar, eol, hspace, letterChar, newline, string)
import Utilities.Parsing (Characters, ToText (fromText, toString, toText))
import Utilities.Parsing (Characters, ToChar (fromChar), ToText (fromText, toString, toText))
data Possibility = ExprAllowed | ExprNotAllowed deriving (Eq)
@ -375,7 +375,7 @@ literal =
char '`'
pure $ TemplateTail $ fromText $ mconcat $ map toText $ contents
template_char :: Parser s m s
template_char = fromText . toText <$> choice [try (string "$" <* (notFollowedBy $ char '{')), try (char '\\' *> ((try template_escape_seq) <|> not_escape_seq)), try ((optional $ char '\\') *> (eol)), source_char]
template_char = fromText . toText <$> choice [try (string "$" <* (notFollowedBy $ char '{')), try (char '\\' *> ((try template_escape_seq) <|> not_escape_seq)), try ((optional $ char '\\') *> (eol)), (notFollowedBy (choice $ linebreak : (map (fromChar <$> char) "`\\$"))) *> source_char]
source_char = error "TODO"
template_escape_seq = error "TODO: TemplateEscapeSequence, prepend backslash"
not_escape_seq = error "TODO: NotEscapeSequence, prepend backslash"

View file

@ -19,9 +19,11 @@ class ToText t where
class ToChar c where
toChar :: c -> Char
fromChar :: Char -> c
instance ToChar Char where
toChar = id
fromChar = id
instance Characters Text