示例#1
0
	public static void Main(string[] args){
		InitConsole();

		string srcfile=checkArgument(args);
		if(srcfile==null)return;

		FileInfo info=new FileInfo();
		info.filename=_args.option_filename??srcfile;
		System.Console.WriteLine("file '{0}' を処理します",srcfile);
		string content=System.IO.File.ReadAllText(srcfile,enc);

		content=Preprocessor.Process(content,info);
    content=RegExp.JsConvertAtStrings(content); // @"" @'' の処理
		content=TranslateContext.Translate(_args,content);
		if(_args.option_compress)
			content=RegExp.CutComment(content);
		else
			content=RegExp.CanonicalizeLine(content);

    if(!_args.option_partial){
      content=string.Format(
        FRAME,
        info.filename,
        enc.WebName,
        System.DateTime.Now,
        srcfile,
        content,
        info.GetMwgScriptsRequirement()
      );
    }
		System.IO.File.WriteAllText(info.filename+".js",content);

		System.Console.WriteLine("file '{0}.js' に書き込みました",info.filename);
	}