Context Navigation


Changeset 31


Ignore:
Timestamp:
Nov 23, 2007, 3:21:14 PM (18 years ago)
Author:
neil.c.c.brown
Message:

Fixed the syntax highlighting to use keywords (not emph) while still separating the symbols from the keywords. Also simplified the QuickCheck example.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/trunk/200711-tock-seminars/200711-tock-slides.tex

    r30 r31
    6565 % To separate out word keywords from symbol keywords for different formatting,
    6666 % we define the word keywords as emph items (use emphstyle):
    67 {(削除) emph={data,type,newtype,let,do,where,if,then,else,return} (削除ここまで),
    67 {(追記) classoffset=0 (追記ここまで),
    6868 %If we don't specify at least one "non-other" keyword, listings doesn't work, hence:
    6969 morekeywords={hduisahfiuabfyasbyoasvbfuyvosf},
    7070 otherkeywords={::,=,==,->,=>,>>,>>=,,ドル++,<-},
    71(追記) classoffset=1, (追記ここまで)
    72(追記) morekeywords={data,type,newtype,let,do,where,if,then,else,return}, (追記ここまで)
    73(追記) % For some (unknown) reason, setting classoffset = 0 again after this line (追記ここまで)
    74(追記) % breaks the highlighting. (追記ここまで)
    7175 morecomment=[l]{--},
    7276% morestring=[b]',
    8892 columns=flexible,
    8993 basicstyle=\small,
    90 emphstyle=\color{KentBlue}\bfseries,
    91 keywordstyle=\color{KentBlue}\bfseries\ttfamily,
    94 emphstyle=\color{KentRed}\bfseries,
    95 keywordstyle=[1]{\color{KentBlue}\bfseries},
    96 keywordstyle=[0]{\color{KentBlue}\bfseries\ttfamily},
    9297 identifierstyle=,
    9398 commentstyle=\color{KentGreen}\itshape,
    395400\begin{lstlisting}
    396401-- HUnit example:
    402(追記) (追記ここまで)
    397403assertEqual "Test 0"
    398404 "foo_bar"
    401407-- QuickCheck example:
    402408
    403-- Generates a list of random numbers that sums to the given total:
    404randList :: Int -> RandomMonad [Int]
    405
    406prop_randList n
    407 = check (execRandom (seed n) (randList (n/10)))
    408 where
    409 check ns = (all (> 0) ns) && (sum ns == n)
    409prop_Reverse :: [Int] -> Bool
    410prop_Reverse xs = reverse (reverse xs) == xs
    410411\end{lstlisting}
    411412\end{frame}
Note: See TracChangeset for help on using the changeset viewer.

AltStyle によって変換されたページ (->オリジナル) /