vala r2374 - in trunk: . vapigen



Author: juergbi
Date: Sat Jan 17 17:02:19 2009
New Revision: 2374
URL: http://svn.gnome.org/viewvc/vala?rev=2374&view=rev

Log:
2009-01-17  JÃrg Billeter  <j bitron ch>

	* vapigen/valamarkupreader.vala:

	Read comments


Modified:
   trunk/ChangeLog
   trunk/vapigen/valamarkupreader.vala

Modified: trunk/vapigen/valamarkupreader.vala
==============================================================================
--- trunk/vapigen/valamarkupreader.vala	(original)
+++ trunk/vapigen/valamarkupreader.vala	Sat Jan 17 17:02:19 2009
@@ -1,6 +1,6 @@
 /* valamarkupreader.vala
  *
- * Copyright (C) 2008  JÃrg Billeter
+ * Copyright (C) 2008-2009  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -112,6 +112,22 @@
 				// processing instruction
 			} else if (current[0] == '!') {
 				// comment or doctype
+				current++;
+				if (current < end - 1 && current[0] == '-' && current[1] == '-') {
+					// comment
+					current += 2;
+					while (current < end - 2) {
+						if (current[0] == '-' && current[1] == '-' && current[2] == '>') {
+							// end of comment
+							current += 3;
+							break;
+						}
+						current++;
+					}
+
+					// ignore comment, read next token
+					return read_token (out token_begin, out token_end);
+				}
 			} else if (current[0] == '/') {
 				type = MarkupTokenType.END_ELEMENT;
 				current++;



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