示例#1
0
 @Override
 public boolean isNilClass() {
   final String _isNilClass;
   String _temp1 = _properties.get("isNilClass");
   _isNilClass = ((String) _temp1);
   return st.gravel.support.jvm.StringExtensions.equals_(_isNilClass, "true");
 }
示例#2
0
 public UpdateClassDiff diffTo_(final ClassNode _aClassNode) {
   if (!st.gravel.support.jvm.ObjectExtensions.equals_(_aClassNode.name(), _name)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.ArrayExtensions.equals_(_aClassNode.namespace(), _namespace)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.StringExtensions.equals_(
       _aClassNode.superclassPath(), _superclassPath)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.DictionaryExtensions.equals_(
       _aClassNode.properties(), _properties)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isExtension(), _isExtension)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(_aClassNode.isTrait(), _isTrait)) {
     st.gravel.support.jvm.ObjectExtensions.halt(_aClassNode);
   }
   return UpdateClassDiff.factory.reference_superclassReference_thisDiff_metaDiff_(
       _aClassNode.reference(),
       ((AbsoluteReference) _aClassNode.superclassReference()),
       this.diffToClassDescriptionNode_(_aClassNode),
       _metaclassNode.diffToClassDescriptionNode_(_aClassNode.metaclassNode()));
 }
示例#3
0
 @Test
 public void testParseString2() {
   final StringLiteralNode _node;
   _node = ((StringLiteralNode) Parser.factory.source_("\'from\'\'age\'").parseExpression());
   assertTrue(
       st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), StringLiteralNode.factory));
   assertTrue(st.gravel.support.jvm.StringExtensions.equals_(_node.value(), "from\'age"));
 }
示例#4
0
  @Override
  public Reference superclassReference() {
    final st.gravel.core.Symbol[] _path;
    if (_superclassPath == null) {
      return null;
    }
    _path =
        st.gravel.support.jvm.ArrayExtensions.collect_(
            st.gravel.support.jvm.StringExtensions.tokensBasedOn_(_superclassPath, '.'),
            ((st.gravel.support.jvm.Block1<st.gravel.core.Symbol, String>)
                (new st.gravel.support.jvm.Block1<st.gravel.core.Symbol, String>() {

                  @Override
                  public st.gravel.core.Symbol value_(final String _str) {
                    return (st.gravel.core.Symbol) st.gravel.core.Symbol.value(_str);
                  }
                })));
    if (st.gravel.support.jvm.IntegerExtensions.equals_(_path.length, 1)) {
      return AbsoluteReference.factory.path_(
          st.gravel.support.jvm.ArrayExtensions.copyWith_(_namespace, _path[0]));
    }
    return AbsoluteReference.factory.path_(_path);
  }
示例#5
0
  public st.gravel.core.Symbol[] javaClassPath() {
    final Object _temp1 = new Object();
    try {
      final String _javaClass;
      _javaClass =
          ((String)
              st.gravel.support.jvm.DictionaryExtensions.at_ifAbsent_(
                  _properties,
                  "javaClass",
                  ((st.gravel.support.jvm.Block0<String>)
                      (new st.gravel.support.jvm.Block0<String>() {

                        @Override
                        public String value() {
                          throw new NonLocalReturn(null, _temp1);
                        }
                      }))));
      return ((st.gravel.core.Symbol[])
          st.gravel.support.jvm.ArrayExtensions.collect_(
              st.gravel.support.jvm.StringExtensions.tokensBasedOn_(_javaClass, '.'),
              ((st.gravel.support.jvm.Block1<st.gravel.core.Symbol, String>)
                  (new st.gravel.support.jvm.Block1<st.gravel.core.Symbol, String>() {

                    @Override
                    public st.gravel.core.Symbol value_(final String _each) {
                      return (st.gravel.core.Symbol) st.gravel.core.Symbol.value(_each);
                    }
                  }))));
    } catch (NonLocalReturn nlr) {
      if (nlr.marker == _temp1) {
        return (st.gravel.core.Symbol[]) nlr.returnValue;
      } else {
        throw nlr;
      }
    }
  }
示例#6
0
 public boolean isPropertyPragmaAt_(final st.gravel.core.Symbol _aKey) {
   return st.gravel.support.jvm.StringExtensions.equals_(_expression.selector(), "propertyAt:put:")
       && (_expression.arguments()[0].isSymbolLiteralNode()
           && st.gravel.support.jvm.ObjectExtensions.equals_(
               ((SymbolLiteralNode) _expression.arguments()[0]).value(), _aKey));
 }
示例#7
0
 @Override
 public boolean equals(final Object _anObject) {
   if (!super.equals(_anObject)) {
     return false;
   }
   if (this._name == null) {
     if (!(((ClassNode) _anObject)._name == null)) {
       return false;
     }
   } else {
     if (!st.gravel.support.jvm.ObjectExtensions.equals_(
         this._name, ((ClassNode) _anObject)._name)) {
       return false;
     }
   }
   if (this._namespace == null) {
     if (!(((ClassNode) _anObject)._namespace == null)) {
       return false;
     }
   } else {
     if (!st.gravel.support.jvm.ArrayExtensions.equals_(
         this._namespace, ((ClassNode) _anObject)._namespace)) {
       return false;
     }
   }
   if (this._superclassPath == null) {
     if (!(((ClassNode) _anObject)._superclassPath == null)) {
       return false;
     }
   } else {
     if (!st.gravel.support.jvm.StringExtensions.equals_(
         this._superclassPath, ((ClassNode) _anObject)._superclassPath)) {
       return false;
     }
   }
   if (this._properties == null) {
     if (!(((ClassNode) _anObject)._properties == null)) {
       return false;
     }
   } else {
     if (!st.gravel.support.jvm.DictionaryExtensions.equals_(
         this._properties, ((ClassNode) _anObject)._properties)) {
       return false;
     }
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(
       this._isExtension, ((ClassNode) _anObject)._isExtension)) {
     return false;
   }
   if (this._metaclassNode == null) {
     if (!(((ClassNode) _anObject)._metaclassNode == null)) {
       return false;
     }
   } else {
     if (!st.gravel.support.jvm.ObjectExtensions.equals_(
         this._metaclassNode, ((ClassNode) _anObject)._metaclassNode)) {
       return false;
     }
   }
   if (!st.gravel.support.jvm.BooleanExtensions.equals_(
       this._isTrait, ((ClassNode) _anObject)._isTrait)) {
     return false;
   }
   return true;
 }