forked from google/MOE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable kotlin in the MOE codebase expressions package, using data cla…
…sses in place of @autovalue. In the process, merge AbstractExpression with Expression, as AE is a needless layer. Also, remove BinaryExpression which was needed for the validation logic, but after some consideration, that validation logic is overzealous, and all the Expression creation is basically local to the expressions package (except for RepositoryExpression which is the base case anyway). The whole validation bit was just overengineered. Note: This definitely breaks the opensource, despite my attempts to make it work. I've definitely updated the maven stuff, and it ought to work, but it's got its issues. I'm finding it slow going, fixing it by rebuilding MOE stuff, so I'm going to take this as a two-pronged approach, namely get this in and working internally, and then fixing the external build in a separate commit (possibly by fixing hte maven bits, or possibly my migrating to bazel). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=208061385
- Loading branch information
Showing
46 changed files
with
532 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
...src/main/java/com/google/devtools/moe/client/codebase/expressions/AbstractExpression.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
...t/src/main/java/com/google/devtools/moe/client/codebase/expressions/BinaryExpression.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
client/src/main/java/com/google/devtools/moe/client/codebase/expressions/EditExpression.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
client/src/main/java/com/google/devtools/moe/client/codebase/expressions/EditExpression.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2011 Google, Inc. | ||
* | ||
* 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 com.google.devtools.moe.client.codebase.expressions | ||
|
||
/** | ||
* An expression encapsulating the transformation of the given Expression's Codebase via the | ||
* application of an [com.google.devtools.moe.client.translation.editors.Editor]. For example, | ||
* | ||
* <pre>`new RepositoryExpression("myRepo").editWith("myEditor", { "option1": "foo" }) | ||
`</pre> * | ||
* | ||
* returns an EditExpression for | ||
* | ||
* <pre>`"myRepo|myEditor(option1=foo)"`</pre> | ||
* | ||
* . | ||
*/ | ||
data class EditExpression | ||
internal constructor(val operand: Expression, val operation: Operation) : Expression() { | ||
override fun toString(): String = "$operand$operation" | ||
} |
Oops, something went wrong.