From c542f7304a2c6bd602ab6969a2f9357959d86f24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 9 Oct 2018 15:15:12 +0300 Subject: [PATCH] Deprecated methods in o.s.scl.compiler.Types class for parsing types Change-Id: I7df83c111edb0267c59585cf0d5c544d0c985dbf --- .../org/simantics/scl/compiler/types/Types.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java index e1b89eece..8817eb23c 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java @@ -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 { -- 2.47.1