$(GLIB_CFLAGS) \
$(GMODULE_CFLAGS) \
-I$(top_srcdir)/gee \
+ -I$(top_srcdir)/vala \
$(NULL)
AM_VALAFLAGS = \
gtkdocmarkupwriter.vala \
devhelp-markupwriter.vala \
ctyperesolver.vala \
- markupsourcelocation.vala \
- markuptokentype.vala \
- markupreader.vala \
gtkdocrenderer.vala \
documentation/commentscanner.vala \
documentation/documentation.vala \
--vapidir $(top_srcdir)/vapi --pkg gmodule-2.0 \
--vapidir $(top_srcdir)/vapi --pkg libgvc \
--vapidir $(top_srcdir)/gee --pkg gee \
+ --vapidir $(top_srcdir)/vala --pkg vala \
--pkg config \
$(filter %.vala %.c,$^)
touch $@
}
}
- private MarkupTokenType current_token;
- private MarkupSourceLocation begin;
- private MarkupSourceLocation end;
- private MarkupReader reader;
+ private Vala.MarkupTokenType current_token;
+ private Vala.SourceLocation begin;
+ private Vala.SourceLocation end;
+ private Vala.MarkupReader reader;
private DocumentationParser parser;
- private ErrorReporter reporter;
private Api.SourceFile file;
private string parent_c_identifier;
ErrorReporter reporter)
{
base (tree, modules, settings);
- this.reporter = reporter;
this.parser = parser;
}
public override void process (string source_file) {
this.file = new Api.SourceFile (new Api.Package (Path.get_basename (source_file), true, null),
source_file, null, null);
- this.reader = new MarkupReader (source_file, reporter);
+ this.reader = new Vala.MarkupReader (source_file);
// xml prolog
next ();
}
private void warning (string message) {
- reporter.warning (this.file.relative_path, this.begin.line, this.begin.column, this.end.column,
- this.reader.get_line_content (this.begin.line), message);
+ Vala.Report.warning (new Vala.SourceReference ((Vala.SourceFile) file.data, begin, end), message);
}
private void error (string message) {
- reporter.error (this.file.relative_path, this.begin.line, this.begin.column, this.end.column,
- this.reader.get_line_content (this.begin.line), message);
+ Vala.Report.error (new Vala.SourceReference ((Vala.SourceFile) file.data, begin, end), message);
}
private void next () {
current_token = reader.read_token (out begin, out end);
// Skip <annotation /> (only generated by valac)
- if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "annotation") {
+ if (current_token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "annotation") {
next (); // MarkupTokenType.END_ELEMENT, annotation
next ();
}
}
private void start_element (string name) {
- if (current_token != MarkupTokenType.START_ELEMENT || reader.name != name) {
+ if (current_token != Vala.MarkupTokenType.START_ELEMENT || reader.name != name) {
// error
error ("expected start element of `%s'".printf (name));
}
}
private void end_element (string name) {
- if (current_token != MarkupTokenType.END_ELEMENT || reader.name != name) {
+ if (current_token != Vala.MarkupTokenType.END_ELEMENT || reader.name != name) {
// error
error ("expected end element of `%s'".printf (name));
}
}
next ();
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "namespace") {
parse_namespace ();
} else if (reader.name == "include") {
int level = 1;
while (level > 0) {
- if (current_token == MarkupTokenType.START_ELEMENT) {
+ if (current_token == Vala.MarkupTokenType.START_ELEMENT) {
level++;
- } else if (current_token == MarkupTokenType.END_ELEMENT) {
+ } else if (current_token == Vala.MarkupTokenType.END_ELEMENT) {
level--;
- } else if (current_token == MarkupTokenType.EOF) {
+ } else if (current_token == Vala.MarkupTokenType.EOF) {
error ("unexpected end of file");
break;
}
start_element ("namespace");
next ();
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "alias") {
parse_alias ();
} else if (reader.name == "enumeration") {
next ();
- if (current_token == MarkupTokenType.TEXT) {
+ if (current_token == Vala.MarkupTokenType.TEXT) {
comment = new Api.GirSourceComment (reader.content, file, begin.line,
begin.column, end.line, end.column);
next ();
Api.SourceComment? comment = null;
- if (current_token == MarkupTokenType.TEXT) {
+ if (current_token == Vala.MarkupTokenType.TEXT) {
comment = new Api.SourceComment (reader.content, file, begin.line,
begin.column, end.line, end.column);
next ();
Api.GirSourceComment? comment = parse_symbol_doc ();
attach_comment (this.parent_c_identifier, comment);
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "member") {
parse_enumeration_member ();
} else if (reader.name == "function") {
attach_comment (this.parent_c_identifier, comment);
}
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "field") {
parse_field ();
} else if (reader.name == "constructor") {
Api.GirSourceComment? comment = parse_symbol_doc ();
attach_comment (this.parent_c_identifier, comment);
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "implements") {
skip_element ();
} else if (reader.name == "constant") {
Api.GirSourceComment? comment = parse_symbol_doc ();
attach_comment (this.parent_c_identifier, comment);
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "prerequisite") {
skip_element ();
} else if (reader.name == "field") {
string[] param_names = new string[0];
int array_length_ret = -1;
- if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "return-value") {
+ if (current_token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "return-value") {
Api.SourceComment? return_comment;
parse_return_value (out return_comment, out array_length_ret);
if (return_comment != null) {
}
- if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "parameters") {
+ if (current_token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "parameters") {
start_element ("parameters");
next ();
- if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "instance-parameter") {
+ if (current_token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "instance-parameter") {
string instance_param_name = reader.get_attribute ("name");
next ();
}
}
- for (int pcount = 0; current_token == MarkupTokenType.START_ELEMENT; pcount++) {
+ for (int pcount = 0; current_token == Vala.MarkupTokenType.START_ELEMENT; pcount++) {
Api.SourceComment? param_comment;
int array_length_pos;
int destroy_pos;
// TODO: process comments
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "field") {
parse_field ();
} else if (reader.name == "constructor") {
Api.GirSourceComment? comment = parse_symbol_doc ();
attach_comment (this.parent_c_identifier, comment);
- while (current_token == MarkupTokenType.START_ELEMENT) {
+ while (current_token == Vala.MarkupTokenType.START_ELEMENT) {
if (reader.name == "field") {
parse_field ();
} else if (reader.name == "constructor") {
public void read_index_sgml_file (string filename, string? index_sgml_online, ErrorReporter reporter) {
- MarkupSourceLocation begin;
- MarkupSourceLocation end;
- MarkupTokenType token;
+ Vala.SourceLocation begin;
+ Vala.SourceLocation end;
+ Vala.MarkupTokenType token;
string base_path = index_sgml_online ?? realpath (filename);
- var reader = new MarkupReader (filename, reporter);
+ var reader = new Vala.MarkupReader (filename);
- while ((token = reader.read_token (out begin, out end)) != MarkupTokenType.EOF) {
- if (token == MarkupTokenType.START_ELEMENT && reader.name == "ONLINE") {
+ while ((token = reader.read_token (out begin, out end)) != Vala.MarkupTokenType.EOF) {
+ if (token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "ONLINE") {
if (index_sgml_online == null) {
base_path = reader.get_attribute ("href");
if (base_path == null) {
- reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `href' in <ONLINE>");
+ //reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `href' in <ONLINE>");
+ Vala.Report.error (null, "missing attribute `href' in <ONLINE>");
}
}
- } else if (token == MarkupTokenType.START_ELEMENT && reader.name == "ANCHOR") {
+ } else if (token == Vala.MarkupTokenType.START_ELEMENT && reader.name == "ANCHOR") {
string id = reader.get_attribute ("id");
if (id == null) {
- reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `id' in <ANCHOR>");
+ //reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `id' in <ANCHOR>");
+ Vala.Report.error (null, "missing attribute `id' in <ANCHOR>");
}
string href = reader.get_attribute ("href");
if (href == null) {
- reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `href' in <ANCHOR>");
+ //reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "missing attribute `href' in <ANCHOR>");
+ Vala.Report.error (null, "missing attribute `href' in <ANCHOR>");
} else if (index_sgml_online != null) {
href = Path.get_basename (href);
}
map.set (id, Path.build_path ("/", base_path, href));
} else {
- reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "expected element of <ONLINE> or <ANCHOR>");
+ //reporter.error (filename, begin.line, begin.column, end.column, reader.get_line_content (begin.line), "expected element of <ONLINE> or <ANCHOR>");
+ Vala.Report.error (null, "expected element of <ONLINE> or <ANCHOR>");
}
}
}
+++ /dev/null
-/* markupreader.vala
- *
- * Copyright (C) 2008-2009 Jürg Billeter
- * Copyright (C) 2011 Florian Brosch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-
-/**
- * Simple reader for a subset of XML.
- */
-public class Valadoc.MarkupReader : Object {
- public string filename {
- private set;
- get;
- }
-
- public string name {
- private set;
- get;
- }
-
- public string content {
- private set;
- get;
- }
-
- private MappedFile mapped_file;
-
- private string[] lines;
- private char* begin;
- private char* current;
- private char* end;
-
- private int line;
- private int column;
-
- private Vala.Map<string, string> attributes = new Vala.HashMap<string, string> (str_hash, str_equal);
- private bool empty_element;
-
- private ErrorReporter reporter;
-
- public MarkupReader.from_string (string filename, string content, ErrorReporter reporter) {
- this.filename = filename;
- this.reporter = reporter;
-
- lines = content.split ("\n");
- begin = content;
- end = begin + content.length;
- current = begin;
-
- column = 1;
- line = 1;
- }
-
- public MarkupReader (string filename, ErrorReporter reporter) {
- this.filename = filename;
- this.reporter = reporter;
-
- try {
- mapped_file = new MappedFile (filename, false);
- begin = mapped_file.get_contents ();
- lines = ((string) begin).split ("\n");
- end = begin + mapped_file.get_length ();
-
- current = begin;
-
- line = 1;
- column = 1;
- } catch (FileError e) {
- reporter.simple_error (null, "Unable to map file '%s': %s", filename, e.message);
- }
- }
-
- public string? get_line_content (int line_nr) {
- if (this.lines.length > line_nr) {
- return this.lines[line_nr];
- }
-
- return null;
- }
-
- public string? get_attribute (string attr) {
- return attributes[attr];
- }
-
- /*
- * Returns a copy of the current attributes.
- *
- * @return map of current attributes
- */
- public Vala.Map<string,string> get_attributes () {
- var result = new Vala.HashMap<string, string> (str_hash, str_equal);
- foreach (var key in attributes.get_keys ()) {
- result.set (key, attributes.get (key));
- }
- return result;
- }
-
- private string read_name () {
- char* begin = current;
- while (current < end) {
- if (current[0] == ' ' || current[0] == '\t' || current[0] == '>'
- || current[0] == '/' || current[0] == '=' || current[0] == '\n') {
- break;
- }
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u != (unichar) (-1)) {
- current += u.to_utf8 (null);
- } else {
- reporter.simple_error ("%s:%d".printf (filename, line),
- "invalid UTF-8 character");
- }
- }
- if (current == begin) {
- // syntax error: invalid name
- }
- return ((string) begin).substring (0, (int) (current - begin));
- }
-
- public MarkupTokenType read_token (out MarkupSourceLocation token_begin, out MarkupSourceLocation token_end) {
- attributes.clear ();
-
- if (empty_element) {
- empty_element = false;
- token_begin = MarkupSourceLocation (begin, line, column);
- token_end = MarkupSourceLocation (begin, line, column);
- return MarkupTokenType.END_ELEMENT;
- }
-
- content = null;
- name = null;
-
- space ();
-
- MarkupTokenType type = MarkupTokenType.NONE;
- char* begin = current;
- token_begin = MarkupSourceLocation (begin, line, column);
-
- if (current >= end) {
- type = MarkupTokenType.EOF;
- } else if (current[0] == '<') {
- current++;
- if (current >= end) {
- // error
- } else if (current[0] == '?') {
- // 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;
- } else if (current[0] == '\n') {
- line++;
- column = 0;
- }
- current++;
- }
-
- // ignore comment, read next token
- return read_token (out token_begin, out token_end);
- }
- } else if (current[0] == '/') {
- type = MarkupTokenType.END_ELEMENT;
- current++;
- name = read_name ();
- if (current >= end || current[0] != '>') {
- // error
- }
- current++;
- } else {
- type = MarkupTokenType.START_ELEMENT;
- name = read_name ();
- space ();
- while (current < end && current[0] != '>' && current[0] != '/') {
- string attr_name = read_name ();
- if (current >= end || current[0] != '=') {
- // error
- }
- current++;
- // FIXME allow single quotes
- if (current >= end || current[0] != '"') {
- // error
- }
- current++;
-
- string attr_value = text ('"', false);
-
- if (current >= end || current[0] != '"') {
- // error
- }
- current++;
- attributes.set (attr_name, attr_value);
- space ();
- }
- if (current[0] == '/') {
- empty_element = true;
- current++;
- space ();
- } else {
- empty_element = false;
- }
- if (current >= end || current[0] != '>') {
- // error
- }
- current++;
- }
- } else {
- space ();
-
- if (current[0] != '<') {
- content = text ('<', true);
- } else {
- // no text
- // read next token
- return read_token (out token_begin, out token_end);
- }
-
- type = MarkupTokenType.TEXT;
- }
-
- token_end = MarkupSourceLocation (current, line, column - 1);
-
- return type;
- }
-
- private string text (char end_char, bool rm_trailing_whitespace) {
- StringBuilder content = new StringBuilder ();
- char* text_begin = current;
- char* last_linebreak = current;
-
- while (current < end && current[0] != end_char) {
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u == (unichar) (-1)) {
- reporter.simple_error ("%s:%d".printf (filename, line),
- "invalid UTF-8 character");
- } else if (u == '&') {
- char* next_pos = current + u.to_utf8 (null);
- if (((string) next_pos).has_prefix ("amp;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('&');
- current += 5;
- text_begin = current;
- } else if (((string) next_pos).has_prefix ("quot;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('"');
- current += 6;
- text_begin = current;
- } else if (((string) next_pos).has_prefix ("apos;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('\'');
- current += 6;
- text_begin = current;
- } else if (((string) next_pos).has_prefix ("lt;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('<');
- current += 4;
- text_begin = current;
- } else if (((string) next_pos).has_prefix ("gt;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('>');
- current += 4;
- text_begin = current;
- } else if (((string) next_pos).has_prefix ("percnt;")) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- content.append_c ('%');
- current += 8;
- text_begin = current;
- } else {
- current += u.to_utf8 (null);
- }
- } else {
- if (u == '\n') {
- line++;
- column = 0;
- last_linebreak = current;
- }
-
- current += u.to_utf8 (null);
- column++;
- }
- }
-
- if (text_begin != current) {
- content.append (((string) text_begin).substring (0, (int) (current - text_begin)));
- }
-
- column += (int) (current - last_linebreak);
-
- // Removes trailing whitespace
- if (rm_trailing_whitespace) {
- char* str_pos = ((char*)content.str) + content.len;
- for (str_pos--; str_pos > ((char*)content.str) && str_pos[0].isspace(); str_pos--);
- content.erase ((ssize_t) (str_pos-((char*) content.str) + 1), -1);
- }
-
- return content.str;
- }
-
- private void space () {
- while (current < end && current[0].isspace ()) {
- if (current[0] == '\n') {
- line++;
- column = 0;
- }
- current++;
- column++;
- }
- }
-}
-
-
+++ /dev/null
-/* valasourcelocation.vala
- *
- * Copyright (C) 2008 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-
-/**
- * Represents a position in a source file.
- */
-public struct Valadoc.MarkupSourceLocation {
- public char* pos;
- public int line;
- public int column;
-
- public MarkupSourceLocation (char* _pos, int _line, int _column) {
- pos = _pos;
- line = _line;
- column = _column;
- }
-}
-
+++ /dev/null
-/* markuptokentype.vala
- *
- * 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-
-public enum Valadoc.MarkupTokenType {
- NONE,
- COMMENT,
- START_ELEMENT,
- END_ELEMENT,
- TEXT,
- EOF;
-
- public string to_string () {
- switch (this) {
- case START_ELEMENT:
- return "start element";
-
- case END_ELEMENT:
- return "end element";
-
- case TEXT:
- return "text";
-
- case EOF:
- return "end of file";
-
- default:
- return "unknown token type";
- }
- }
-}
-
</root-element>""";
- var reader = new MarkupReader.from_string ("testfile", content, reporter);
+ var reader = new Vala.MarkupReader.from_string ("testfile", content);
assert (reader.filename == "testfile");
- MarkupSourceLocation begin;
- MarkupSourceLocation end;
- MarkupTokenType token;
+ Vala.SourceLocation begin;
+ Vala.SourceLocation end;
+ Vala.MarkupTokenType token;
token = reader.read_token (out begin, out end);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.START_ELEMENT);
+ assert (token == Vala.MarkupTokenType.START_ELEMENT);
assert (reader.name == "root-element");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 2);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.START_ELEMENT);
+ assert (token == Vala.MarkupTokenType.START_ELEMENT);
assert (reader.name == "subelement");
assert (reader.content == null);
assert (reader.get_attributes ().size == 2);
assert (end.line == 3);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.TEXT);
+ assert (token == Vala.MarkupTokenType.TEXT);
assert (reader.name == null);
assert (reader.content == "my text");
assert (reader.get_attributes ().size == 0);
assert (end.line == 3);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.END_ELEMENT);
+ assert (token == Vala.MarkupTokenType.END_ELEMENT);
assert (reader.name == "subelement");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 3);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.START_ELEMENT);
+ assert (token == Vala.MarkupTokenType.START_ELEMENT);
assert (reader.name == "simpletag1");
assert (reader.content == null);
assert (reader.get_attributes ().size == 2);
assert (end.line == 4);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.END_ELEMENT);
+ assert (token == Vala.MarkupTokenType.END_ELEMENT);
assert (reader.name == "simpletag1");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 4);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.START_ELEMENT);
+ assert (token == Vala.MarkupTokenType.START_ELEMENT);
assert (reader.name == "simpletag2");
assert (reader.content == null);
assert (reader.get_attributes ().size == 1);
assert (end.line == 5);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.END_ELEMENT);
+ assert (token == Vala.MarkupTokenType.END_ELEMENT);
assert (reader.name == "simpletag2");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 5);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.START_ELEMENT);
+ assert (token == Vala.MarkupTokenType.START_ELEMENT);
assert (reader.name == "simpletag3");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 6);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.END_ELEMENT);
+ assert (token == Vala.MarkupTokenType.END_ELEMENT);
assert (reader.name == "simpletag3");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 6);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.END_ELEMENT);
+ assert (token == Vala.MarkupTokenType.END_ELEMENT);
assert (reader.name == "root-element");
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
assert (end.line == 7);
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.EOF);
+ assert (token == Vala.MarkupTokenType.EOF);
assert (reader.name == null);
assert (reader.content == null);
assert (reader.get_attributes ().size == 0);
string content = "AA BB & "' < > %";
- var reader = new MarkupReader.from_string ("testfile", content, reporter);
+ var reader = new Vala.MarkupReader.from_string ("testfile", content);
assert (reader.filename == "testfile");
- MarkupSourceLocation begin;
- MarkupSourceLocation end;
- MarkupTokenType token;
+ Vala.SourceLocation begin;
+ Vala.SourceLocation end;
+ Vala.MarkupTokenType token;
token = reader.read_token (out begin, out end);
- assert (token == MarkupTokenType.TEXT);
+ assert (token == Vala.MarkupTokenType.TEXT);
assert (reader.content == "AA BB & \"' < > %");
assert (reader.name == null);
assert (reader.get_attributes ().size == 0);