aboutsummaryrefslogtreecommitdiff
path: root/src/HsLexer.lhs
diff options
context:
space:
mode:
authorDuncan Coutts <duncan.coutts@worc.ox.ac.uk>2006-01-22 00:02:00 +0000
committerDuncan Coutts <duncan.coutts@worc.ox.ac.uk>2006-01-22 00:02:00 +0000
commitedd9f2295507bce2247108a4d5a0d991f15fd250 (patch)
treedc757d5629d7347643f47121070e4ff0e5e92d0d /src/HsLexer.lhs
parent43bb89fa9667162f3f4a0e024a3f926696c173b9 (diff)
Extend URL variable expansion syntax and add source links to the contents page
Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module.
Diffstat (limited to 'src/HsLexer.lhs')
-rw-r--r--src/HsLexer.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/HsLexer.lhs b/src/HsLexer.lhs
index 47ee75f5..35eccb81 100644
--- a/src/HsLexer.lhs
+++ b/src/HsLexer.lhs
@@ -641,7 +641,7 @@ parseLinePragma cont y fname s0 =
((y',_):_) -> y'
_ -> y
s3 = dropWhite s2
- fnameStr = takeWhile (\c -> c /= '"') (tail s3)
+ fnameStr = takeWhile (\c -> c /= '"' && c/='\n') (tail s3)
fname' | null s3 || head s3 /= '"' = fname
-- try and get more sharing of file name strings
| fnameStr == fname = fname