fixed compilation error(s)

This commit is contained in:
Pagwin 2025-12-30 21:07:17 -05:00
parent 4894bf8ff7
commit 83d99c84af
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -291,25 +291,25 @@ literal =
char '`' char '`'
contents <- many template_char contents <- many template_char
char '`' char '`'
pure $ NoSub $ mconcat contents pure $ NoSub $ fromText $ mconcat $ map toText $ contents
head_temp_frag :: Parser s m (TemplateFragment s)
head_temp_frag = do head_temp_frag = do
char '`' char '`'
contents <- many template_char contents <- many template_char
string "${" string "${"
pure $ TemplateHead contents pure $ TemplateHead $ fromText $ mconcat $ map toText $ contents
mid_temp_frag = do mid_temp_frag = do
char '}' char '}'
contents <- many template_char contents <- many template_char
string "${" string "${"
pure $ TemplateMiddle contents pure $ TemplateMiddle $ fromText $ mconcat $ map toText $ contents
tail_temp_frag = do tail_temp_frag = do
char '}' char '}'
contents <- many template_char contents <- many template_char
char '`' char '`'
pure $ TemplateTail contents pure $ TemplateTail $ fromText $ mconcat $ map toText $ contents
template_char :: Parser s m [Char] template_char :: Parser s m s
-- TODO: I fucked something up here 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 = choice [try (string "$" <* (notFollowedBy $ char '{')), try (char '\\' *> ((try template_escape_seq) <|> not_escape_seq)), try ((optional $ char '\\') *> eol), source_char]
source_char = error "TODO" source_char = error "TODO"
template_escape_seq = error "TODO: TemplateEscapeSequence, prepend backslash" template_escape_seq = error "TODO: TemplateEscapeSequence, prepend backslash"
not_escape_seq = error "TODO: NotEscapeSequence, prepend backslash" not_escape_seq = error "TODO: NotEscapeSequence, prepend backslash"