diff options
author | 2015-11-06 12:16:03 +0000 | |
---|---|---|
committer | 2015-11-06 16:40:00 +0000 | |
commit | 0ec13b9f03417142ca63b9fe1eb85827d6308233 (patch) | |
tree | 5350445840d49888fcebc98a28d6b9182d71c85a /src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java | |
parent | 976f1b657bb45c5cb58d48327ce05babe9cd4cdf (diff) |
Add initial Skylark byte code generation code.
Does not yet contain any implementation for expressions and statements
but sets up various needed mechanisms and helper classes.
--
MOS_MIGRATED_REVID=107222845
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java b/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java index 8d1ed36f5d..9c11547a15 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java @@ -13,7 +13,13 @@ // limitations under the License. package com.google.devtools.build.lib.syntax; +import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; +import com.google.devtools.build.lib.syntax.compiler.DebugInfo; +import com.google.devtools.build.lib.syntax.compiler.LoopLabels; +import com.google.devtools.build.lib.syntax.compiler.VariableScope; + +import net.bytebuddy.implementation.bytecode.ByteCodeAppender; import java.util.ArrayList; import java.util.List; @@ -117,4 +123,12 @@ public class FunctionDefStatement extends Statement { stmts.validate(localEnv); } } + + @Override + ByteCodeAppender compile( + VariableScope scope, Optional<LoopLabels> loopLabels, DebugInfo debugInfo) { + throw new UnsupportedOperationException( + "Skylark does not support nested function definitions" + + " and the current entry point for the compiler is UserDefinedFunction."); + } } |