From 1c2e1cb82f8a2de1779240aa5576a8f5d75d45c2 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 25 Dec 2013 20:18:56 +0400 Subject: [PATCH] Rewrite built-in annotations to Kotlin --- runtime/kt/Annotations.kt | 7 +++++++ runtime/kt/Inline.kt | 8 ++++++++ runtime/src/jet/InlineStrategy.java | 22 ---------------------- runtime/src/jet/data.java | 24 ------------------------ runtime/src/jet/deprecated.java | 25 ------------------------- runtime/src/jet/inline.java | 25 ------------------------- runtime/src/jet/noinline.java | 24 ------------------------ runtime/src/jet/suppress.java | 25 ------------------------- runtime/src/jet/tailRecursive.java | 27 --------------------------- 9 files changed, 15 insertions(+), 172 deletions(-) create mode 100644 runtime/kt/Annotations.kt create mode 100644 runtime/kt/Inline.kt delete mode 100644 runtime/src/jet/InlineStrategy.java delete mode 100644 runtime/src/jet/data.java delete mode 100644 runtime/src/jet/deprecated.java delete mode 100644 runtime/src/jet/inline.java delete mode 100644 runtime/src/jet/noinline.java delete mode 100644 runtime/src/jet/suppress.java delete mode 100644 runtime/src/jet/tailRecursive.java diff --git a/runtime/kt/Annotations.kt b/runtime/kt/Annotations.kt new file mode 100644 index 00000000000..c8e7ca92fe5 --- /dev/null +++ b/runtime/kt/Annotations.kt @@ -0,0 +1,7 @@ +package jet + +public annotation class atomic +public annotation class data +public annotation class deprecated(val value: String) +public annotation class suppress(vararg val names: String) +public annotation class tailRecursive diff --git a/runtime/kt/Inline.kt b/runtime/kt/Inline.kt new file mode 100644 index 00000000000..919f7f02223 --- /dev/null +++ b/runtime/kt/Inline.kt @@ -0,0 +1,8 @@ +package jet + +public annotation class noinline +public annotation class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION) +public enum class InlineStrategy { + AS_FUNCTION + IN_PLACE +} diff --git a/runtime/src/jet/InlineStrategy.java b/runtime/src/jet/InlineStrategy.java deleted file mode 100644 index 8e4616084fa..00000000000 --- a/runtime/src/jet/InlineStrategy.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -public enum InlineStrategy { - AS_FUNCTION, - IN_PLACE -} diff --git a/runtime/src/jet/data.java b/runtime/src/jet/data.java deleted file mode 100644 index 4f698f28fc0..00000000000 --- a/runtime/src/jet/data.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.CLASS) -public @interface data { -} diff --git a/runtime/src/jet/deprecated.java b/runtime/src/jet/deprecated.java deleted file mode 100644 index 2a8e1239edb..00000000000 --- a/runtime/src/jet/deprecated.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.CLASS) -public @interface deprecated { - String value(); -} diff --git a/runtime/src/jet/inline.java b/runtime/src/jet/inline.java deleted file mode 100644 index b68c895fd9d..00000000000 --- a/runtime/src/jet/inline.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.CLASS) -public @interface inline { - InlineStrategy strategy() default InlineStrategy.AS_FUNCTION; -} diff --git a/runtime/src/jet/noinline.java b/runtime/src/jet/noinline.java deleted file mode 100644 index 05bf49b94d9..00000000000 --- a/runtime/src/jet/noinline.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.CLASS) -public @interface noinline { -} diff --git a/runtime/src/jet/suppress.java b/runtime/src/jet/suppress.java deleted file mode 100644 index 51b3c10bb6a..00000000000 --- a/runtime/src/jet/suppress.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.SOURCE) -public @interface suppress { - String[] names(); -} diff --git a/runtime/src/jet/tailRecursive.java b/runtime/src/jet/tailRecursive.java deleted file mode 100644 index 4bd8b400f7e..00000000000 --- a/runtime/src/jet/tailRecursive.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package jet; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.CLASS) -@Target({ElementType.METHOD}) -public @interface tailRecursive { -}