Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit e290e3b

Browse files
author
Stephen Hawley
committed
Elememt -> Element
1 parent 3e93181 commit e290e3b

28 files changed

+143
-144
lines changed

Dynamo/Dynamo.CSLang/CSAttribute.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ public class CSAttribute : LineCodeElementCollection<ICodeElement> {
99
public CSAttribute (CSIdentifier name, CSArgumentList args, bool isSingleLine = false)
1010
: base (isSingleLine, false, isSingleLine)
1111
{
12-
Add (new SimpleElememt ("["));
12+
Add (new SimpleElement ("["));
1313
Add (Exceptions.ThrowOnNull (name, nameof(name)));
1414
if (args != null) {
15-
Add (new SimpleElememt ("("));
15+
Add (new SimpleElement ("("));
1616
Add (args);
17-
Add (new SimpleElememt (")"));
17+
Add (new SimpleElement (")"));
1818
}
19-
Add (new SimpleElememt ("]"));
19+
Add (new SimpleElement ("]"));
2020
}
2121

2222
public CSAttribute (string name, CSArgumentList args)

Dynamo/Dynamo.CSLang/CSBinding.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public IEnumerable<ICodeElement> Elements {
6868
get {
6969
yield return Name;
7070
if (Value != null) {
71-
yield return new SimpleElememt (" = ", true);
71+
yield return new SimpleElement (" = ", true);
7272
yield return Value;
7373
}
7474
}

Dynamo/Dynamo.CSLang/CSClass.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,20 @@ public IEnumerable<ICodeElement> Elements {
109109
get {
110110
var decl = new LineCodeElementCollection<ICodeElement> (true, false, true);
111111
if (Visibility != CSVisibility.None)
112-
decl.Add (new SimpleElememt (CSMethod.VisibilityToString (Visibility) + " "));
112+
decl.Add (new SimpleElement (CSMethod.VisibilityToString (Visibility) + " "));
113113
if (IsStatic)
114-
decl.Add (new SimpleElememt ("static ", true));
114+
decl.Add (new SimpleElement ("static ", true));
115115
if (IsSealed)
116-
decl.Add (new SimpleElememt ("sealed ", true));
116+
decl.Add (new SimpleElement ("sealed ", true));
117117
decl.Add (new CSIdentifier (EntityLabel + " "));
118118
decl.Add (Name);
119119
decl.Add (GenericParams);
120120
if (Inheritance.Count > 0) {
121-
decl.Add (new SimpleElememt (" : ", true));
121+
decl.Add (new SimpleElement (" : ", true));
122122
decl.Add (Inheritance);
123123
}
124124
if (GenericConstraints.Count > 0) {
125-
decl.Add (SimpleElememt.Spacer);
125+
decl.Add (SimpleElement.Spacer);
126126
decl.Add (GenericConstraints);
127127
}
128128
yield return decl;
@@ -135,7 +135,7 @@ public IEnumerable<ICodeElement> Elements {
135135

136136
if (StaticConstructor.Count > 0) {
137137
var m = new CSMethod (CSVisibility.None, CSMethodKind.Static,
138-
null, Name, new CSParameterList (), StaticConstructor);
138+
null, Name, new CSParameterList (), StaticConstructor);
139139
contents.Add (m);
140140
}
141141
contents.AddRange (Constructors);

Dynamo/Dynamo.CSLang/CSConditionalCompilation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class CSConditionalCompilation : LineCodeElementCollection<ICodeElement>
1111
{
1212
Add (tag);
1313
if ((object)condition != null) {
14-
Add (SimpleElememt.Spacer);
14+
Add (SimpleElement.Spacer);
1515
Add (condition);
1616
}
1717
}

Dynamo/Dynamo.CSLang/CSEnum.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public IEnumerable<ICodeElement> Elements {
6464
get {
6565
var decl = new LineCodeElementCollection<ICodeElement> (true, false, true);
6666
if (Visibility != CSVisibility.None)
67-
decl.Add (new SimpleElememt (CSMethod.VisibilityToString (Visibility) + " "));
67+
decl.Add (new SimpleElement (CSMethod.VisibilityToString (Visibility) + " "));
6868
decl.Add (new CSIdentifier ("enum" + " "));
6969
decl.Add (Name);
7070

7171
if (OptionalType != null) {
72-
decl.Add (new SimpleElememt (" : ", true));
72+
decl.Add (new SimpleElement (" : ", true));
7373
decl.Add (OptionalType);
7474
}
7575
yield return decl;

Dynamo/Dynamo.CSLang/CSFieldDeclaration.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public CSVariableDeclaration (CSType type, IEnumerable<CSBinding> bindings)
1212
: base (null, false, true)
1313
{
1414
Type = Exceptions.ThrowOnNull (type, "type");
15-
And (Type).And (SimpleElememt.Spacer);
15+
And (Type).And (SimpleElement.Spacer);
1616
Bindings = new CommaListElementCollection<CSBinding> (Exceptions.ThrowOnNull (bindings, "bindings"));
1717
Add (Bindings);
1818
}
@@ -59,16 +59,16 @@ public CSFieldDeclaration (CSType type, IEnumerable<CSBinding> bindings, CSVisib
5959
Visibilty = vis;
6060
IsStatic = isStatic;
6161
if (isReadonly) {
62-
this.Insert (0, new SimpleElememt ("readonly"));
63-
this.Insert (1, SimpleElememt.Spacer);
62+
this.Insert (0, new SimpleElement ("readonly"));
63+
this.Insert (1, SimpleElement.Spacer);
6464
}
6565
if (isStatic) {
66-
this.Insert (0, new SimpleElememt ("static"));
67-
this.Insert (1, SimpleElememt.Spacer);
66+
this.Insert (0, new SimpleElement ("static"));
67+
this.Insert (1, SimpleElement.Spacer);
6868
}
6969
if (vis != CSVisibility.None) {
70-
this.Insert (0, new SimpleElememt (CSMethod.VisibilityToString (vis)));
71-
this.Insert (1, SimpleElememt.Spacer);
70+
this.Insert (0, new SimpleElement (CSMethod.VisibilityToString (vis)));
71+
this.Insert (1, SimpleElement.Spacer);
7272
}
7373
}
7474

Dynamo/Dynamo.CSLang/CSForEach.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override void LLWrite (ICodeWriter writer, object o)
2727
} else {
2828
writer.Write ("var", false);
2929
}
30-
SimpleElememt.Spacer.WriteAll (writer);
30+
SimpleElement.Spacer.WriteAll (writer);
3131
Ident.WriteAll (writer);
3232
writer.Write (" in ", true);
3333
Expr.WriteAll (writer);

Dynamo/Dynamo.CSLang/CSGenericTypeDeclaration.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ public CSGenericTypeDeclarationCollection ()
2323
public IEnumerable<ICodeElement> Elements {
2424
get {
2525
if (this.Count > 0) {
26-
yield return new SimpleElememt ("<");
26+
yield return new SimpleElement ("<");
2727
bool first = true;
2828
foreach (CSGenericTypeDeclaration decl in this) {
2929
if (!first) {
30-
yield return new SimpleElememt (",", true);
31-
yield return SimpleElememt.Spacer;
30+
yield return new SimpleElement (",", true);
31+
yield return SimpleElement.Spacer;
3232
} else {
3333
first = false;
3434
}
3535
yield return decl.Name;
3636
}
37-
yield return new SimpleElememt (">");
37+
yield return new SimpleElement (">");
3838
}
3939
}
4040
}

Dynamo/Dynamo.CSLang/CSInitializer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public CSInitializedType (CSFunctionCall call, IEnumerable<CSBaseExpression> par
3939
protected override void LLWrite (ICodeWriter writer, object o)
4040
{
4141
Call.WriteAll (writer);
42-
SimpleElememt.Spacer.WriteAll (writer);
42+
SimpleElement.Spacer.WriteAll (writer);
4343
Initializer.WriteAll (writer);
4444
}
4545
}

Dynamo/Dynamo.CSLang/CSInterface.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ public IEnumerable<ICodeElement> Elements {
8787
get {
8888
var decl = new LineCodeElementCollection<ICodeElement> (true, false, true);
8989
if (Visibility != CSVisibility.None)
90-
decl.Add (new SimpleElememt (CSMethod.VisibilityToString (Visibility) + " "));
90+
decl.Add (new SimpleElement (CSMethod.VisibilityToString (Visibility) + " "));
9191
decl.Add (new CSIdentifier ("interface "));
9292
decl.Add (Name);
9393

9494
decl.Add (GenericParams);
9595
if (Inheritance.Count > 0) {
96-
decl.Add (new SimpleElememt (" : ", true));
96+
decl.Add (new SimpleElement (" : ", true));
9797
decl.Add (Inheritance);
9898
}
9999
if (GenericConstraints.Count > 0) {
100-
decl.Add (SimpleElememt.Spacer);
100+
decl.Add (SimpleElement.Spacer);
101101
decl.Add (GenericConstraints);
102102
}
103103
yield return decl;

Dynamo/Dynamo.CSLang/CSMethod.cs

+18-18
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ public class CSMethod : CodeElementCollection<ICodeElement> {
1111
public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier name, CSParameterList parms, CSCodeBlock body)
1212
: this (vis, kind, type, name, parms, null, false, body)
1313
{
14-
14+
1515
}
1616
public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier name,
17-
CSParameterList parms, CSBaseExpression[] baseOrThisCallParms, bool callsBase, CSCodeBlock body, bool isSealed = false)
17+
CSParameterList parms, CSBaseExpression [] baseOrThisCallParms, bool callsBase, CSCodeBlock body, bool isSealed = false)
1818
{
1919
GenericParameters = new CSGenericTypeDeclarationCollection ();
2020
GenericConstraints = new CSGenericConstraintCollection ();
2121
Visibility = vis;
2222
Kind = kind;
2323
Type = type; // no throw on null - could be constructor
24-
Name = Exceptions.ThrowOnNull (name, nameof(name));
25-
Parameters = Exceptions.ThrowOnNull (parms, nameof(parms));
24+
Name = Exceptions.ThrowOnNull (name, nameof (name));
25+
Parameters = Exceptions.ThrowOnNull (parms, nameof (parms));
2626
CallsBase = callsBase;
2727
BaseOrThisCallParameters = baseOrThisCallParms;
2828

@@ -31,25 +31,25 @@ public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier
3131

3232
LineCodeElementCollection<ICodeElement> lc = new LineCodeElementCollection<ICodeElement> (new ICodeElement [0], false, true);
3333
if (vis != CSVisibility.None) {
34-
lc.And (new SimpleElememt (VisibilityToString (vis))).And (SimpleElememt.Spacer);
34+
lc.And (new SimpleElement (VisibilityToString (vis))).And (SimpleElement.Spacer);
3535
}
3636

3737
if (isSealed) {
38-
lc.And (new SimpleElememt ("sealed")).And (SimpleElememt.Spacer);
38+
lc.And (new SimpleElement ("sealed")).And (SimpleElement.Spacer);
3939
}
4040

41-
lc.And (new SimpleElememt (MethodKindToString (kind))).And (SimpleElememt.Spacer);
41+
lc.And (new SimpleElement (MethodKindToString (kind))).And (SimpleElement.Spacer);
4242

4343
if (type != null) {
44-
lc.And (type).And (SimpleElememt.Spacer);
44+
lc.And (type).And (SimpleElement.Spacer);
4545
}
4646

47-
lc.And (name).And (GenericParameters).And (new SimpleElememt ("(")).And (parms).And (new SimpleElememt (")")).And (GenericConstraints);
47+
lc.And (name).And (GenericParameters).And (new SimpleElement ("(")).And (parms).And (new SimpleElement (")")).And (GenericConstraints);
4848
if (body == null) {
4949
if (!(kind == CSMethodKind.StaticExtern || kind == CSMethodKind.Interface))
50-
throw new ArgumentException ("Method body is only optional when method kind kind is either StaticExtern or Interface",
51-
nameof(body));
52-
lc.Add (new SimpleElememt (";"));
50+
throw new ArgumentException ("Method body is only optional when method kind kind is either StaticExtern or Interface",
51+
nameof (body));
52+
lc.Add (new SimpleElement (";"));
5353
}
5454
Add (lc);
5555
if (BaseOrThisCallParameters != null) {
@@ -65,7 +65,7 @@ public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier
6565
public CSIdentifier Name { get; private set; }
6666
public CSParameterList Parameters { get; private set; }
6767
public bool CallsBase { get; private set; }
68-
public CSBaseExpression[] BaseOrThisCallParameters { get; private set; }
68+
public CSBaseExpression [] BaseOrThisCallParameters { get; private set; }
6969
public CSCodeBlock Body { get; private set; }
7070
public CSGenericTypeDeclarationCollection GenericParameters { get; private set; }
7171
public CSGenericConstraintCollection GenericConstraints { get; private set; }
@@ -143,7 +143,7 @@ public static string MethodKindToString (CSMethodKind kind)
143143
case CSMethodKind.Abstract:
144144
return "abstract";
145145
default:
146-
throw new ArgumentOutOfRangeException (nameof(kind));
146+
throw new ArgumentOutOfRangeException (nameof (kind));
147147
}
148148
}
149149

@@ -162,21 +162,21 @@ public static CSMethod PublicConstructor (string name, CSParameterList parms, CS
162162
return new CSMethod (CSVisibility.Public, CSMethodKind.None, null, new CSIdentifier (name), parms, Exceptions.ThrowOnNull (body, "body"));
163163
}
164164

165-
public static CSMethod PublicConstructor (string name, CSParameterList parms, CSCodeBlock body, params CSBaseExpression[] baseParams)
165+
public static CSMethod PublicConstructor (string name, CSParameterList parms, CSCodeBlock body, params CSBaseExpression [] baseParams)
166166
{
167167
return new CSMethod (CSVisibility.Public, CSMethodKind.None, null, new CSIdentifier (name), parms,
168-
baseParams, true, Exceptions.ThrowOnNull (body, "body"));
168+
baseParams, true, Exceptions.ThrowOnNull (body, "body"));
169169
}
170170

171171
public static CSMethod PrivateConstructor (string name, CSParameterList parms, CSCodeBlock body)
172172
{
173173
return new CSMethod (CSVisibility.None, CSMethodKind.None, null, new CSIdentifier (name), parms, Exceptions.ThrowOnNull (body, "body"));
174174
}
175175

176-
public static CSMethod PrivateConstructor (string name, CSParameterList parms, CSCodeBlock body, params CSBaseExpression[] baseParams)
176+
public static CSMethod PrivateConstructor (string name, CSParameterList parms, CSCodeBlock body, params CSBaseExpression [] baseParams)
177177
{
178178
return new CSMethod (CSVisibility.None, CSMethodKind.None, null, new CSIdentifier (name), parms,
179-
baseParams, true, Exceptions.ThrowOnNull (body, "body"));
179+
baseParams, true, Exceptions.ThrowOnNull (body, "body"));
180180
}
181181

182182
public static CSMethod PInvoke (CSVisibility vis, CSType type, string name, string dllName, string externName, CSParameterList parms)

Dynamo/Dynamo.CSLang/CSProperty.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public CSProperty (CSType type, CSMethodKind kind,
3030
CSVisibility getVis, CSCodeBlock getter,
3131
CSVisibility setVis, CSCodeBlock setter, CSParameterList parms)
3232
: this (type, kind, new CSIdentifier ("this"), getVis, getter, setVis, setter,
33-
Exceptions.ThrowOnNull (parms, nameof(parms)))
33+
Exceptions.ThrowOnNull (parms, nameof (parms)))
3434
{
3535
}
3636

@@ -46,17 +46,17 @@ public CSProperty (CSType type, CSMethodKind kind,
4646
GetterVisibility = getVis;
4747
SetterVisibility = setVis;
4848
CSVisibility bestVis = (CSVisibility)Math.Min ((int)getVis, (int)setVis);
49-
decl.And (new SimpleElememt (CSMethod.VisibilityToString (bestVis))).And (SimpleElememt.Spacer);
49+
decl.And (new SimpleElement (CSMethod.VisibilityToString (bestVis))).And (SimpleElement.Spacer);
5050
if (kind != CSMethodKind.None)
51-
decl.And (new SimpleElememt (CSMethod.MethodKindToString (kind))).And (SimpleElememt.Spacer);
51+
decl.And (new SimpleElement (CSMethod.MethodKindToString (kind))).And (SimpleElement.Spacer);
5252

5353
PropType = type;
5454
Name = name;
5555

56-
decl.And (Exceptions.ThrowOnNull (type, "type")).And (SimpleElememt.Spacer)
57-
.And (Exceptions.ThrowOnNull (name, nameof(name)));
56+
decl.And (Exceptions.ThrowOnNull (type, "type")).And (SimpleElement.Spacer)
57+
.And (Exceptions.ThrowOnNull (name, nameof (name)));
5858
if (parms != null) {
59-
decl.And (new SimpleElememt ("[", true)).And (parms).And (new SimpleElememt ("]"));
59+
decl.And (new SimpleElement ("[", true)).And (parms).And (new SimpleElement ("]"));
6060
}
6161
Add (decl);
6262

@@ -68,7 +68,7 @@ public CSProperty (CSType type, CSMethodKind kind,
6868
LineCodeElementCollection<ICodeElement> getLine = MakeEtter (getVis, "get", unifiedVis, getVis > setVis);
6969
cb.Add (getLine);
7070
if (getter.Count () == 0) {
71-
getLine.Add (new SimpleElememt (";"));
71+
getLine.Add (new SimpleElement (";"));
7272
} else {
7373
cb.Add (getter);
7474
}
@@ -78,7 +78,7 @@ public CSProperty (CSType type, CSMethodKind kind,
7878
LineCodeElementCollection<ICodeElement> setLine = MakeEtter (setVis, "set", unifiedVis, setVis > getVis);
7979
cb.Add (setLine);
8080
if (setter.Count () == 0) {
81-
setLine.Add (new SimpleElememt (";"));
81+
setLine.Add (new SimpleElement (";"));
8282
} else {
8383
cb.Add (setter);
8484
}
@@ -101,8 +101,8 @@ static LineCodeElementCollection<ICodeElement> MakeEtter (CSVisibility vis, stri
101101
{
102102
LineCodeElementCollection<ICodeElement> getLine = new LineCodeElementCollection<ICodeElement> (null, false, true);
103103
if (!unifiedVis && vis != CSVisibility.None && moreRestrictiveVis)
104-
getLine.And (new SimpleElememt (CSMethod.VisibilityToString (vis))).And (SimpleElememt.Spacer);
105-
return getLine.And (new SimpleElememt (getset, false));
104+
getLine.And (new SimpleElement (CSMethod.VisibilityToString (vis))).And (SimpleElement.Spacer);
105+
return getLine.And (new SimpleElement (getset, false));
106106
}
107107

108108
public static CSProperty PublicGetSet (CSType type, string name)
@@ -121,7 +121,7 @@ static CSProperty PublicGetPubPrivSetBacking (CSType type, string name, bool dec
121121
{
122122
if (!declareField && backingFieldName == null)
123123
throw new ArgumentException ("declareField must be true if there is no supplied field name", nameof (declareField));
124-
backingFieldName = backingFieldName ?? MassageName (Exceptions.ThrowOnNull (name, nameof(name)));
124+
backingFieldName = backingFieldName ?? MassageName (Exceptions.ThrowOnNull (name, nameof (name)));
125125

126126

127127
CSIdentifier backingIdent = new CSIdentifier (backingFieldName);
@@ -159,7 +159,7 @@ public static CSProperty PublicGetBacking (CSType type, CSIdentifier name, CSIde
159159
new ICodeElement [] {
160160
CSReturn.ReturnLine (Exceptions.ThrowOnNull(backingFieldName, nameof(backingFieldName)))
161161
}, false, true);
162-
CSProperty prop = new CSProperty (type, methodKind, Exceptions.ThrowOnNull (name, nameof(name)),
162+
CSProperty prop = new CSProperty (type, methodKind, Exceptions.ThrowOnNull (name, nameof (name)),
163163
CSVisibility.Public, new CSCodeBlock (getCode),
164164
CSVisibility.Public, null);
165165
if (includeBackingFieldDeclaration)
@@ -171,9 +171,9 @@ public static CSProperty PublicGetBacking (CSType type, CSIdentifier name, CSIde
171171
public static CSProperty PublicGetBacking (CSType type, string name, string backingFieldName, bool includeBackingFieldDeclaration = false)
172172
{
173173
return PublicGetBacking (type,
174-
new CSIdentifier (Exceptions.ThrowOnNull (name, nameof (name))),
175-
new CSIdentifier (Exceptions.ThrowOnNull (backingFieldName, nameof (backingFieldName))),
176-
includeBackingFieldDeclaration);
174+
new CSIdentifier (Exceptions.ThrowOnNull (name, nameof (name))),
175+
new CSIdentifier (Exceptions.ThrowOnNull (backingFieldName, nameof (backingFieldName))),
176+
includeBackingFieldDeclaration);
177177
}
178178

179179
static string MassageName (string name)

Dynamo/Dynamo.CSLang/CSTryCatch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override void LLWrite (ICodeWriter writer, object o)
3838
writer.Write ("(", false);
3939
CatchType.WriteAll (writer);
4040
if ((object)Name != null) {
41-
SimpleElememt.Spacer.WriteAll (writer);
41+
SimpleElement.Spacer.WriteAll (writer);
4242
Name.WriteAll (writer);
4343
}
4444
writer.Write (")", false);
@@ -56,7 +56,7 @@ public CSTryCatch (CSCodeBlock tryBlock, params CSCatch [] catchBlocks)
5656
CatchBlocks = new CodeElementCollection<CSCatch> ();
5757
CatchBlocks.AddRange (catchBlocks);
5858

59-
Add (new SimpleElememt ("try ", true));
59+
Add (new SimpleElement ("try ", true));
6060
Add (TryBlock);
6161
Add (CatchBlocks);
6262
}

0 commit comments

Comments
 (0)