[vala] Symbol: Add SourceFileType source_type



commit 74e58bef9ce17af958776f65888973dab8f4e3e3
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Aug 24 21:51:55 2010 +0200

    Symbol: Add SourceFileType source_type
    
    Pass this through from the SourceFileType of the source file.  If there
    is no source file, use SourceFileType.NONE.
    
    Redefine 'external_package' in terms of this new property.

 vala/valasymbol.vala |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 0df385d..925e0eb 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -156,7 +156,21 @@ public abstract class Vala.Symbol : CodeNode {
 	 */
 	public bool external_package {
 		get {
-			return (source_reference != null && source_reference.file.file_type == SourceFileType.PACKAGE);
+			return source_type == SourceFileType.PACKAGE;
+		}
+	}
+
+	/**
+	 * Gets the SourceFileType of the source file that this symbol
+	 * came from, or SourceFileType.NONE.
+	 */
+	public SourceFileType source_type {
+		get {
+			if (source_reference != null) {
+				return source_reference.file.file_type;
+			} else {
+				return SourceFileType.NONE;
+			}
 		}
 	}
 



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