[vala/staging] valadoc: Drop custom SourceLocation



commit 4e7c8d76cb13d99e219b68e03508bf435b3766f4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Nov 26 19:27:00 2017 +0100

    valadoc: Drop custom SourceLocation

 libvaladoc/Makefile.am                             |    1 -
 .../documentation/gtkdocmarkdownscanner.vala       |    8 ++--
 libvaladoc/documentation/wikiscanner.vala          |    8 ++--
 .../importer/valadocdocumentationimporter.vala     |    4 +-
 .../valadocdocumentationimporterscanner.vala       |    8 ++--
 libvaladoc/parser/sourcelocation.vala              |   35 --------------------
 libvaladoc/parser/token.vala                       |   12 +++---
 .../tests/libvaladoc/parser/generic-scanner.vala   |    2 +-
 8 files changed, 21 insertions(+), 57 deletions(-)
---
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 7499a7a..271c88a 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -138,7 +138,6 @@ libvaladoc_la_VALASOURCES = \
        parser/rule.vala \
        parser/scanner.vala \
        parser/sequencerule.vala \
-       parser/sourcelocation.vala \
        parser/stubrule.vala \
        parser/token.vala \
        parser/tokentype.vala \
diff --git a/libvaladoc/documentation/gtkdocmarkdownscanner.vala 
b/libvaladoc/documentation/gtkdocmarkdownscanner.vala
index 944d8ce..6df58d0 100644
--- a/libvaladoc/documentation/gtkdocmarkdownscanner.vala
+++ b/libvaladoc/documentation/gtkdocmarkdownscanner.vala
@@ -713,12 +713,12 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner {
                }
        }
 
-       private SourceLocation get_begin () {
-               return SourceLocation (_last_line, get_line_start_column () + _last_column);
+       private Vala.SourceLocation get_begin () {
+               return Vala.SourceLocation (_index, _last_line, get_line_start_column () + _last_column);
        }
 
-       private SourceLocation get_end (int offset = 0) {
-               return SourceLocation (_line, get_line_start_column () + _column + offset);
+       private Vala.SourceLocation get_end (int offset = 0) {
+               return Vala.SourceLocation (_index, _line, get_line_start_column () + _column + offset);
        }
 
        public int get_line_start_column () {
diff --git a/libvaladoc/documentation/wikiscanner.vala b/libvaladoc/documentation/wikiscanner.vala
index 625a77a..f0c32d2 100644
--- a/libvaladoc/documentation/wikiscanner.vala
+++ b/libvaladoc/documentation/wikiscanner.vala
@@ -295,12 +295,12 @@ public class Valadoc.WikiScanner : Object, Scanner {
                return 0;
        }
 
-       private SourceLocation get_begin () {
-               return SourceLocation (_last_line, get_line_start_column () + _last_column);
+       private Vala.SourceLocation get_begin () {
+               return Vala.SourceLocation (_index, _last_line, get_line_start_column () + _last_column);
        }
 
-       private SourceLocation get_end (int offset = 0) {
-               return SourceLocation (_line, get_line_start_column () + _column + offset);
+       private Vala.SourceLocation get_end (int offset = 0) {
+               return Vala.SourceLocation (_index, _line, get_line_start_column () + _column + offset);
        }
 
        private void emit_current_word () throws ParserError {
diff --git a/libvaladoc/importer/valadocdocumentationimporter.vala 
b/libvaladoc/importer/valadocdocumentationimporter.vala
index 5505896..0663bab 100644
--- a/libvaladoc/importer/valadocdocumentationimporter.vala
+++ b/libvaladoc/importer/valadocdocumentationimporter.vala
@@ -35,7 +35,7 @@ public class Valadoc.Importer.ValadocDocumentationImporter : DocumentationImport
        private string _filename;
        private string _cname;
        private StringBuilder _comment;
-       private SourceLocation _comment_location;
+       private Vala.SourceLocation _comment_location;
        protected Content.ContentFactory factory;
 
 
@@ -127,7 +127,7 @@ public class Valadoc.Importer.ValadocDocumentationImporter : DocumentationImport
        }
 
        private void add_documentation (string _symbol_name, StringBuilder? comment, string filename,
-                                                                       SourceLocation src_ref)
+                                                                       Vala.SourceLocation src_ref)
        {
                Api.Node? symbol = null;
 
diff --git a/libvaladoc/importer/valadocdocumentationimporterscanner.vala 
b/libvaladoc/importer/valadocdocumentationimporterscanner.vala
index ec52fdd..5f46d4b 100644
--- a/libvaladoc/importer/valadocdocumentationimporterscanner.vala
+++ b/libvaladoc/importer/valadocdocumentationimporterscanner.vala
@@ -158,12 +158,12 @@ public class Valadoc.Importer.ValadocDocumentationScanner : Object, Scanner {
                return 0;
        }
 
-       private SourceLocation get_begin () {
-               return SourceLocation (_last_line, get_line_start_column () + _last_column);
+       private Vala.SourceLocation get_begin () {
+               return Vala.SourceLocation (_index, _last_line, get_line_start_column () + _last_column);
        }
 
-       private SourceLocation get_end (int offset = 0) {
-               return SourceLocation (_line, get_line_start_column () + _column + offset);
+       private Vala.SourceLocation get_end (int offset = 0) {
+               return Vala.SourceLocation (_index, _line, get_line_start_column () + _column + offset);
        }
 
        private void emit_current_word () throws ParserError {
diff --git a/libvaladoc/parser/token.vala b/libvaladoc/parser/token.vala
index 52833b2..97581c2 100644
--- a/libvaladoc/parser/token.vala
+++ b/libvaladoc/parser/token.vala
@@ -23,14 +23,14 @@
 
 public class Valadoc.Token : Object {
 
-       public Token.from_type (TokenType type, SourceLocation begin, SourceLocation end, string? val = null) 
{
+       public Token.from_type (TokenType type, Vala.SourceLocation begin, Vala.SourceLocation end, string? 
val = null) {
                _type = type;
                _begin = begin;
                _end = end;
                _value = val;
        }
 
-       public Token.from_word (string word, SourceLocation begin, SourceLocation end) {
+       public Token.from_word (string word, Vala.SourceLocation begin, Vala.SourceLocation end) {
                _word = word;
                _begin = begin;
                _end = end;
@@ -38,8 +38,8 @@ public class Valadoc.Token : Object {
 
        private TokenType? _type = null;
        private string? _word = null;
-       private SourceLocation _begin;
-       private SourceLocation _end;
+       private Vala.SourceLocation _begin;
+       private Vala.SourceLocation _end;
        private string? _value;
 
        public bool is_word {
@@ -82,13 +82,13 @@ public class Valadoc.Token : Object {
                }
        }
 
-       public SourceLocation begin {
+       public Vala.SourceLocation begin {
                get {
                        return _begin;
                }
        }
 
-       public SourceLocation end {
+       public Vala.SourceLocation end {
                get {
                        return _end;
                }
diff --git a/valadoc/tests/libvaladoc/parser/generic-scanner.vala 
b/valadoc/tests/libvaladoc/parser/generic-scanner.vala
index 183bd5e..d3dc2a0 100644
--- a/valadoc/tests/libvaladoc/parser/generic-scanner.vala
+++ b/valadoc/tests/libvaladoc/parser/generic-scanner.vala
@@ -35,7 +35,7 @@ public class TestScanner : Object, Valadoc.Scanner {
        }
 
        private void emit_token (Valadoc.TokenType type) throws Valadoc.ParserError {
-               Valadoc.SourceLocation loc = SourceLocation (pos, pos);
+               Vala.SourceLocation loc = Vala.SourceLocation (null, pos, pos);
                parser.accept_token (new Token.from_type (type, loc, loc));
        }
 


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