Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/processor/LanguageRegistrationTest.java @ 21889:45083be8a812
Truffle: add a version string to the information provided with Language registration
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 18:05:13 -0700 |
parents | 2f9e4d984d16 |
children | 894f82515e38 |
comparison
equal
deleted
inserted
replaced
21755:c052d68e7eac | 21889:45083be8a812 |
---|---|
29 import com.oracle.truffle.api.source.*; | 29 import com.oracle.truffle.api.source.*; |
30 | 30 |
31 public class LanguageRegistrationTest { | 31 public class LanguageRegistrationTest { |
32 | 32 |
33 @ExpectError("Registered language class must be public") | 33 @ExpectError("Registered language class must be public") |
34 @TruffleLanguage.Registration(name = "myLang", mimeType = "text/x-my") | 34 @TruffleLanguage.Registration(name = "myLang", version = "0", mimeType = "text/x-my") |
35 private static final class MyLang { | 35 private static final class MyLang { |
36 } | 36 } |
37 | 37 |
38 @ExpectError("Registered language inner-class must be static") | 38 @ExpectError("Registered language inner-class must be static") |
39 @TruffleLanguage.Registration(name = "myLangNonStatic", mimeType = "text/x-my") | 39 @TruffleLanguage.Registration(name = "myLangNonStatic", version = "0", mimeType = "text/x-my") |
40 public final class MyLangNonStatic { | 40 public final class MyLangNonStatic { |
41 } | 41 } |
42 | 42 |
43 @ExpectError("Registered language class must subclass TruffleLanguage") | 43 @ExpectError("Registered language class must subclass TruffleLanguage") |
44 @TruffleLanguage.Registration(name = "myLang", mimeType = "text/x-my") | 44 @TruffleLanguage.Registration(name = "myLang", version = "0", mimeType = "text/x-my") |
45 public static final class MyLangNoSubclass { | 45 public static final class MyLangNoSubclass { |
46 } | 46 } |
47 | 47 |
48 @ExpectError("Language must have a public constructor accepting TruffleLanguage.Env as parameter") | 48 @ExpectError("Language must have a public constructor accepting TruffleLanguage.Env as parameter") |
49 @TruffleLanguage.Registration(name = "myLangNoCnstr", mimeType = "text/x-my") | 49 @TruffleLanguage.Registration(name = "myLangNoCnstr", version = "0", mimeType = "text/x-my") |
50 public static final class MyLangWrongConstr extends TruffleLanguage { | 50 public static final class MyLangWrongConstr extends TruffleLanguage { |
51 private MyLangWrongConstr() { | 51 private MyLangWrongConstr() { |
52 super(null); | 52 super(null); |
53 } | 53 } |
54 | 54 |
72 return false; | 72 return false; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 @ExpectError("Language must have a public constructor accepting TruffleLanguage.Env as parameter") | 76 @ExpectError("Language must have a public constructor accepting TruffleLanguage.Env as parameter") |
77 @TruffleLanguage.Registration(name = "myLangNoCnstr", mimeType = "text/x-my") | 77 @TruffleLanguage.Registration(name = "myLangNoCnstr", version = "0", mimeType = "text/x-my") |
78 public static final class MyLangNoConstr extends TruffleLanguage { | 78 public static final class MyLangNoConstr extends TruffleLanguage { |
79 public MyLangNoConstr() { | 79 public MyLangNoConstr() { |
80 super(null); | 80 super(null); |
81 } | 81 } |
82 | 82 |
99 protected boolean isObjectOfLanguage(Object object) { | 99 protected boolean isObjectOfLanguage(Object object) { |
100 return false; | 100 return false; |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 @TruffleLanguage.Registration(name = "myLangGood", mimeType = "text/x-my") | 104 @TruffleLanguage.Registration(name = "myLangGood", version = "0", mimeType = "text/x-my") |
105 public static final class MyLangGood extends TruffleLanguage { | 105 public static final class MyLangGood extends TruffleLanguage { |
106 public MyLangGood(TruffleLanguage.Env env) { | 106 public MyLangGood(TruffleLanguage.Env env) { |
107 super(env); | 107 super(env); |
108 } | 108 } |
109 | 109 |