]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valadoc: Drop custom SourceLocation
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 26 Nov 2017 18:27:00 +0000 (19:27 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 9 Jan 2018 09:18:53 +0000 (10:18 +0100)
libvaladoc/Makefile.am
libvaladoc/documentation/gtkdocmarkdownscanner.vala
libvaladoc/documentation/wikiscanner.vala
libvaladoc/importer/valadocdocumentationimporter.vala
libvaladoc/importer/valadocdocumentationimporterscanner.vala
libvaladoc/parser/sourcelocation.vala [deleted file]
libvaladoc/parser/token.vala
valadoc/tests/libvaladoc/parser/generic-scanner.vala

index 7499a7ada495bd04bcb63c9686c8ff062f5a97e8..271c88ae067ad2b5edc13a45cb0378a0147a9adb 100644 (file)
@@ -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 \
index 944d8ceded92a362878778fee5df1f976b38b32b..6df58d07df252b27e0bd39dcbd9be1cc76f394a2 100644 (file)
@@ -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 () {
index 625a77ab75079f22971c0ebd8166638db6d28eb2..f0c32d22422dc1d1beb9e91300d41f99922446fb 100644 (file)
@@ -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 {
index 5505896fe18b270c65e85d9bcd899d7cc7992353..0663bab1eb8829afd468864ca25062b04c348f02 100644 (file)
@@ -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;
 
index ec52fddabdae07ce1629baed68433770bc8def13..5f46d4b2ef37d8447d6f5e663a3d50925ee365c7 100644 (file)
@@ -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/sourcelocation.vala b/libvaladoc/parser/sourcelocation.vala
deleted file mode 100644 (file)
index 51b5bc1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sourcelocation.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>
- */
-
-
-/**
- * Represents a position in a source file.
- */
-public struct Valadoc.SourceLocation {
-       public int line;
-       public int column;
-
-       public SourceLocation (int _line, int _column) {
-               line = _line;
-               column = _column;
-       }
-}
index 52833b24e4362a5d5f1c7e38348198771f1fbf86..97581c28a42d35e6ba54dc6da0d8a43658579902 100644 (file)
 
 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;
                }
index 183bd5e96a1f3c5fac8615b41d6d1fc62d348d56..d3dc2a0f9dd3fc1b16b6e5cb4500ba9946edb24c 100644 (file)
@@ -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));
        }