Skip to content
Snippets Groups Projects
Commit 03479f0b authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Use permissive classifications in `platformFromTriple`

The `Permissive` classification is for recognising tokens from the
"outside world". `platformFromTriple` is similar to
`buildOS`/`buildArch`.

Specifically, on IBM AIX, the platform triple is usually
"powerpc-ibm-aix", where "powerpc" will only be recognised in
`Permissive` mode.
parent 109cd832
No related branches found
No related tags found
No related merge requests found
......@@ -225,10 +225,10 @@ platformFromTriple triple =
fmap fst (listToMaybe $ Parse.readP_to_S parseTriple triple)
where parseWord = Parse.munch1 (\c -> Char.isAlphaNum c || c == '_')
parseTriple = do
arch <- fmap (classifyArch Strict) parseWord
arch <- fmap (classifyArch Permissive) parseWord
_ <- Parse.char '-'
_ <- parseWord -- Skip vendor
_ <- Parse.char '-'
os <- fmap (classifyOS Compat) ident -- OS may have hyphens, like
os <- fmap (classifyOS Permissive) ident -- OS may have hyphens, like
-- 'nto-qnx'
return $ Platform arch os
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment