Commit d301eee8 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

remove read/write tokens support package dependencies vapi/gdk-2.0.deps

2006-08-18  Jürg Billeter  <j@bitron.ch>

	* vala/parser.y: remove read/write tokens
	* compiler/valacompiler.vala: support package dependencies
	* vapi/gdk-2.0.deps
	* vapi/gtk+-2.0.deps
	* vapi/Makefile.am: update

svn path=/trunk/; revision=104
parent 18b2cb51
2006-08-18 Jürg Billeter <j@bitron.ch>
* vala/parser.y: remove read/write tokens
* compiler/valacompiler.vala: support package dependencies
* vapi/gdk-2.0.deps
* vapi/gtk+-2.0.deps
* vapi/Makefile.am: update
2006-08-18 Jürg Billeter <j@bitron.ch>
* vala/parser.y, vala/valastruct.vala: support base types for structs
......
......@@ -30,7 +30,9 @@ class Vala.Compiler {
static string library;
static string[] packages;
static bool disable_memory_management;
CodeContext context;
private CodeContext context;
private List<string> added_packages;
const OptionEntry[] options = {
{ "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, out vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..." },
......@@ -58,19 +60,19 @@ class Vala.Compiler {
if (vapi_directories != null) {
foreach (string vapidir in vapi_directories) {
var filename = Path.build_filename (vapidir, basename, null);
var filename = Path.build_filename (vapidir, basename);
if (File.test (filename, FileTest.EXISTS)) {
return filename;
}
}
}
var filename = Path.build_filename ("/usr/local/share/vala/vapi", basename, null);
var filename = Path.build_filename ("/usr/local/share/vala/vapi", basename);
if (File.test (filename, FileTest.EXISTS)) {
return filename;
}
filename = Path.build_filename ("/usr/share/vala/vapi", basename, null);
filename = Path.build_filename ("/usr/share/vala/vapi", basename);
if (File.test (filename, FileTest.EXISTS)) {
return filename;
}
......@@ -79,14 +81,34 @@ class Vala.Compiler {
}
private bool add_package (string! pkg) {
if (added_packages.find_custom (pkg, strcmp) != null) {
// ignore multiple occurences of the same package
return true;
}
var package_path = get_package_path (pkg);
if (package_path == null) {
return false;
}
added_packages.append (pkg);
context.add_source_file (new SourceFile (context, package_path, true));
var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg));
if (File.test (deps_filename, FileTest.EXISTS)) {
string deps_content;
File.get_contents (deps_filename, out deps_content, null, null);
foreach (string dep in deps_content.split ("\n")) {
if (dep != "") {
if (!add_package (dep)) {
Report.error (null, "%s, dependency of %s, not found in specified Vala API directories".printf (dep, pkg));
}
}
}
}
return true;
}
......
......@@ -192,8 +192,6 @@ static void yyerror (YYLTYPE *locp, ValaParser *parser, const char *msg);
%token VIRTUAL "virtual"
%token WEAK "weak"
%token WHILE "while"
%token READ "read"
%token WRITE "write"
%token <str> IDENTIFIER "identifier"
%token <str> INTEGER_LITERAL "integer"
......
......@@ -9,7 +9,9 @@ dist_vapi_DATA = \
atk.vala \
cairo.vala \
glib-2.0.vala \
gdk-2.0.deps \
gdk-2.0.vala \
gtk+-2.0.deps \
gtk+-2.0.vala \
libxml-2.0.vala \
pango.vala \
......
atk
cairo
gdk-2.0
pango
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