"qvars"? pragma syntax generally?
Isaac Dupree
isaacdupree at charter.net
Sat Jun 16 14:28:03 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
For INLINE and NOINLINE the report uses "qvars"
http://haskell.org/onlinereport/pragmas.html
which is not defined in http://haskell.org/onlinereport/syntax-iso.html
(although its meaning is obvious since var, qvar and vars are all defined).
Is it permissible for compilers to die on pragma syntax they don't
personally like? For example GHC chokes on {-# INLINE Ma-in.ma-in #-} at
top level, but it would be worse with non-standardized pragmas. (the
compiler giving a warning that it understands a pragma of that name, but
not the syntax given, would be best.) "the pragma should be ignored if
an implementation is not prepared to handle it."
WHAT IS pragma syntax?? The report doesn't say how whitespace is
handled. syntax-iso doesn't mention pragmas; in its opinion everything
from {-# hi-} to {-#{-##-}#-} to {-# INLINE main #-} is a perfectly good
comment. [1] But the report recommends some specific syntaxes. To all
appearances, it is expected that they follow (guessing from other
Haskell syntax) the form
pragma -> {-# pragmaid (some pragma-specific syntax that is
consistent with the whole thing being ncomment) #-}
pragmaid -> (large|_) {large|_|'}
Still... whitespace? GHC understands as a pragma
{-#
LINE 3 "foo.hs" #-}
but not
{-#
{- nested comment -}
LINE 3 "foo.hs" #-}
; I don't even know about inside or next to the (some pragma-specific
syntax). Is the inside of pragmas supposed to be lexed somewhat the
same way as the rest of the Haskell file, or "it can vary" because
pragmas can be anything they want... hopefully the convention of
beginning pragmas with a name cannot vary.
[1] (hmm, maybe pragmas should be used to indicate haddock comments -
too late now, and probably too verbose too)
Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGdCuyHgcxvIWYTTURAnljAJ9NLJKW+CTroJ0Vg43bgGWZ3DXJHwCgp+Z3
SAX/cK5PSV7B4TBfwg664xM=
=81g6
-----END PGP SIGNATURE-----
More information about the Haskell-prime
mailing list