Permalink
Browse files

changed checkName, still that function has to be reworked

  • Loading branch information...
Sebastian Niller
Sebastian Niller committed Apr 1, 2011
1 parent 67a454b commit 5e3a30a93a745611c9993a68c864c91592b2498f
Showing with 3 additions and 4 deletions.
  1. +3 −4 Language/Atom/Elaboration.hs
@@ -367,12 +367,11 @@ addName name = do
put (st, (g, atom { atomNames = name : atomNames atom }))
return $ atomName atom ++ "." ++ name
--- still accepts some misformed names
+-- still accepts some misformed names, like "_.." or "_]["
checkName :: Name -> Atom ()
checkName name =
- if (\ x -> isAlpha x || x == '_') (head name) &&
- and (map (\ x -> isAlphaNum x || x `elem` "._-[]") (tail name)) &&
- and (map isAscii name)
+ if (\ x -> isAlpha x || x == '_') (head name) &&
+ and (map (\ x -> isAlphaNum x || x `elem` "._[]") (tail name))
then return ()
else error $ "ERROR: Name \"" ++ name ++ "\" is not a valid identifier."

0 comments on commit 5e3a30a

Please sign in to comment.