[vala/parallel: 10/17] ValaSymbol: add SourceFileType source_type



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

    ValaSymbol: 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 89ac310..f11537e 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]