diff --git a/data/AST.hs b/data/AST.hs index 68d9ea8..69c163e 100644 --- a/data/AST.hs +++ b/data/AST.hs @@ -72,6 +72,7 @@ data NameSource = NameUser -- ^ A name from the source program | NameNonce -- ^ A name the compiler generated | NamePredefined -- ^ A magic name without definition (e.g. the Rain timer) + | NameExternal -- ^ A name from an external PRAGMA deriving (Show, Eq, Typeable, Data) -- | The direction of a channel. diff --git a/frontends/ParseOccam.hs b/frontends/ParseOccam.hs index 765232c..1c914bd 100644 --- a/frontends/ParseOccam.hs +++ b/frontends/ParseOccam.hs @@ -1439,7 +1439,7 @@ pragma = do m <- getPosition >>* sourcePosToMeta modify $ \st -> st { csExternals = (A.nameName n, (ext, fs)) : csExternals st } - return $ Just (A.Specification m origN sp, nt, (Just n, A.NamePredefined)) + return $ Just (A.Specification m origN sp, nt, (Just n, A.NameExternal)) ns <- case (prag, mprod) of (Just (_, pragStr), Just prod) -> do let column = metaColumn m + fromMaybe 0 (findIndex (=='\"') rawP)