Permalink
Browse files

More FxCop fixes

  • Loading branch information...
1 parent 6fe8322 commit d493ec73accab44efaa1208281dbc318a6b802be @dmiller dmiller committed Jul 30, 2011
Showing with 5,870 additions and 28,811 deletions.
  1. +4 −4 Clojure/Clojure.Compile/Compile.cs
  2. +1 −1 Clojure/Clojure.Source/clojure/core.clj
  3. +1 −1 Clojure/Clojure.Source/clojure/test_clojure/serialization.clj
  4. +1 −1 Clojure/Clojure.Tests/LibTests/BigIntegerTests.cs
  5. +51 −51 Clojure/Clojure.Tests/LibTests/LispReaderTests.cs
  6. +1 −1 Clojure/Clojure/CljCompiler/Ast/BodyExpr.cs
  7. +6 −6 Clojure/Clojure/CljCompiler/Ast/CaseExpr.cs
  8. +3 −3 Clojure/Clojure/CljCompiler/Ast/ConstantExpr.cs
  9. +9 −9 Clojure/Clojure/CljCompiler/Ast/DefExpr.cs
  10. +6 −6 Clojure/Clojure/CljCompiler/Ast/FnExpr.cs
  11. +9 −9 Clojure/Clojure/CljCompiler/Ast/HostExpr.cs
  12. +1 −1 Clojure/Clojure/CljCompiler/Ast/IfExpr.cs
  13. +1 −1 Clojure/Clojure/CljCompiler/Ast/ImportExpr.cs
  14. +1 −1 Clojure/Clojure/CljCompiler/Ast/InstanceFieldExpr.cs
  15. +1 −1 Clojure/Clojure/CljCompiler/Ast/InstanceZeroArityCallExpr.cs
  16. +2 −2 Clojure/Clojure/CljCompiler/Ast/InvokeExpr.cs
  17. +1 −1 Clojure/Clojure/CljCompiler/Ast/LetExpr.cs
  18. +1 −1 Clojure/Clojure/CljCompiler/Ast/MapExpr.cs
  19. +1 −1 Clojure/Clojure/CljCompiler/Ast/MonitorEnterExpr.cs
  20. +1 −1 Clojure/Clojure/CljCompiler/Ast/MonitorExitExpr.cs
  21. +2 −2 Clojure/Clojure/CljCompiler/Ast/NewExpr.cs
  22. +5 −5 Clojure/Clojure/CljCompiler/Ast/NewInstanceExpr.cs
  23. +1 −1 Clojure/Clojure/CljCompiler/Ast/NewInstanceMethod.cs
  24. +27 −15 Clojure/Clojure/CljCompiler/Ast/ObjExpr.cs
  25. +4 −2 Clojure/Clojure/CljCompiler/Ast/ParserContext.cs
  26. +2 −2 Clojure/Clojure/CljCompiler/Ast/RecurExpr.cs
  27. +1 −1 Clojure/Clojure/CljCompiler/Ast/SetExpr.cs
  28. +1 −1 Clojure/Clojure/CljCompiler/Ast/VectorExpr.cs
  29. +60 −52 Clojure/Clojure/CljCompiler/Compiler.cs
  30. +1 −1 Clojure/Clojure/CljCompiler/GenClass.cs
  31. +4 −4 Clojure/Clojure/CljCompiler/GenInterface.cs
  32. +1 −1 Clojure/Clojure/CljCompiler/MethodSignature.cs
  33. +6 −0 Clojure/Clojure/Lib/APersistentMap.cs
  34. +1 −1 Clojure/Clojure/Lib/APersistentSet.cs
  35. +1 −0 Clojure/Clojure/Lib/APersistentVector.cs
  36. +1 −1 Clojure/Clojure/Lib/ARef.cs
  37. +15 −5 Clojure/Clojure/Lib/Agent.cs
  38. +13 −0 Clojure/Clojure/Lib/ArrayHelper.cs
  39. +3 −0 Clojure/Clojure/Lib/Associative.cs
  40. +12 −10 Clojure/Clojure/Lib/Atom.cs
  41. +3 −0 Clojure/Clojure/Lib/AtomicBoolean.cs
  42. +7 −0 Clojure/Clojure/Lib/AtomicInteger.cs
  43. +5 −0 Clojure/Clojure/Lib/AtomicLong.cs
  44. +1 −1 Clojure/Clojure/Lib/BigDecimal.cs
  45. +15 −2 Clojure/Clojure/Lib/BigInt.cs
  46. +5 −5 Clojure/Clojure/Lib/BigInteger.cs
  47. +2 −0 Clojure/Clojure/Lib/ChunkBuffer.cs
  48. +1 −0 Clojure/Clojure/Lib/Counted.cs
  49. +1 −0 Clojure/Clojure/Lib/Delay.cs
  50. +1 −0 Clojure/Clojure/Lib/EnumeratorSeq.cs
  51. +3 −0 Clojure/Clojure/Lib/Future.cs
  52. +1 −0 Clojure/Clojure/Lib/IBlockingDeref.cs
  53. +3 −0 Clojure/Clojure/Lib/IChunk.cs
  54. +5 −0 Clojure/Clojure/Lib/IChunkedSeq.cs
  55. +1 −0 Clojure/Clojure/Lib/IDeref.cs
  56. +1 −0 Clojure/Clojure/Lib/IEditableCollection.cs
  57. +42 −3 Clojure/Clojure/Lib/IFn.cs
  58. +1 −0 Clojure/Clojure/Lib/IKeywordLookup.cs
  59. +2 −0 Clojure/Clojure/Lib/ILookup.cs
  60. +1 −0 Clojure/Clojure/Lib/ILookupSite.cs
  61. +1 −0 Clojure/Clojure/Lib/ILookupThunk.cs
  62. +2 −0 Clojure/Clojure/Lib/IMapEntry.cs
  63. +1 −0 Clojure/Clojure/Lib/IMeta.cs
  64. +1 −0 Clojure/Clojure/Lib/IObj.cs
  65. +1 −0 Clojure/Clojure/Lib/IPending.cs
  66. +5 −0 Clojure/Clojure/Lib/IPersistentCollection.cs
  67. +5 −0 Clojure/Clojure/Lib/IPersistentMap.cs
  68. +4 −0 Clojure/Clojure/Lib/IPersistentSet.cs
  69. +2 −0 Clojure/Clojure/Lib/IPersistentStack.cs
  70. +2 −0 Clojure/Clojure/Lib/IPersistentVector.cs
  71. +5 −0 Clojure/Clojure/Lib/IProxy.cs
  72. +2 −0 Clojure/Clojure/Lib/IReduce.cs
  73. +5 −0 Clojure/Clojure/Lib/IRef.cs
  74. +2 −0 Clojure/Clojure/Lib/IReference.cs
  75. +4 −0 Clojure/Clojure/Lib/ISeq.cs
  76. +1 −0 Clojure/Clojure/Lib/ITransientAssociative.cs
  77. +3 −0 Clojure/Clojure/Lib/ITransientCollection.cs
  78. +1 −0 Clojure/Clojure/Lib/ITransientMap.cs
  79. +5 −0 Clojure/Clojure/Lib/ITransientSet.cs
  80. +3 −0 Clojure/Clojure/Lib/ITransientVector.cs
  81. +2 −0 Clojure/Clojure/Lib/Indexed.cs
  82. +1 −0 Clojure/Clojure/Lib/IndexedSeq.cs
  83. +9 −1 Clojure/Clojure/Lib/JReMatcher.cs
  84. +6 −0 Clojure/Clojure/Lib/Keyword.cs
  85. +3 −1 Clojure/Clojure/Lib/LazilyPersistentVector.cs
  86. +30 −29 Clojure/Clojure/Lib/LispReader.cs
  87. +12 −10 Clojure/Clojure/Lib/LockingTransaction.cs
  88. +8 −7 Clojure/Clojure/Lib/MethodImplCache.cs
  89. +7 −0 Clojure/Clojure/Lib/MultiFn.cs
  90. +2 −0 Clojure/Clojure/Lib/Named.cs
  91. +16 −2 Clojure/Clojure/Lib/Namespace.cs
  92. +365 −73 Clojure/Clojure/Lib/Numbers.cs
  93. +7 −5 Clojure/Clojure/Lib/PersistentArrayMap.cs
  94. +74 −64 Clojure/Clojure/Lib/PersistentHashMap.cs
  95. +7 −0 Clojure/Clojure/Lib/PersistentHashSet.cs
  96. +2 −0 Clojure/Clojure/Lib/PersistentList.cs
  97. +2 −1 Clojure/Clojure/Lib/PersistentQueue.cs
  98. +5 −0 Clojure/Clojure/Lib/PersistentStructMap.cs
  99. +5 −1 Clojure/Clojure/Lib/PersistentTreeMap.cs
  100. +3 −0 Clojure/Clojure/Lib/PersistentTreeSet.cs
  101. +12 −4 Clojure/Clojure/Lib/PersistentVector.cs
  102. +603 −224 Clojure/Clojure/Lib/RT.cs
  103. +2 −2 Clojure/Clojure/Lib/Ratio.cs
  104. +19 −11 Clojure/Clojure/Lib/Ref.cs
  105. +22 −0 Clojure/Clojure/Lib/RestFn.cs
  106. +1 −0 Clojure/Clojure/Lib/Reversible.cs
  107. +1 −0 Clojure/Clojure/Lib/Seqable.cs
  108. +2 −0 Clojure/Clojure/Lib/Settable.cs
  109. +4 −0 Clojure/Clojure/Lib/Sorted.cs
  110. +1 −0 Clojure/Clojure/Lib/StringSeq.cs
  111. +9 −3 Clojure/Clojure/Lib/Symbol.cs
  112. +17 −20 Clojure/Clojure/Lib/Util.cs
  113. +64 −34 Clojure/Clojure/Lib/Var.cs
  114. +2 −0 Clojure/Clojure/Runtime/Properties.cs
  115. +2 −1 Clojure/Clojure/Runtime/Reflector.cs
  116. +4 −4 Clojure/Simple.Console/SimpleConsole.cs
  117. +4,114 −28,097 FxCop/Clojure.FxCop
  118. +6 −0 FxCop/CustomDictionary.xml
@@ -32,7 +32,7 @@ static class Compile
static void Main(string[] args)
{
- TextWriter outTW = (TextWriter)RT.OUT.deref();
+ TextWriter outTW = (TextWriter)RT.OutVar.deref();
TextWriter errTW = RT.errPrintWriter();
string path = Environment.GetEnvironmentVariable(PATH_PROP);
@@ -43,7 +43,7 @@ static void Main(string[] args)
{
errTW.WriteLine("ERROR: Must set system property {0}",PATH_PROP);
errTW.WriteLine("to the location for the compiled .class files.");
- errTW.WriteLine("This directory must also be on your {0}.",RT.CLOJURE_LOAD_PATH);
+ errTW.WriteLine("This directory must also be on your {0}.",RT.ClojureLoadPathString);
Environment.Exit(1);
}
@@ -56,8 +56,8 @@ static void Main(string[] args)
{
Var.pushThreadBindings(RT.map(
Compiler.CompilePathVar, path,
- RT.WARN_ON_REFLECTION, warnOnReflection,
- RT.UNCHECKED_MATH, uncheckedMath
+ RT.WarnOnReflectionVar, warnOnReflection,
+ RT.UncheckedMathVar, uncheckedMath
));
Stopwatch sw = new Stopwatch();
@@ -4367,7 +4367,7 @@
{:added "1.0"
:static true}
[s]
- (contains? (. clojure.lang.Compiler _specials) s)) ;;; specials => _specials, because I'm stubborn
+ (contains? (. clojure.lang.Compiler specials) s))
(defn var?
"Returns true if v is of type clojure.lang.Var"
@@ -126,7 +126,7 @@
(deftest interned-serializations
(are [v] (identical? v (-> v serialize deserialize))
- clojure.lang.RT/DEFAULT_COMPARER ;;; clojure.lang.RT/DEFAULT_COMPARATOR
+ clojure.lang.RT/DefaultComparerInstance ;;; clojure.lang.RT/DEFAULT_COMPARATOR
; namespaces just get deserialized back into the same-named ns in the present runtime
; (they're referred to by defrecord instances)
@@ -615,7 +615,7 @@ public void ToString_detects_radix_too_large()
public void ToString_on_zero_works_for_all_radixes()
{
BigInteger i = new BigInteger(0, new uint[0]);
- for (uint radix = BigInteger.MIN_RADIX; radix <= BigInteger.MAX_RADIX; radix++)
+ for (uint radix = BigInteger.MinRadix; radix <= BigInteger.MaxRadix; radix++)
Expect(i.ToString(radix),EqualTo("0"));
}
@@ -40,9 +40,9 @@ public class LispReaderTests : AssertionHelper
[Test]
public void MatchNumberMatchesZero()
{
- object o1 = LispReader.matchNumber("0");
- object o2 = LispReader.matchNumber("-0");
- object o3 = LispReader.matchNumber("+0");
+ object o1 = LispReader.MatchNumber("0");
+ object o2 = LispReader.MatchNumber("-0");
+ object o3 = LispReader.MatchNumber("+0");
Expect(o1, EqualTo(0));
Expect(o2, EqualTo(0));
@@ -52,10 +52,10 @@ public void MatchNumberMatchesZero()
[Test]
public void MatchNumberMatchesDecimal()
{
- object o1 = LispReader.matchNumber("123");
- object o2 = LispReader.matchNumber("+123");
- object o3 = LispReader.matchNumber("-123");
- object o4 = LispReader.matchNumber("123456789123456789123456789");
+ object o1 = LispReader.MatchNumber("123");
+ object o2 = LispReader.MatchNumber("+123");
+ object o3 = LispReader.MatchNumber("-123");
+ object o4 = LispReader.MatchNumber("123456789123456789123456789");
Expect(o1, EqualTo(123));
Expect(o2, EqualTo(123));
@@ -67,9 +67,9 @@ public void MatchNumberMatchesDecimal()
[Test]
public void MatchNumberMatchesHexadecimal()
{
- object o1 = LispReader.matchNumber("0X12A");
- object o2 = LispReader.matchNumber("0xFFF");
- object o3 = LispReader.matchNumber("0xFFFFFFFFFFFFFFFFFFFFFFFF");
+ object o1 = LispReader.MatchNumber("0X12A");
+ object o2 = LispReader.MatchNumber("0xFFF");
+ object o3 = LispReader.MatchNumber("0xFFFFFFFFFFFFFFFFFFFFFFFF");
Expect(o1, EqualTo(0x12A));
Expect(o2, EqualTo(0xFFF));
@@ -81,10 +81,10 @@ public void MatchNumberMatchesHexadecimal()
[Test]
public void MatchNumberMatchesOctal()
{
- object o1 = LispReader.matchNumber("0123");
- object o2 = LispReader.matchNumber("+0123");
- object o3 = LispReader.matchNumber("-0123");
- object o4 = LispReader.matchNumber("01234567012345670123456777");
+ object o1 = LispReader.MatchNumber("0123");
+ object o2 = LispReader.MatchNumber("+0123");
+ object o3 = LispReader.MatchNumber("-0123");
+ object o4 = LispReader.MatchNumber("01234567012345670123456777");
Expect(o1, EqualTo(83));
Expect(o2, EqualTo(83));
@@ -96,10 +96,10 @@ public void MatchNumberMatchesOctal()
[Test]
public void MatchNumberMatchesSpecifiedRadix()
{
- object o1 = LispReader.matchNumber("2R1100");
- object o2 = LispReader.matchNumber("4R123");
- object o3 = LispReader.matchNumber("-4R123");
- object o4 = LispReader.matchNumber("30R1234AQ");
+ object o1 = LispReader.MatchNumber("2R1100");
+ object o2 = LispReader.MatchNumber("4R123");
+ object o3 = LispReader.MatchNumber("-4R123");
+ object o4 = LispReader.MatchNumber("30R1234AQ");
Expect(o1, EqualTo(12));
Expect(o2, EqualTo(27));
@@ -111,13 +111,13 @@ public void MatchNumberMatchesSpecifiedRadix()
[Test]
public void MatchNumberMatchesFloats()
{
- object o1 = LispReader.matchNumber("123.7");
- object o2 = LispReader.matchNumber("-123.7E4");
- object o3 = LispReader.matchNumber("+1.237e4");
- object o4 = LispReader.matchNumber("+1.237e-4");
- object o5 = LispReader.matchNumber("1.237e+4");
- object o6 = LispReader.matchNumber("1.");
- object o7 = LispReader.matchNumber("1.e3");
+ object o1 = LispReader.MatchNumber("123.7");
+ object o2 = LispReader.MatchNumber("-123.7E4");
+ object o3 = LispReader.MatchNumber("+1.237e4");
+ object o4 = LispReader.MatchNumber("+1.237e-4");
+ object o5 = LispReader.MatchNumber("1.237e+4");
+ object o6 = LispReader.MatchNumber("1.");
+ object o7 = LispReader.MatchNumber("1.e3");
Expect(o1, EqualTo(123.7));
Expect(o2, EqualTo(-1237000.0));
@@ -140,17 +140,17 @@ public void MatchNumberMatchesDecimals()
void TestDecimalMatch(string inStr,string bdStr)
{
- object o = LispReader.matchNumber(inStr);
+ object o = LispReader.MatchNumber(inStr);
Expect(o, EqualTo(BigDecimal.Parse(bdStr)));
}
[Test]
public void MatchNumberMatchesRatios()
{
- object o1 = LispReader.matchNumber("12/1");
- object o2 = LispReader.matchNumber("12/4");
- object o3 = LispReader.matchNumber("12/5");
- object o4 = LispReader.matchNumber("12345678900000/123456789");
+ object o1 = LispReader.MatchNumber("12/1");
+ object o2 = LispReader.MatchNumber("12/4");
+ object o3 = LispReader.MatchNumber("12/5");
+ object o4 = LispReader.MatchNumber("12345678900000/123456789");
Expect(o1, EqualTo(12));
Expect(o2, EqualTo(3));
@@ -161,12 +161,12 @@ public void MatchNumberMatchesRatios()
[Test]
public void MatchNumberReadsWholeString()
{
- object o1 = LispReader.matchNumber(" 123");
- object o2 = LispReader.matchNumber("123 ");
- object o3 = LispReader.matchNumber(" 12.3");
- object o4 = LispReader.matchNumber("12.3 ");
- object o5 = LispReader.matchNumber(" 1/23");
- object o6 = LispReader.matchNumber("1/23 ");
+ object o1 = LispReader.MatchNumber(" 123");
+ object o2 = LispReader.MatchNumber("123 ");
+ object o3 = LispReader.MatchNumber(" 12.3");
+ object o4 = LispReader.MatchNumber("12.3 ");
+ object o5 = LispReader.MatchNumber(" 1/23");
+ object o6 = LispReader.MatchNumber("1/23 ");
Expect(o1, Null);
Expect(o2, Null);
@@ -179,10 +179,10 @@ public void MatchNumberReadsWholeString()
[Test]
public void MatchNumberFailsToMatchWeirdThings()
{
- object o1 = LispReader.matchNumber("123a");
- object o2 = LispReader.matchNumber("0x123Z");
- object o4 = LispReader.matchNumber("12.4/24.2");
- object o5 = LispReader.matchNumber("1.7M3");
+ object o1 = LispReader.MatchNumber("123a");
+ object o2 = LispReader.MatchNumber("0x123Z");
+ object o4 = LispReader.MatchNumber("12.4/24.2");
+ object o5 = LispReader.MatchNumber("1.7M3");
Expect(o1, Null);
Expect(o2, Null);
@@ -195,7 +195,7 @@ public void MatchNumberFailsToMatchWeirdThings()
[ExpectedException(typeof(FormatException))]
public void MatchNumberFailsOnRadixSnafu()
{
- object o3 = LispReader.matchNumber("10RAA");
+ object o3 = LispReader.MatchNumber("10RAA");
}
#endregion
@@ -496,7 +496,7 @@ public void LeadingDoubleColonMakesKeywordInCurrentNamespace()
{
object o1 = ReadFromString("::abc");
Expect(o1, TypeOf(typeof(Keyword)));
- Expect(((Keyword)o1).Namespace, EqualTo(((Namespace)RT.CURRENT_NS.deref()).Name.Name));
+ Expect(((Keyword)o1).Namespace, EqualTo(((Namespace)RT.CurrentNSVar.deref()).Name.Name));
Expect(((Keyword)o1).Name, EqualTo("abc"));
}
@@ -889,12 +889,12 @@ public void ListGetsLineNumber()
Object o1 = ReadFromStringNumbering("\n\n (a b \n1 2)");
Expect(o1, InstanceOf(typeof(IObj)));
IObj io = o1 as IObj;
- Expect(io.meta().valAt(RT.LINE_KEY), EqualTo(3));
- IPersistentMap sourceSpanMap = (IPersistentMap)io.meta().valAt(RT.SOURCE_SPAN_KEY);
- Expect(sourceSpanMap.valAt(RT.START_LINE_KEY), EqualTo(3));
- Expect(sourceSpanMap.valAt(RT.START_COLUMN_KEY), EqualTo(2));
- Expect(sourceSpanMap.valAt(RT.END_LINE_KEY), EqualTo(4));
- Expect(sourceSpanMap.valAt(RT.END_COLUMN_KEY),EqualTo(4));
+ Expect(io.meta().valAt(RT.LineKey), EqualTo(3));
+ IPersistentMap sourceSpanMap = (IPersistentMap)io.meta().valAt(RT.SourceSpanKey);
+ Expect(sourceSpanMap.valAt(RT.StartLineKey), EqualTo(3));
+ Expect(sourceSpanMap.valAt(RT.StartColumnKey), EqualTo(2));
+ Expect(sourceSpanMap.valAt(RT.EndLineKey), EqualTo(4));
+ Expect(sourceSpanMap.valAt(RT.EndColumnKey),EqualTo(4));
}
#endregion
@@ -1180,7 +1180,7 @@ public void SQOnRegularSymbolResolves()
Expect(s.first(), EqualTo(Symbol.intern("quote")));
Expect(s.next().first(), InstanceOf(typeof(Symbol)));
Symbol sym = s.next().first() as Symbol;
- Expect(sym.Namespace, EqualTo(((Namespace)RT.CURRENT_NS.deref()).Name.Name));
+ Expect(sym.Namespace, EqualTo(((Namespace)RT.CurrentNSVar.deref()).Name.Name));
Expect(sym.Name, EqualTo("abc"));
}
@@ -1482,7 +1482,7 @@ public void SQonUnquoteDequotes()
Expect(s3.count(), EqualTo(2));
Expect(s3.first(), EqualTo(Symbol.intern("quote")));
- Expect(s3.next().first(), EqualTo(Symbol.intern(((Namespace)RT.CURRENT_NS.deref()).Name.Name,"a")));
+ Expect(s3.next().first(), EqualTo(Symbol.intern(((Namespace)RT.CurrentNSVar.deref()).Name.Name,"a")));
s1 = s1.next();
@@ -1529,7 +1529,7 @@ public void SqOnUnquoteSpliceSplices()
Expect(s3.count(), EqualTo(2));
Expect(s3.first(), EqualTo(Symbol.intern("quote")));
- Expect(s3.next().first(), EqualTo(Symbol.intern(((Namespace)RT.CURRENT_NS.deref()).Name.Name, "a")));
+ Expect(s3.next().first(), EqualTo(Symbol.intern(((Namespace)RT.CurrentNSVar.deref()).Name.Name, "a")));
s1 = s1.next();
@@ -83,7 +83,7 @@ public Expr Parse(ParserContext pcon, object frms)
exprs = exprs.cons(e);
}
if (exprs.count() == 0)
- exprs = exprs.cons(Compiler.NIL_EXPR);
+ exprs = exprs.cons(Compiler.NilExprInstance);
return new BodyExpr(exprs);
}
@@ -77,10 +77,10 @@ class CaseExpr : Expr, MaybePrimitiveExpr
ICollection<Expr> returns = new List<Expr>(thens.Values);
returns.Add(defaultExpr);
_returnType = Compiler.MaybeClrType(returns);
- if (RT.count(skipCheck) > 0 && RT.booleanCast(RT.WARN_ON_REFLECTION.deref()))
+ if (RT.count(skipCheck) > 0 && RT.booleanCast(RT.WarnOnReflectionVar.deref()))
{
RT.errPrintWriter().WriteLine("Performance warning, {0}:{1} - hash collision of some case test constants; if selected, those entries will be tested sequentially.",
- Compiler.SourcePathVar.deref(),RT.get(sourceSpan,RT.START_LINE_KEY));
+ Compiler.SourcePathVar.deref(),RT.get(sourceSpan,RT.StartLineKey));
}
}
@@ -146,7 +146,7 @@ public Expr Parse(ParserContext pcon, object frm)
object first = RT.first(pair);
Expr testExpr = testType == _intKey
? NumberExpr.Parse(Util.ConvertToInt(first))
- : (first == null ? Compiler.NIL_EXPR : new ConstantExpr(first));
+ : (first == null ? Compiler.NilExprInstance : new ConstantExpr(first));
tests[minhash] = testExpr;
Expr thenExpr;
@@ -296,10 +296,10 @@ private Expression GenTestExprForInts(ObjExpr objx,GenContext context,Type exprT
{
if (exprType == null)
{
- if (RT.booleanCast(RT.WARN_ON_REFLECTION.deref()))
+ if (RT.booleanCast(RT.WarnOnReflectionVar.deref()))
{
RT.errPrintWriter().WriteLine("Performance warning, {0}:{1} - case has int tests, but tested expression is not primitive.",
- Compiler.SourcePathVar.deref(), RT.get(_sourceSpan, RT.START_LINE_KEY));
+ Compiler.SourcePathVar.deref(), RT.get(_sourceSpan, RT.StartLineKey));
}
ParameterExpression parm = Expression.Parameter(typeof(object),"p");
@@ -325,7 +325,7 @@ private Expression GenTestExprForInts(ObjExpr objx,GenContext context,Type exprT
private Expression GenTestExprForHashes(ObjExpr objx,GenContext context)
{
- Expression expr = Expression.Call(null, Compiler.Method_Util_Hash, Expression.Convert(_expr.GenCode(RHC.Expression, objx, context), typeof(Object)));
+ Expression expr = Expression.Call(null, Compiler.Method_Util_hash, Expression.Convert(_expr.GenCode(RHC.Expression, objx, context), typeof(Object)));
return GenShiftMask(expr);
}
@@ -77,13 +77,13 @@ public Expr Parse(ParserContext pcon, object form)
{
object v = RT.second(form);
if (v == null)
- return Compiler.NIL_EXPR;
+ return Compiler.NilExprInstance;
else if (v is Boolean)
{
if ((bool)v)
- return Compiler.TRUE_EXPR;
+ return Compiler.TrueExprInstance;
else
- return Compiler.FALSE_EXPR;
+ return Compiler.FalseExprInstance;
}
else if (Util.IsNumeric(v))
return NumberExpr.Parse(v);
@@ -130,11 +130,11 @@ public Expr Parse(ParserContext pcon, object form)
Object source_path = Compiler.SourcePathVar.get();
source_path = source_path ?? "NO_SOURCE_FILE";
- mm = (IPersistentMap)RT.assoc(mm,RT.LINE_KEY, Compiler.LineVar.get())
- .assoc(RT.FILE_KEY, source_path);
+ mm = (IPersistentMap)RT.assoc(mm,RT.LineKey, Compiler.LineVar.get())
+ .assoc(RT.FileKey, source_path);
//.assoc(RT.SOURCE_SPAN_KEY,Compiler.SOURCE_SPAN.deref());
if (docstring != null)
- mm = (IPersistentMap)RT.assoc(mm, RT.DOC_KEY, docstring);
+ mm = (IPersistentMap)RT.assoc(mm, RT.DocKey, docstring);
//mm = mm.without(RT.DOC_KEY)
// .without(Keyword.intern(null, "arglists"))
@@ -145,8 +145,8 @@ public Expr Parse(ParserContext pcon, object form)
// .without(Keyword.intern(null, "added"))
// .without(Keyword.intern(null, "static"));
- Expr meta = mm == null || mm.count() == 0 ? null : Compiler.Analyze(pcon.EvEx(),mm);
- Expr init = Compiler.Analyze(pcon.EvEx(),RT.third(form), v.Symbol.Name);
+ Expr meta = mm == null || mm.count() == 0 ? null : Compiler.Analyze(pcon.EvalOrExpr(),mm);
+ Expr init = Compiler.Analyze(pcon.EvalOrExpr(),RT.third(form), v.Symbol.Name);
bool initProvided = RT.count(form) == 3;
return new DefExpr(
@@ -227,10 +227,10 @@ public Expression GenCode(RHC rhc, ObjExpr objx, GenContext context)
for(int i=0; i < expr.KeyVals.count(); i += 2)
{
Keyword k = ((KeywordExpr)expr.KeyVals.nth(i)).Kw;
- if ((k != RT.FILE_KEY) &&
- (k != RT.DECLARED_KEY) &&
- (k != RT.SOURCE_SPAN_KEY ) &&
- (k != RT.LINE_KEY))
+ if ((k != RT.FileKey) &&
+ (k != RT.DeclaredKey) &&
+ (k != RT.SourceSpanKey ) &&
+ (k != RT.LineKey))
return true;
}
return false;
Oops, something went wrong.

0 comments on commit d493ec7

Please sign in to comment.