Commit ff63c4b8 authored by Evan Nemerson's avatar Evan Nemerson Committed by Jürg Billeter

Support null source references in more places

Fixes bug 617713.
parent dc694eff
......@@ -42,7 +42,7 @@ public class Vala.Block : Symbol, Statement {
*
* @param source reference to source code
*/
public Block (SourceReference source_reference) {
public Block (SourceReference? source_reference) {
base (null, source_reference);
}
......
......@@ -32,7 +32,7 @@ public class Vala.BreakStatement : CodeNode, Statement {
* @param source reference to source code
* @return newly created break statement
*/
public BreakStatement (SourceReference source) {
public BreakStatement (SourceReference? source) {
source_reference = source;
}
......
......@@ -104,13 +104,15 @@ public class Vala.CodeWriter : CodeVisitor {
write_indent ();
write_string ("[CCode (cprefix = \"%s\", lower_case_cprefix = \"%s\"".printf (ns.get_cprefix (), ns.get_lower_case_cprefix ()));
if (ns.source_reference.file.gir_namespace != null) {
write_string (", ");
write_string ("gir_namespace = \"%s\"".printf (ns.source_reference.file.gir_namespace));
}
if (ns.source_reference.file.gir_version != null) {
write_string(", ");
write_string ("gir_version = \"%s\"".printf (ns.source_reference.file.gir_version));
if (ns.source_reference != null) {
if (ns.source_reference.file.gir_namespace != null) {
write_string (", ");
write_string ("gir_namespace = \"%s\"".printf (ns.source_reference.file.gir_namespace));
}
if (ns.source_reference.file.gir_version != null) {
write_string(", ");
write_string ("gir_version = \"%s\"".printf (ns.source_reference.file.gir_version));
}
}
write_string (")]");
......
......@@ -47,7 +47,7 @@ public class Vala.Constructor : Symbol {
* @param source reference to source code
* @return newly created constructor
*/
public Constructor (SourceReference source) {
public Constructor (SourceReference? source) {
base (null, source);
}
......
......@@ -34,7 +34,7 @@ public class Vala.SwitchSection : Block {
* @param source_reference reference to source code
* @return newly created switch section
*/
public SwitchSection (SourceReference source_reference) {
public SwitchSection (SourceReference? source_reference) {
base (source_reference);
}
......
......@@ -49,7 +49,7 @@ public class Vala.SwitchStatement : CodeNode, Statement {
* @param source_reference reference to source code
* @return newly created switch statement
*/
public SwitchStatement (Expression expression, SourceReference source_reference) {
public SwitchStatement (Expression expression, SourceReference? source_reference) {
this.source_reference = source_reference;
this.expression = expression;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment