diff --git a/make-pages/BuildVar.hs b/make-pages/BuildVar.hs index 042d78e..d0e2052 100644 --- a/make-pages/BuildVar.hs +++ b/make-pages/BuildVar.hs @@ -98,11 +98,13 @@ chunks = reverse . go "" [] . trimEnd where go acc cs (c :. rest) = go (acc <> singleton c) cs rest splitVar s - | (var, s') <- Text.span isAlphaNum s, + | (var, s') <- Text.span isIdChar s, isLower (Text.head var) = (var, s') splitVar _ = error "invalid variable name" + isIdChar c = isAlphaNum c || c `elem` ['_', '\''] + lit s = (Lit, toStrictText s) trimEnd = Text.dropWhileEnd isSpace