Permalink
Browse files

work on doc

  • Loading branch information...
1 parent 50b2692 commit 40ae7d52904902aa9a8c36611aba483deeebbcfb @atzedijkstra atzedijkstra committed Sep 12, 2012
Showing with 34 additions and 8 deletions.
  1. +0 −1 EHC/LICENSE
  2. +8 −0 EHC/src/text2text/Common.hs
  3. +12 −2 EHC/src/text2text/Text/To/DocLaTeX.ag
  4. +13 −4 EHC/text/ToolDocEHC.cltex
  5. +1 −1 EHC/text/mainsty.clsty
View
@@ -7,7 +7,6 @@ template can be found here:
http://www.opensource.org/licenses/bsd-license.php
UHC uses the following libraries with their own license:
-- Boehm Garbage Collector (BGC) library, see extlibs/bgc
- Library code from the GHC distribution, see comment in the modules in ehclib
License text
@@ -11,8 +11,10 @@ module Common
, Err(..)
, OutDoc, emptyout
+ , outnl
, Out(..)
, (+++), outList, outListSep
+ , outPack
, outToString
, putOut, putOutLn
@@ -111,6 +113,9 @@ type OutDoc = Seq.Seq String
emptyout :: OutDoc
emptyout = Seq.empty
+outnl :: OutDoc
+outnl = out "\n"
+
class Out a where
out :: a -> OutDoc
@@ -138,6 +143,9 @@ outList = Seq.unions . map out
outListSep :: (Out s, Out c, Out o, Out a) => o -> c -> s -> [a] -> OutDoc
outListSep o c s outs = o +++ outList (intersperse (out s) (map out outs)) +++ c
+outPack :: (Out c, Out o, Out a) => o -> c -> a -> OutDoc
+outPack o c x = outListSep o c "" [x]
+
hPutOut :: Handle -> OutDoc -> IO ()
hPutOut h ou = hPutStr h (outToString ou)
@@ -50,7 +50,7 @@ dltxCmd :: Out c => c -> OutDoc
dltxCmd c = "\\" +++ c
dltxArg :: Out a => a -> OutDoc
-dltxArg a = "{" +++ a +++ "}"
+dltxArg = outPack "{" "}"
dltxArgs :: [OutDoc] -> OutDoc
dltxArgs a = outList $ map dltxArg a
@@ -101,7 +101,7 @@ SEM TextItem
| HorRuler TableHorRuler
loc . out = dltxCmd "hline"
| Header loc . out = @level.out +++ dltxArg @text.out
- | Group loc . out = dltxBeginEnd @envtype.out @text.out
+ | Group loc . out = @envtype.outWrap $ dltxBeginEnd @envtype.out @text.out
| DocumentContent loc . out = dltxBeginEnd "document" @text.out
| Table loc . out = dltxBeginEnd "center"
$ dltxBeginEnd "tabular"
@@ -179,6 +179,16 @@ SEM TableField
| Fld lhs . out = @extraseptext.out +++ @fld.out
-------------------------------------------------------------------------
+-- Additional wrapping as OutDoc -> OutDoc
+-------------------------------------------------------------------------
+
+ATTR GroupType [ | | outWrap: {OutDoc -> OutDoc} ]
+
+SEM GroupType
+ | Verbatim lhs . outWrap = id -- \x -> dltxArg (dltxCmd "tiny" +++ outnl +++ x +++ outnl)
+ | * - Verbatim lhs . outWrap = id
+
+-------------------------------------------------------------------------
-- Replacement, as [OutDoc]
-------------------------------------------------------------------------
View
@@ -1327,10 +1327,18 @@ The subsequent is taken from the \href{http://utrechthaskellcompiler.wordpress.c
For reference, import entities follow the following grammar:
\begin{pre}
-<ent> ::= (<arg> | ident) <post>*
-<arg> ::= '%' <argnr> | '%*' | <string>
-<post> ::= '(' <arg> ')' | '.' ident | '[' <arg> ']'
-<string> ::= '"' char* '"' | "'" char* "'"
+exp ::= '{}' -- Haskell constructor to JS object
+ | (arg | ident) post * -- JS expression
+post ::= '.' ident -- object field
+ | '[' exp ']' -- array indexing
+ | '(' args ')' -- function call
+args ::= epsilon | arg (, arg) * -- possible arguments
+arg ::= '%' ('*' | int) -- all arguments, or a specific one
+ | '"' str '"' -- literal text
+
+ident ::= a valid JavaScript identifier
+int ::= any integer
+str ::= any string
\end{pre}
where @ident@ is a Haskell like lowercase/uppercase identifier, and where parenthesis only may appear at the end.
@@ -1567,6 +1575,7 @@ This is not yet used, except for experimenting with code generation with extra d
\item \verb|0|: per module (default).
\item \verb|1|: link per module GRIN to whole program GRIN, and continue from there (not yet implemented)
\item \verb|2|: link per module Core to whole program COre, and continue from ther; Core precedes GRIN in the compiler pipeline.
+ \end{itemize}
\item \verb|--no-recomp|. Don't check for the necessity to recompile, recompile allways instead.
\item \verb|--no-prelude|. Don't assume the presence of @Prelude@.
\item \verb|--no-hi-check|. Don't use out of date of compiler version w.r.t. to .hi files as a reason to recompile.
View
@@ -748,7 +748,7 @@ Anonymity, blinding things
% pre environment (a verbatim environment based upon the fancyvrb package)
\DefineVerbatimEnvironment{pre}{Verbatim}
- {xleftmargin=0.03\linewidth,fontsize=\small}
+ {xleftmargin=0.03\linewidth,fontsize=\footnotesize}
% reference to label in url style:
% #1: label

0 comments on commit 40ae7d5

Please sign in to comment.