using System.Reflection.Emit;
using System.Collections;
using System.Collections.Specialized;
- using System.Diagnostics;
using System.IO;
using System.Text;
using System.Globalization;
- using System.Xml;
+ using System.Diagnostics;
public enum Target {
Library, Exe, Module, WinExe
return true;
case "/out":
- if (value == ""){
+ if (value.Length == 0){
Usage ();
Environment.Exit (1);
}
case "/define": {
string [] defs;
- if (value == ""){
+ if (value.Length == 0){
Usage ();
Environment.Exit (1);
}
case "/pkg": {
string packages;
- if (value == ""){
+ if (value.Length == 0){
Usage ();
Environment.Exit (1);
}
return true;
case "/recurse":
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, "-recurse requires an argument");
Environment.Exit (1);
}
case "/r":
case "/reference": {
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, "-reference requires an argument");
Environment.Exit (1);
}
return true;
}
case "/addmodule": {
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
return true;
}
case "/win32res": {
- if (value == "") {
+ if (value.Length == 0) {
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
return true;
}
case "/win32icon": {
- if (value == "") {
+ if (value.Length == 0) {
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
return true;
}
case "/doc": {
- if (value == ""){
+ if (value.Length == 0){
Report.Error (2006, arg + " requires an argument");
Environment.Exit (1);
}
case "/lib": {
string [] libdirs;
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, "/lib requires an argument");
Environment.Exit (1);
}
case "/nowarn": {
string [] warns;
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, "/nowarn requires an argument");
Environment.Exit (1);
}
case "/main":
case "/m":
- if (value == ""){
+ if (value.Length == 0){
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
for (i = 0; i < args.Length; i++){
string arg = args [i];
- if (arg == "")
+ if (arg.Length == 0)
continue;
if (arg.StartsWith ("@")){
int pos = first_source.LastIndexOf ('.');
if (pos > 0)
- output_file = first_source.Substring (0, pos) + RootContext.TargetExt;
+ output_file = first_source.Substring (0, pos);
else
- output_file = first_source + RootContext.TargetExt;
+ output_file = first_source;
}
+
+ if (!Path.HasExtension (output_file))
+ output_file += RootContext.TargetExt;
if (!CodeGen.Init (output_file, output_file, want_debugging_support))
return false;
if (ep == null) {
if (RootContext.MainClass != null) {
- DeclSpace main_cont = RootContext.Tree.GetDecl (MemberName.FromDotted (RootContext.MainClass, Location.Null));
+ DeclSpace main_cont = RootContext.Tree.Types.GetDefinition (RootContext.MainClass) as DeclSpace;
if (main_cont == null) {
Report.Error (1555, "Could not find `{0}' specified for Main method", RootContext.MainClass);
return false;
public void Emit ()
{
- CodeGen.Assembly.Builder.AddResourceFile (name, file, attribute);
+ CodeGen.Assembly.Builder.AddResourceFile (name, Path.GetFileName(file), attribute);
}
public string FileName {
RootNamespace.Reset ();
NamespaceEntry.Reset ();
CodeGen.Reset ();
+ Attribute.Reset ();
+ AttributeTester.Reset ();
}
}
}