]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Deprecated methods in o.s.scl.compiler.Types class for parsing types 89/2289/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 9 Oct 2018 12:15:12 +0000 (15:15 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 9 Oct 2018 12:15:12 +0000 (15:15 +0300)
Change-Id: I7df83c111edb0267c59585cf0d5c544d0c985dbf

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java

index e1b89eece28ab21f14e87e3e2fd20745ec85e7c5..8817eb23c6979c25acefb81f7be30c4d87a8bc7c 100644 (file)
@@ -7,6 +7,7 @@ import java.util.Collections;
 import java.util.List;
 
 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
+import org.simantics.scl.compiler.environment.Environments;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException;
 import org.simantics.scl.compiler.internal.parsing.parser.SCLParserImpl;
@@ -1183,14 +1184,27 @@ public class Types {
         return effect;
     }
 
+    /**
+     * Use {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead.
+     */
+    @Deprecated
     public static Type parseType(ITypeEnvironment environment, String text) throws SCLTypeParseException {
         return parseType(new TypeElaborationContext(environment), text);
     }
 
+    /**
+     * This method uses DUMMY_TYPE_ENVIRONMENT that almost does anything useful. Use
+     * {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead.
+     */
+    @Deprecated
     public static Type parseType(String text) throws SCLTypeParseException {
         return parseType(new TypeElaborationContext(DUMMY_TYPE_ENVIRONMENT), text);
     }
-    
+
+    /**
+     * Use {@link Environments#getType(org.simantics.scl.compiler.environment.Environment, String)} instead.
+     */
+    @Deprecated
     private static Type parseType(TypeElaborationContext context, String text) throws SCLTypeParseException {
         SCLParserImpl parser = new SCLParserImpl(new StringReader(text));
         try {