root/trunk/src/tutorials/d2html/keywords.d

Revision 6, 1.9 kB (checked in by jcc7, 3 years ago)

Made more progress in developing convertToWiki and added some files.

Line 
1 module keywords;
2
3 import std.math;
4
5 const int SomeInteger = 1_000;
6
7
8 deprecated int someFunction(in int InVariable, out int OutVariable, inout int InOutVariable)
9 { 
10     switch(InVariable)
11     {
12         case 1: break;
13         case 2: break;
14         default: break;
15     }
16
17     try {  } catch {  } finally {  }
18     assert(cast(bit) 1);
19     //throw Error;
20    
21     return 0;
22 }
23
24 class AbstractClass
25 { 
26     abstract void Whatever();
27    
28 }
29
30
31 class ParentClass
32 {
33     this() {  }
34 }
35
36
37 class SomeClass: ParentClass
38 { 
39     private int PrivateInt;
40     protected int ProtectedInt;
41     public static int PublicInt;
42    
43     this() {super();}
44 }
45
46
47 alias int MyInt;
48
49 enum{ MyValue }
50
51 export extern(Windows) interface MyInterface {  }
52
53
54 /+
55 auto 
56 align
57 auto
58 body
59 continue
60 debug
61 delegate
62 delete
63 do
64 final
65 finally
66 for
67 foreach
68 function
69 instance
70 invariant
71 override
72 pragma
73 synchronized
74 template
75 throw
76 typeof
77 volatile
78 while
79 +/
80
81 typedef int StrongInt;
82
83 union MyUnion{  }
84
85 struct MyStruct {  }
86
87 unittest {  }
88
89 version(Win32) const char[] OS = "Windows";
90
91 void main()
92 { 
93
94     bit BitIdentifier;
95     byte ByteIdentifier;
96     char CharIdentifier;
97 /*  cent CentIdentifier; // reserved for future use */
98     cfloat CfloatIdentifier;
99     cdouble CdoubleIdentifier;
100     creal CrealIdentifier;
101     dchar DcharIdentifier;
102     double DoubleIdentifier;
103     float FloatIdentifier;
104     idouble IdoubleIdentifier;
105     ifloat IfloatIdentifier;
106     int IntIdentifier;
107     ireal IrealIdentifier;
108     long LongIdentifier;
109     real RealIdentifier;
110     short ShortIdentifier;
111     ubyte UbyteIdentifier;
112 /*  ucent UcentIdentifier; // reserved for future use */
113     uint UintIdentifier;
114     ulong UlongIdentifier;
115     ushort UshortIdentifier;
116     wchar WcharIdentifier;
117
118     SomeClass SomeClassObject = new SomeClass();
119     if(SomeClassObject is null)
120         BitIdentifier = true;
121     else
122         BitIdentifier = false;
123    
124    
125     goto SomeLabel;
126    
127 SomeLabel:          
128     with(SomeClassObject) PublicInt = 5;
129    
130    
131     asm{  }
132
133
134 }
Note: See TracBrowser for help on using the browser.