Permalink
Browse files

fix Issue 9764 - Ddoc: Ddoc file name is incorrectly emphasized

  • Loading branch information...
1 parent 0442749 commit 9ccf408054ded3a3aea1c3e718ebf66ec844385b @9rnsr 9rnsr committed Mar 20, 2013
View
3 src/doc.c
@@ -2306,6 +2306,9 @@ void highlightCode2(Scope *sc, Dsymbol *s, OutBuffer *buf, size_t offset)
unsigned char *lastp = buf->data;
const char *highlight;
+ if (s->isModule() && ((Module *)s)->isDocFile)
+ sid = "";
+
//printf("highlightCode2('%.*s')\n", buf->offset - 1, buf->data);
res.reserve(buf->offset);
while (1)
View
6 test/Makefile
@@ -141,7 +141,7 @@ endif
runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.sh)
runnable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(runnable_tests)))
-compilable_tests=$(wildcard compilable/*.d)
+compilable_tests=$(wildcard compilable/*.d) $(wildcard compilable/*.sh)
compilable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(compilable_tests)))
fail_compilation_tests=$(wildcard fail_compilation/*.d) $(wildcard fail_compilation/*.html)
@@ -165,6 +165,10 @@ $(RESULTS_DIR)/runnable/%.sh.out: runnable/%.sh $(RESULTS_DIR)/.created $(RESULT
$(RESULTS_DIR)/compilable/%.d.out: compilable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD)
$(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* d
+$(RESULTS_DIR)/compilable/%.sh.out: compilable/%.sh $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD)
+ $(QUIET) echo " ... $(<D)/$*.sh"
+ $(QUIET) ./$(<D)/$*.sh
+
$(RESULTS_DIR)/fail_compilation/%.d.out: fail_compilation/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test $(DMD)
$(QUIET) ./$(RESULTS_DIR)/d_do_test $(<D) $* d
View
11 test/compilable/ddoc9764.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+name=`basename $0 .sh`
+dir=${RESULTS_DIR}/compilable
+output_file=${dir}/${name}.html
+
+rm -f ${output_file}
+
+$DMD -m${MODEL} -D -o- compilable/extra-files/ddoc9764.dd -Df${output_file}
+
+compilable/extra-files/ddocAny-postscript.sh 9764
View
7 test/compilable/extra-files/ddoc9764.dd
@@ -0,0 +1,7 @@
+Ddoc
+
+Check ddoc9764 document.
+----
+// Check ddoc9764 comment.
+ddoc9764();
+----
View
14 test/compilable/extra-files/ddoc9764.html
@@ -0,0 +1,14 @@
+<html><head>
+ <META http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>ddoc9764</title>
+ </head><body>
+ <h1>ddoc9764</h1>
+
+
+Check ddoc9764 document.
+<pre class="d_code"><font color=green>// Check ddoc9764 comment.
+</font>ddoc9764();
+</pre>
+
+ <hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. </small>
+ </body></html>

0 comments on commit 9ccf408

Please sign in to comment.