[valadoc] libvaladoc: Change monospace-rule from `<run>` to ``<run>``



commit 95be922c59cc09c192d8db93d5e4102e9155435d
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Oct 28 19:34:28 2010 +0200

    libvaladoc: Change monospace-rule from `<run>` to ``<run>``

 .../documentation/documentationparser.vala         |    2 +-
 src/libvaladoc/documentation/wikiscanner.vala      |    7 ++++++-
 src/libvaladoc/parser/tokentype.vala               |    4 ++--
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/libvaladoc/documentation/documentationparser.vala b/src/libvaladoc/documentation/documentationparser.vala
index 071c679..9696d51 100644
--- a/src/libvaladoc/documentation/documentationparser.vala
+++ b/src/libvaladoc/documentation/documentationparser.vala
@@ -822,7 +822,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator {
 				.set_name ("Underlined")
 				.set_start (() => { push (_factory.create_run (Run.Style.UNDERLINED)); });
 		Rule monospace =
-			Rule.seq ({ TokenType.BACK_QUOTE, run, TokenType.BACK_QUOTE })
+			Rule.seq ({ TokenType.BACK_QUOTE_2, run, TokenType.BACK_QUOTE_2 })
 				.set_name ("Monospace")
 				.set_start (() => { push (_factory.create_run (Run.Style.MONOSPACED)); });
 
diff --git a/src/libvaladoc/documentation/wikiscanner.vala b/src/libvaladoc/documentation/wikiscanner.vala
index c2ae177..f9730bd 100644
--- a/src/libvaladoc/documentation/wikiscanner.vala
+++ b/src/libvaladoc/documentation/wikiscanner.vala
@@ -262,7 +262,12 @@ public class Valadoc.WikiScanner : Object, Scanner {
 				break;
 
 			case '`':
-				emit_token (TokenType.BACK_QUOTE);
+				if (get_next_char () == '`') {
+					emit_token (TokenType.BACK_QUOTE_2);
+					_skip = 1;
+				} else {
+					append_char (c);
+				}
 				break;
 
 			case '\t':
diff --git a/src/libvaladoc/parser/tokentype.vala b/src/libvaladoc/parser/tokentype.vala
index 4410890..871cf0b 100644
--- a/src/libvaladoc/parser/tokentype.vala
+++ b/src/libvaladoc/parser/tokentype.vala
@@ -46,7 +46,7 @@ public class Valadoc.TokenType : Object {
 	public static TokenType SINGLE_QUOTE_2;
 	public static TokenType SLASH_2;
 	public static TokenType UNDERSCORE_2;
-	public static TokenType BACK_QUOTE;
+	public static TokenType BACK_QUOTE_2;
 	public static TokenType OPEN_BRACE;
 	public static TokenType CLOSED_BRACE;
 	public static TokenType DOUBLE_OPEN_BRACE;
@@ -152,7 +152,7 @@ public class Valadoc.TokenType : Object {
 			SINGLE_QUOTE_2 = new TokenType.basic ("''");
 			SLASH_2 = new TokenType.basic ("//");
 			UNDERSCORE_2 = new TokenType.basic ("__");
-			BACK_QUOTE = new TokenType.basic ("`");
+			BACK_QUOTE_2 = new TokenType.basic ("``");
 			OPEN_BRACE = new TokenType.basic ("{");
 			CLOSED_BRACE = new TokenType.basic ("}");
 			DOUBLE_OPEN_BRACE = new TokenType.basic ("{{");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]