Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

D Programming Language Support

<< < (2/13) > >>

nocide:
push! (see post 1)

bernard:

--- Code: ---[codeblocks]$ patch -p0 <dprogramming.patch
(Stripping trailing CRs from patch.)
patching file src/plugins/codecompletion/codecompletion.cpp
(Stripping trailing CRs from patch.)
patching file src/plugins/compilergcc/compilerDMD.cpp
(Stripping trailing CRs from patch.)
patching file src/plugins/compilergcc/compilerDMD.h
(Stripping trailing CRs from patch.)
patching file src/plugins/compilergcc/compilergcc.cpp
(Stripping trailing CRs from patch.)
patching file src/plugins/scriptedwizard/resources/common_functions.script
Hunk #1 FAILED at 31.
Hunk #2 FAILED at 65.
Hunk #3 FAILED at 130.
3 out of 3 hunks FAILED -- saving rejects to file src/plugins/scriptedwizard/resources/common_functions.script.rej
(Stripping trailing CRs from patch.)
patching file src/plugins/scriptedwizard/resources/d/console/hello.d
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/scriptedwizard/resources/d/console/hello.d.rej
(Stripping trailing CRs from patch.)
patching file src/plugins/scriptedwizard/resources/d/wizard.script
Hunk #1 FAILED at 17.
Hunk #2 FAILED at 29.
2 out of 2 hunks FAILED -- saving rejects to file src/plugins/scriptedwizard/resources/d/wizard.script.rej
(Stripping trailing CRs from patch.)
patching file src/sdk/resources/lexers/lexer_d.sample
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 14.
2 out of 2 hunks FAILED -- saving rejects to file src/sdk/resources/lexers/lexer_d.sample.rej
(Stripping trailing CRs from patch.)
patching file src/sdk/resources/lexers/lexer_d.xml
Hunk #1 FAILED at 3.
Hunk #2 FAILED at 122.
2 out of 2 hunks FAILED -- saving rejects to file src/sdk/resources/lexers/lexer_d.xml.rej

--- End code ---

common_functions.script.rej

--- Code: ---***************
*** 31,37 ****
          base.AddCompilerOption(_T("-Wall"));
      }
      else if (   GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("bcc*"))
-              || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd")) )
      {
          base.AddCompilerOption(_T("-w"));
      }
--- 31,37 ----
          base.AddCompilerOption(_T("-Wall"));
      }
      else if (   GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("bcc*"))
+              || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd*")) )
      {
          base.AddCompilerOption(_T("-w"));
      }
***************
*** 65,80 ****
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("ppc*"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("cygwin"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmc"))
-              || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("gcc"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("gdc"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("tcc")) )
      {
          base.AddCompilerOption(_T("-g"));
 
-         if  (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd")))
          {
-             base.AddCompilerOption(_T("-debug"));
          }
      }
      else if (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("bcc*")))
--- 65,80 ----
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("ppc*"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("cygwin"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmc"))
+              || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd*"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("gcc"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("gdc"))
               || GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("tcc")) )
      {
          base.AddCompilerOption(_T("-g"));
 
+         if  (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd*")))
          {
+             base.AddLinkerOptions(_T("-g"));
          }
      }
      else if (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("bcc*")))
***************
*** 130,136 ****
      {
          base.AddCompilerOption(_T("-Os"));
      }
-     else if (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd")))
      {
          base.AddCompilerOption(_T("-O"));
      }
--- 130,136 ----
      {
          base.AddCompilerOption(_T("-Os"));
      }
+     else if (GetCompilerFactory().CompilerInheritsFrom(compilerID, _T("dmd*")))
      {
          base.AddCompilerOption(_T("-O"));
      }

[b]/src/plugins/scriptedwizard/resources/d/console/hello.d.rej[/b]
[code]
***************
*** 1,10 ****
- version(Tango) extern (C) int printf(char *, ...);
 
- int main(char[][] args)
  {
-     printf("hello world\n");
-     printf("args.length = %d\n", args.length);
-     for (int i = 0; i < args.length; i++)
- printf("args[%d] = '%s'\n", i, cast(char *)args[i]);
-     return 0;
  }
--- 1,9 ----
+ module main;
 
+ import std.stdio;
+
+ int main(string[] args)
  {
+     writefln("Hello World\n");
+ return 0;
  }

--- End code ---

./src/plugins/scriptedwizard/resources/d/wizard.script.rej

--- Code: ---***************
*** 17,23 ****
      // add builtin pages
      Wizard.AddInfoPage(_T("DIntro"), intro_msg); // intro
      Wizard.AddProjectPathPage(); // select project name and path
-     Wizard.AddCompilerPage(_T(""), _T("dmd;gdc"), true, true); // select compiler and configurations
      // nothing more needs to be done here
  }
 
--- 17,23 ----
      // add builtin pages
      Wizard.AddInfoPage(_T("DIntro"), intro_msg); // intro
      Wizard.AddProjectPathPage(); // select project name and path
+     Wizard.AddCompilerPage(_T(""), _T("dmd1;dmd2;gdc"), true, true); // select compiler and configurations
      // nothing more needs to be done here
  }
 
***************
*** 29,35 ****
  function SetupProject(project)
  {
      // enable compiler warnings (project-wide)
-     if (Wizard.GetCompilerID().Matches(_T("gdc")))
          WarningsOn(project, Wizard.GetCompilerID());
 
      // Debug build target
--- 29,35 ----
  function SetupProject(project)
  {
      // enable compiler warnings (project-wide)
+     if (Wizard.GetCompilerID().Matches(_T("dmd1")))
          WarningsOn(project, Wizard.GetCompilerID());
 
      // Debug build target

--- End code ---

./src/sdk/resources/lexers/lexer_d.sample.rej

--- Code: ---***************
*** 1,13 ****
- /*
-  * Sample preview code
-  * This is a block comment
   */

- /++
- A Super Block
-  ++/
 
- import std.file;
 
  /**
    * This is a documentation comment block
--- 1,12 ----
+ /**
+  * This is a Ddoc block comment
+  * Authors: Melvin D. Nerd, melvin@mailinator.com
+  * Bugs:    Doesn't work for negative values.
+  * Date:    March 14, 2003
   */
 
+ module hello;
+ import std.stdio;
 
  /**
    * This is a documentation comment block
***************
*** 15,33 ****
    * @authr some user (this is the documentation keyword error)
    */
 
- int main(char[] args)
  {
- /// This is a documentation comment line
- int[20] numbers;
  int average = 0;
  char ch = '\n';
- for (int i = 0; i < 20; ++i) // a breakpoint is set
- {
- numbers[i] = i; // active line (during debugging)
- total += i; // error line
- }
- average = total / 20;
- printf("%d\n%d\n", numbers[0], numbers[19]);
- printf("total: %d average: %d\n", total, average);
  }
-
--- 14,65 ----
    * @authr some user (this is the documentation keyword error)
    */
 
+ void main(string[] args)
  {
+     /*
+      * Sample preview code
+      * This is a block comment
+      */
+
+     /// Deprecated: superseded by function bar().
+     void foo() {  }
+
+     int numbers[20];
  int average = 0;
  char ch = '\n';
+     int a =     /+ Nested Comment +/ 1;
+     int b = 2;  // Line Comment
+
+     writefln("Hello World, Reloaded");
+
+     // auto type inference and built-in foreach
+     foreach (argc, argv; args)
+     {
+         // Improved typesafe printf
+         writeln("argc: ", argc, " arg: ", argv);
+     }
+
+     // Nested structs and classes
+     struct specs
+     {
+         // all members automatically initialized
+         int count, allocated;
+     }
+
+     // Nested functions can refer to outer
+     // variables like args
+     specs argspecs()
+     {
+         specs* s = new specs;
+         // no need for '->'
+         s.count = args.length;        // get length of array with .length
+         s.allocated = typeof(args).sizeof; // built-in native type properties
+         foreach (argv; args)
+             s.allocated += argv.length * typeof(argv[0]).sizeof;
+         return *s;
+     }
+
+     // built-in string and common string operations
+     writefln("argc = %d, " ~ "allocated = %d",
+ argspecs().count, argspecs().allocated);
  }

--- End code ---

./src/sdk/resources/lexers/lexer_d.xml.rej

--- Code: ---***************
*** 3,102 ****
  <CodeBlocks_lexer_properties>
  <Lexer name="D"
  index="79"
- filemasks="*.d,*.dmd,*.di">
  <Style name="Default"
  index="0"
  fg="0,0,0"
- bg="255,255,255"
  bold="0"
  italics="0"
  underlined="0"/>
- <Style name="Comment (normal)"
- index="1,2"
- fg="160,160,160"/>
  <Style name="Comment (nested)"
  index="4"
- fg="160,160,160"/>
- <Style name="Comment (documentation)"
- index="3,15"
- fg="128,128,255"
- bold="1"/>
- <Style name="Comment keyword (documentation)"
- index="16"
- fg="0,128,128"/>
- <Style name="Comment keyword error (documentation)"
- index="17"
- fg="128,0,0"/>
  <Style name="Number"
  index="5"
- fg="240,0,240"/>
- <Style name="Keyword"
- index="6,7"
- fg="0,0,160"
- bold="1"/>
- <Style name="User keyword"
  index="8"
- fg="0,160,0"
- bold="1"/>
- <Style name="Typedef"
  index="9"
- fg="0,160,0"/>
  <Style name="String"
- index="10,11"
- fg="0,0,255"/>
  <Style name="Character"
  index="12"
- fg="224,160,0"/>
  <Style name="Operator"
  index="13"
- fg="255,0,0"/>
  <Style name="Selection"
  index="-99"
- bg="192,192,192"/>
  <Style name="Active line"
  index="-98"
- bg="255,255,160"/>
  <Style name="Breakpoint line"
  index="-2"
- bg="255,160,160"/>
  <Style name="Debugger active line"
  index="-3"
- bg="160,160,255"/>
  <Style name="Compiler error line"
  index="-4"
- bg="255,128,0"/>
  <Style name="Matching brace highlight"
  index="34"
  fg="255,0,0"
- bold="1"
- underlined="1"/>
  <Style name="No matching brace highlight"
  index="35"
  bg="255,0,0"/>
  <Keywords>
- <Language index="0"
- value="abstract alias align asm assert auto
- body bool break byte
- case cast catch cdouble cent cfloat char
- class const continue creal
- dchar debug default delegate delete
- deprecated do double
- else enum export extern
- false final finally float for foreach foreach_reverse function
- goto
- idouble if ifloat import in inout int interface invariant ireal is
- lazy long
- macro mixin module
- new null out override
- package pragma private protected public
- real ref return
- scope short static struct super switch synchronized
- template this throw true try typedef typeid typeof
- ubyte ucent uint ulong union unittest ushort
- version void volatile
- wchar while with"/>
- <User index="1"/>
- <Documentation index="2"
  value="a addindex addtogroup anchor arg attention
  author b brief bug c class code date def defgroup deprecated dontinclude
  e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception
--- 3,117 ----
  <CodeBlocks_lexer_properties>
  <Lexer name="D"
  index="79"
+ filemasks="*.d,*.dd,*.di">
  <Style name="Default"
  index="0"
  fg="0,0,0"
+ bg="239,240,225"
  bold="0"
  italics="0"
  underlined="0"/>
+ <Style name="Comment"
+ index="1"
+ fg="0,128,0"/>
+ <Style name="Commentline"
+ index="2"
+ fg="0,128,0"/>
+ <Style name="Comment (doc)"
+ index="3"
+ fg="107,107,107"
+ italics="1"/>
  <Style name="Comment (nested)"
  index="4"
+ fg="107,107,107"
+ italics="1"/>
  <Style name="Number"
  index="5"
+ fg="0,100,100"/>
+ <Style name="Keyword 1"
+ index="6"
+ fg="0,0,255"/>
+ <Style name="Keyword 2"
+ index="7"
+ fg="0,0,255"/>
+ <Style name="Keyword 3"
  index="8"
+ fg="0,0,255"/>
+ <Style name="Keyword 4"
  index="9"
+ fg="0,0,255"/>
  <Style name="String"
+ index="10,11,18"
+ fg="219,0,14"/>
+ <Style name="Rawstring"
+ index="19"
+ fg="219,0,14"/>
  <Style name="Character"
  index="12"
+ fg="193,135,0"/>
  <Style name="Operator"
  index="13"
+ fg="0,0,0"/>
+ <Style name="Identifier"
+ index="14"
+ fg="0,0,0"/>
+ <Style name="Commentline (doc)"
+ index="15"
+ fg="107,107,107"
+ italics="1"/>
+ <Style name="Comment keyword (doc)"
+ index="16"
+ fg="0,128,128"
+ italics="1"/>
+ <Style name="Comment keyword error (doc)"
+ index="17"
+ fg="128,0,0"
+ italics="1"
+ bold="1"/>
+ <Style name="Keyword 5"
+ index="20"
+ fg="0,113,240"/>
+ <Style name="Keyword 6"
+ index="21"
+ fg="0,0,102"/>
+ <Style name="Keyword 7"
+ index="22"
+ fg="153,0,112"/>
  <Style name="Selection"
  index="-99"
+ bg="10,36,106"
+ fg="255,255,255"/>
  <Style name="Active line"
  index="-98"
+ bg="231,231,232"/>
  <Style name="Breakpoint line"
  index="-2"
+ bg="150,58,70"
+ fg="255,255,255"/>
  <Style name="Debugger active line"
  index="-3"
+ bg="53,61,100"
+ fg="0,0,0"/>
  <Style name="Compiler error line"
  index="-4"
+ underlined="1"/>
  <Style name="Matching brace highlight"
  index="34"
  fg="255,0,0"
+ bold="1"/>
  <Style name="No matching brace highlight"
  index="35"
  bg="255,0,0"/>
  <Keywords>
+ <Set index="0" value="void byte bool ubyte short ushort int uint long ulong cent ucent float double real ifloat
+ idouble ireal cfloat cdouble creal char wchar dchar body asm bool true false function delegate"/>
+ <Set index="1" value="public private protected with extern
+ final abstract override const debug version pragma public private deprecated protected volatile
+ class struct interface enum new this null delete invariant super union template
+
+ is import module alias typedef with cast package typeof typeid classinfo mixin
+ in out const static inout lazy ref extern export auto align scope pure"/>
+ <Set index="2"
  value="a addindex addtogroup anchor arg attention
  author b brief bug c class code date def defgroup deprecated dontinclude
  e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception
***************
*** 107,112 ****
  sa section see showinitializer since skip skipline struct subsection
  test throw todo typedef union until
  var verbatim verbinclude version warning weakgroup $ @ \ & < > # { }"/>
  </Keywords>
  <SampleCode value="lexer_d.sample"
  breakpoint_line="20"
--- 122,129 ----
  sa section see showinitializer since skip skipline struct subsection
  test throw todo typedef union until
  var verbatim verbinclude version warning weakgroup $ @ \ & < > # { }"/>
+ <Set index="3"
+ value="if for foreach while do assert return unittest try catch else throw switch case break continue default finally goto synchronized"/>
  </Keywords>
  <SampleCode value="lexer_d.sample"
  breakpoint_line="20"

--- End code ---
[/code]

MortenMacFly:

--- Quote from: bernard on March 29, 2010, 09:11:07 am ---
--- Code: ---[...]
--- End code ---

--- End quote ---
Applied just nice over here. Are you sure you are using trunk? It might be an issue with the line feeds on Linux. Take in mind that this patch was for Windows atm. Try a dos2unix at the patch file before applying it under Linux.

nocide:
Hello bernard!

I just tried it myself and it works just fine.
It may be as Morten mentioned, that the lineendings make problems.
So I created a new patch (same content) with unix lineendigns (see post 1)

greets
nocide

nocide:
push (see post 1)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version