diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt index 77d9c322abb..1d9e6efb5e1 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt @@ -175,7 +175,8 @@ class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer deserialization work + val serialized = mutableListOf>() + + val serializer = JsIrAstSerializer() + fragments.entries.forEach { (file, fragment) -> + val output = ByteArrayOutputStream() + serializer.serialize(fragment, output) + val binaryAst = output.toByteArray() + serialized += file to binaryAst + } + + val restoredMap = mutableMapOf() + + val deserializer = JsIrAstDeserializer() + + serialized.forEach { (file, binaryAst) -> + restoredMap[file] = deserializer.deserialize(ByteArrayInputStream(binaryAst)) + } + + return restoredMap } private fun generateWrappedModuleBody( diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt new file mode 100644 index 00000000000..61d2f8841ef --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js.utils.serialization + +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrClassModel +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrProgramFragment +import org.jetbrains.kotlin.ir.backend.js.utils.emptyScope +import org.jetbrains.kotlin.js.backend.ast.* +import org.jetbrains.kotlin.js.backend.ast.JsImportedModule +import org.jetbrains.kotlin.protobuf.CodedInputStream +import org.jetbrains.kotlin.serialization.js.ast.JsAstDeserializerBase +import org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.* +import java.io.InputStream + +class JsIrAstDeserializer : JsAstDeserializerBase() { + override val scope = emptyScope + + fun deserialize(input: InputStream): JsIrProgramFragment { + return deserialize(Chunk.parseFrom(CodedInputStream.newInstance(input).apply { setRecursionLimit(4096) })) + } + + fun deserialize(proto: Chunk): JsIrProgramFragment { + stringTable += proto.stringTable.entryList + nameTable += proto.nameTable.entryList + nameCache += nameTable.map { null } + try { + return deserialize(proto.fragment) + } finally { + stringTable.clear() + nameTable.clear() + nameCache.clear() + } + } + + private fun deserialize(proto: Fragment): JsIrProgramFragment { + val fragment = JsIrProgramFragment(proto.packageFqn) + + fragment.importedModules += proto.importedModuleList.map { importedModuleProto -> + JsImportedModule( + deserializeString(importedModuleProto.externalNameId), + deserializeName(importedModuleProto.internalNameId), + if (importedModuleProto.hasPlainReference()) deserialize(importedModuleProto.plainReference) else null + ) + } + + proto.importEntryList.associateTo(fragment.imports) { importProto -> + deserializeString(importProto.signatureId) to deserialize(importProto.expression) + } + + if (proto.hasDeclarationBlock()) { + fragment.declarations.statements += deserializeGlobalBlock(proto.declarationBlock).statements + } + if (proto.hasInitializerBlock()) { + fragment.initializers.statements += deserializeGlobalBlock(proto.initializerBlock).statements + } + if (proto.hasExportBlock()) { + fragment.exports.statements += deserializeGlobalBlock(proto.exportBlock).statements + } + + proto.nameBindingList.associateTo(fragment.nameBindings) { nameBindingProto -> + deserializeString(nameBindingProto.signatureId) to deserializeName(nameBindingProto.nameId) + } + + proto.irClassModelList.associateTo(fragment.classes) { clsProto -> deserialize(clsProto) } + + if (proto.hasTestsInvocation()) { + fragment.testFunInvocation = deserialize(proto.testsInvocation) + } + + if (proto.hasMainInvocation()) { + fragment.mainFunction = deserialize(proto.mainInvocation) + } + + if (proto.hasSuiteFunction()) { + fragment.suiteFn = deserializeName(proto.suiteFunction) + } + + fragment.dts = proto.dts + + return fragment + } + + private fun deserialize(proto: IrClassModel): Pair { + return deserializeName(proto.nameId) to JsIrClassModel(proto.superClassesList.map { deserializeName(it) }).apply { + if (proto.hasPreDeclarationBlock()) { + preDeclarationBlock.statements += deserializeGlobalBlock(proto.preDeclarationBlock).statements + } + if (proto.hasPostDeclarationBlock()) { + postDeclarationBlock.statements += deserializeGlobalBlock(proto.postDeclarationBlock).statements + } + } + } + + override fun embedSources(deserializedLocation: JsLocation, file: String): JsLocationWithSource? = null +} diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt new file mode 100644 index 00000000000..8b83105225f --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt @@ -0,0 +1,107 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js.utils.serialization + +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrClassModel +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrProgramFragment +import org.jetbrains.kotlin.js.backend.ast.* +import org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.* +import org.jetbrains.kotlin.serialization.js.ast.JsAstSerializerBase +import org.jetbrains.kotlin.utils.addToStdlib.safeAs +import java.io.OutputStream + +class JsIrAstSerializer: JsAstSerializerBase() { + + fun serialize(fragment: JsIrProgramFragment, output: OutputStream) { + importedNames.clear() + importedNames += fragment.imports.map { fragment.nameBindings[it.key]!! } + serialize(fragment).writeTo(output) + } + + fun serialize(fragment: JsIrProgramFragment): Chunk { + try { + val chunkBuilder = Chunk.newBuilder() + chunkBuilder.fragment = serializeFragment(fragment) + chunkBuilder.nameTable = nameTableBuilder.build() + chunkBuilder.stringTable = stringTableBuilder.build() + return chunkBuilder.build() + } finally { + nameTableBuilder.clear() + stringTableBuilder.clear() + nameMap.clear() + stringMap.clear() + } + } + + private fun serializeFragment(fragment: JsIrProgramFragment): Fragment { + val fragmentBuilder = Fragment.newBuilder() + + fragmentBuilder.packageFqn = fragment.packageFqn + + for (importedModule in fragment.importedModules) { + val importedModuleBuilder = ImportedModule.newBuilder() + importedModuleBuilder.externalNameId = serialize(importedModule.externalName) + importedModuleBuilder.internalNameId = serialize(importedModule.internalName) + importedModule.plainReference?.let { importedModuleBuilder.plainReference = serialize(it) } + fragmentBuilder.addImportedModule(importedModuleBuilder) + } + + for ((signature, expression) in fragment.imports) { + val importBuilder = Import.newBuilder() + importBuilder.signatureId = serialize(signature) + importBuilder.expression = serialize(expression) + fragmentBuilder.addImportEntry(importBuilder) + } + + fragmentBuilder.declarationBlock = serializeBlock(fragment.declarations) + fragmentBuilder.initializerBlock = serializeBlock(fragment.initializers) + fragmentBuilder.exportBlock = serializeBlock(fragment.exports) + + for ((key, name) in fragment.nameBindings.entries) { + val nameBindingBuilder = NameBinding.newBuilder() + nameBindingBuilder.signatureId = serialize(key) + nameBindingBuilder.nameId = serialize(name) + fragmentBuilder.addNameBinding(nameBindingBuilder) + } + + fragment.classes.entries.forEach { (name, model) -> fragmentBuilder.addIrClassModel(serialize(name, model)) } + + fragment.testFunInvocation?.let { + fragmentBuilder.setTestsInvocation(serialize(it)) + } + + fragment.mainFunction?.let { + fragmentBuilder.setMainInvocation(serialize(it)) + } + + fragment.dts?.let { + fragmentBuilder.dts = it + } + + fragment.suiteFn?.let { + fragmentBuilder.setSuiteFunction(serialize(it)) + } + + return fragmentBuilder.build() + } + + private fun serialize(name: JsName, classModel: JsIrClassModel): IrClassModel { + val builder = IrClassModel.newBuilder() + builder.nameId = serialize(name) + classModel.superClasses.forEach { builder.addSuperClasses(serialize(it)) } + if (classModel.preDeclarationBlock.statements.isNotEmpty()) { + builder.preDeclarationBlock = serializeBlock(classModel.preDeclarationBlock) + } + if (classModel.postDeclarationBlock.statements.isNotEmpty()) { + builder.postDeclarationBlock = serializeBlock(classModel.postDeclarationBlock) + } + return builder.build() + } + + override fun extractLocation(node: JsNode): JsLocation? { + return node.source.safeAs()?.asSimpleLocation() + } +} diff --git a/js/js.serializer/src/js-ast.proto b/js/js.serializer/src/js-ast.proto index febbd00909b..f059a591ebe 100644 --- a/js/js.serializer/src/js-ast.proto +++ b/js/js.serializer/src/js-ast.proto @@ -253,6 +253,7 @@ message Statement { ForIn for_in_statement = 36; Try try_statement = 37; Empty empty = 38; + SingleLineComment single_line_comment = 39; } } @@ -372,6 +373,10 @@ message Catch { message Empty { } +message SingleLineComment { + required string message = 1; +} + enum InlineStrategy { AS_FUNCTION = 0; IN_PLACE = 1; @@ -395,6 +400,9 @@ message Fragment { optional Statement tests_invocation = 11; optional Statement main_invocation = 12; repeated InlinedLocalDeclarations inlined_local_declarations = 13; + repeated IrClassModel ir_class_model = 14; + optional string dts = 15; + optional int32 suite_function = 16; } message InlinedLocalDeclarations { @@ -425,6 +433,13 @@ message ClassModel { optional GlobalBlock post_declaration_block = 3; } +message IrClassModel { + required int32 name_id = 1; + repeated int32 super_classes = 2; + optional GlobalBlock pre_declaration_block = 3; + optional GlobalBlock post_declaration_block = 4; +} + message InlineModule { required int32 signature_id = 1; required int32 expression_id = 2; diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializer.kt b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializer.kt index 467e4053471..c258070da00 100644 --- a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializer.kt +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializer.kt @@ -31,12 +31,9 @@ import java.io.InputStream import java.io.InputStreamReader import java.util.* -class JsAstDeserializer(program: JsProgram, private val sourceRoots: Iterable) { - private val scope = JsRootScope(program) - private val stringTable = mutableListOf() - private val nameTable = mutableListOf() - private val nameCache = mutableListOf() - private val fileStack: Deque = ArrayDeque() +class JsAstDeserializer(program: JsProgram, private val sourceRoots: Iterable) : JsAstDeserializerBase() { + + override val scope: JsRootScope = JsRootScope(program) fun deserialize(input: InputStream): JsProgramFragment { return deserialize(Chunk.parseFrom(CodedInputStream.newInstance(input).apply { setRecursionLimit(4096) })) @@ -48,8 +45,7 @@ class JsAstDeserializer(program: JsProgram, private val sourceRoots: Iterable - JsImportedModule( - deserializeString(importedModuleProto.externalNameId), - deserializeName(importedModuleProto.internalNameId), - if (importedModuleProto.hasPlainReference()) deserialize(importedModuleProto.plainReference) else null + JsImportedModule( + deserializeString(importedModuleProto.externalNameId), + deserializeName(importedModuleProto.internalNameId), + if (importedModuleProto.hasPlainReference()) deserialize(importedModuleProto.plainReference) else null ) } @@ -123,470 +119,13 @@ class JsAstDeserializer(program: JsProgram, private val sourceRoots: Iterable { - val returnProto = proto.returnStatement - JsReturn(if (returnProto.hasValue()) deserialize(returnProto.value) else null) - } - - StatementCase.THROW_STATEMENT -> { - val throwProto = proto.throwStatement - JsThrow(deserialize(throwProto.exception)) - } - - StatementCase.BREAK_STATEMENT -> { - val breakProto = proto.breakStatement - JsBreak(if (breakProto.hasLabelId()) JsNameRef(deserializeName(breakProto.labelId)) else null) - } - - StatementCase.CONTINUE_STATEMENT -> { - val continueProto = proto.continueStatement - JsContinue(if (continueProto.hasLabelId()) JsNameRef(deserializeName(continueProto.labelId)) else null) - } - - StatementCase.DEBUGGER -> { - JsDebugger() - } - - StatementCase.EXPRESSION -> { - val expressionProto = proto.expression - JsExpressionStatement(deserialize(expressionProto.expression)).also { - if (expressionProto.hasExportedTagId()) { - it.exportedTag = deserializeString(expressionProto.exportedTagId) - } - } - } - - StatementCase.VARS -> { - deserializeVars(proto.vars) - } - - StatementCase.BLOCK -> { - val blockProto = proto.block - val block = JsBlock() - block.statements += blockProto.statementList.map { deserialize(it) } - block - } - - StatementCase.GLOBAL_BLOCK -> { - deserializeGlobalBlock(proto.globalBlock) - } - - StatementCase.LABEL -> { - val labelProto = proto.label - JsLabel(deserializeName(labelProto.nameId), deserialize(labelProto.innerStatement)) - } - - StatementCase.IF_STATEMENT -> { - val ifProto = proto.ifStatement - JsIf( - deserialize(ifProto.condition), - deserialize(ifProto.thenStatement), - if (ifProto.hasElseStatement()) deserialize(ifProto.elseStatement) else null - ) - } - - StatementCase.SWITCH_STATEMENT -> { - val switchProto = proto.switchStatement - JsSwitch( - deserialize(switchProto.expression), - switchProto.entryList.map { entryProto -> - val member = withLocation( - fileId = if (entryProto.hasFileId()) entryProto.fileId else null, - location = if (entryProto.hasLocation()) entryProto.location else null - ) { - if (entryProto.hasLabel()) { - JsCase().apply { caseExpression = deserialize(entryProto.label) } - } - else { - JsDefault() - } - } - member.statements += entryProto.statementList.map { deserialize(it) } - member - } - ) - } - - StatementCase.WHILE_STATEMENT -> { - val whileProto = proto.whileStatement - JsWhile(deserialize(whileProto.condition), deserialize(whileProto.body)) - } - - StatementCase.DO_WHILE_STATEMENT -> { - val doWhileProto = proto.doWhileStatement - JsDoWhile(deserialize(doWhileProto.condition), deserialize(doWhileProto.body)) - } - - StatementCase.FOR_STATEMENT -> { - val forProto = proto.forStatement - val initVars = if (forProto.hasVariables()) deserialize(forProto.variables) as JsVars else null - val initExpr = if (forProto.hasExpression()) deserialize(forProto.expression) else null - val condition = if (forProto.hasCondition()) deserialize(forProto.condition) else null - val increment = if (forProto.hasIncrement()) deserialize(forProto.increment) else null - val body = deserialize(forProto.body) - if (initVars != null) { - JsFor(initVars, condition, increment, body) - } - else { - JsFor(initExpr, condition, increment, body) - } - } - - StatementCase.FOR_IN_STATEMENT -> { - val forInProto = proto.forInStatement - val iterName = if (forInProto.hasNameId()) deserializeName(forInProto.nameId) else null - val iterExpr = if (forInProto.hasExpression()) deserialize(forInProto.expression) else null - val iterable = deserialize(forInProto.iterable) - val body = deserialize(forInProto.body) - JsForIn(iterName, iterExpr, iterable, body) - } - - StatementCase.TRY_STATEMENT -> { - val tryProto = proto.tryStatement - val tryBlock = deserialize(tryProto.tryBlock) as JsBlock - val catchBlock = if (tryProto.hasCatchBlock()) { - val catchProto = tryProto.catchBlock - JsCatch(deserializeName(catchProto.parameter.nameId)).apply { - body = deserialize(catchProto.body) as JsBlock - } - } - else { - null - } - val finallyBlock = if (tryProto.hasFinallyBlock()) deserialize(tryProto.finallyBlock) as JsBlock else null - JsTry(tryBlock, catchBlock, finallyBlock) - } - - StatementCase.EMPTY -> JsEmpty - - StatementCase.STATEMENT_NOT_SET, - null -> error("Statement not set") - } - - private fun deserialize(proto: Expression): JsExpression { - val expression = withLocation( - fileId = if (proto.hasFileId()) proto.fileId else null, - location = if (proto.hasLocation()) proto.location else null, - action = { deserializeNoMetadata(proto) } - ) - expression.synthetic = proto.synthetic - expression.sideEffects = map(proto.sideEffects) - if (proto.hasLocalAlias()) { - expression.localAlias = deserializeJsImportedModule(proto.localAlias) - } - return expression - } - - private fun deserializeJsImportedModule(proto: JsAstProtoBuf.JsImportedModule): JsImportedModule { - return JsImportedModule(deserializeString(proto.externalName), deserializeName(proto.internalName), if (proto.hasPlainReference()) deserialize(proto.plainReference!!) else null) - } - - private fun deserializeNoMetadata(proto: Expression): JsExpression = when (proto.expressionCase) { - ExpressionCase.THIS_LITERAL -> JsThisRef() - ExpressionCase.NULL_LITERAL -> JsNullLiteral() - ExpressionCase.TRUE_LITERAL -> JsBooleanLiteral(true) - ExpressionCase.FALSE_LITERAL -> JsBooleanLiteral(false) - ExpressionCase.STRING_LITERAL -> JsStringLiteral(deserializeString(proto.stringLiteral)) - ExpressionCase.INT_LITERAL -> JsIntLiteral(proto.intLiteral) - ExpressionCase.DOUBLE_LITERAL -> JsDoubleLiteral(proto.doubleLiteral) - ExpressionCase.SIMPLE_NAME_REFERENCE -> JsNameRef(deserializeName(proto.simpleNameReference)) - - ExpressionCase.REG_EXP_LITERAL -> { - val regExpProto = proto.regExpLiteral - JsRegExp().apply { - pattern = deserializeString(regExpProto.patternStringId) - if (regExpProto.hasFlagsStringId()) { - flags = deserializeString(regExpProto.flagsStringId) - } - } - } - - ExpressionCase.ARRAY_LITERAL -> { - val arrayProto = proto.arrayLiteral - JsArrayLiteral(arrayProto.elementList.map { deserialize(it) }) - } - - ExpressionCase.OBJECT_LITERAL -> { - val objectProto = proto.objectLiteral - JsObjectLiteral( - objectProto.entryList.map { entryProto -> - JsPropertyInitializer(deserialize(entryProto.key), deserialize(entryProto.value)) - }, - objectProto.multiline - ) - } - - ExpressionCase.FUNCTION -> { - val functionProto = proto.function - JsFunction(scope, deserialize(functionProto.body) as JsBlock, "").apply { - parameters += functionProto.parameterList.map { deserializeParameter(it) } - if (functionProto.hasNameId()) { - name = deserializeName(functionProto.nameId) - } - isLocal = functionProto.local - } - } - - ExpressionCase.DOC_COMMENT -> { - val docCommentProto = proto.docComment - JsDocComment(docCommentProto.tagList.associate { tagProto -> - val name = deserializeString(tagProto.nameId) - val value: Any = if (tagProto.hasExpression()) { - deserialize(tagProto.expression) - } - else { - deserializeString(tagProto.valueStringId) - } - name to value - }) - } - - ExpressionCase.BINARY -> { - val binaryProto = proto.binary - JsBinaryOperation(map(binaryProto.type), deserialize(binaryProto.left), deserialize(binaryProto.right)) - } - - ExpressionCase.UNARY -> { - val unaryProto = proto.unary - val type = map(unaryProto.type) - val operand = deserialize(unaryProto.operand) - if (unaryProto.postfix) JsPostfixOperation(type, operand) else JsPrefixOperation(type, operand) - } - - ExpressionCase.CONDITIONAL -> { - val conditionalProto = proto.conditional - JsConditional( - deserialize(conditionalProto.testExpression), - deserialize(conditionalProto.thenExpression), - deserialize(conditionalProto.elseExpression) - ) - } - - ExpressionCase.ARRAY_ACCESS -> { - val arrayAccessProto = proto.arrayAccess - JsArrayAccess(deserialize(arrayAccessProto.array), deserialize(arrayAccessProto.index)) - } - - ExpressionCase.NAME_REFERENCE -> { - val nameRefProto = proto.nameReference - val qualifier = if (nameRefProto.hasQualifier()) deserialize(nameRefProto.qualifier) else null - JsNameRef(deserializeName(nameRefProto.nameId), qualifier).apply { - if (nameRefProto.hasInlineStrategy()) { - isInline = map(nameRefProto.inlineStrategy) - } - } - } - - ExpressionCase.PROPERTY_REFERENCE -> { - val propertyRefProto = proto.propertyReference - val qualifier = if (propertyRefProto.hasQualifier()) deserialize(propertyRefProto.qualifier) else null - JsNameRef(deserializeString(propertyRefProto.stringId), qualifier).apply { - if (propertyRefProto.hasInlineStrategy()) { - isInline = map(propertyRefProto.inlineStrategy) - } - } - } - - ExpressionCase.INVOCATION -> { - val invocationProto = proto.invocation - JsInvocation( - deserialize(invocationProto.qualifier), - invocationProto.argumentList.map { deserialize(it) } - ).apply { - if (invocationProto.hasInlineStrategy()) { - isInline = map(invocationProto.inlineStrategy) - } - } - } - - ExpressionCase.INSTANTIATION -> { - val instantiationProto = proto.instantiation - JsNew( - deserialize(instantiationProto.qualifier), - instantiationProto.argumentList.map { deserialize(it) } - ) - } - - null, - ExpressionCase.EXPRESSION_NOT_SET -> error("Unknown expression") - } - - private fun deserializeVars(proto: Vars): JsVars { - val vars = JsVars(proto.multiline) - for (declProto in proto.declarationList) { - vars.vars += withLocation( - fileId = if (declProto.hasFileId()) declProto.fileId else null, - location = if (declProto.hasLocation()) declProto.location else null - ) { - val initialValue = if (declProto.hasInitialValue()) deserialize(declProto.initialValue) else null - JsVars.JsVar(deserializeName(declProto.nameId), initialValue) - } - } - if (proto.hasExportedPackageId()) { - vars.exportedPackage = deserializeString(proto.exportedPackageId) - } - return vars - } - - private fun deserializeGlobalBlock(proto: GlobalBlock): JsGlobalBlock { - return JsGlobalBlock().apply { statements += proto.statementList.map { deserialize(it) } } - } - - private fun deserializeParameter(proto: Parameter): JsParameter { - return JsParameter(deserializeName(proto.nameId)).apply { - hasDefaultValue = proto.hasDefaultValue - } - } - - private fun deserializeName(id: Int): JsName { - return nameCache[id] ?: let { - val nameProto = nameTable[id] - val identifier = deserializeString(nameProto.identifier) - val name = if (nameProto.temporary) { - JsScope.declareTemporaryName(identifier) - } - else { - JsDynamicScope.declareName(identifier) - } - if (nameProto.hasLocalNameId()) { - name.localAlias = deserializeLocalAlias(nameProto.localNameId) - } - if (nameProto.hasImported()) { - name.imported = nameProto.imported - } - if (nameProto.hasSpecialFunction()) { - name.specialFunction = map(nameProto.specialFunction) - } - nameCache[id] = name - name - } - } - - private fun deserializeLocalAlias(localNameId: JsAstProtoBuf.LocalAlias): LocalAlias { - return LocalAlias(deserializeName(localNameId.localNameId), - if (localNameId.hasTag()) deserializeString(localNameId.tag) else null) - } - - - private fun deserializeString(id: Int): String = stringTable[id] - - private fun map(op: BinaryOperation.Type) = when (op) { - BinaryOperation.Type.MUL -> JsBinaryOperator.MUL - BinaryOperation.Type.DIV -> JsBinaryOperator.DIV - BinaryOperation.Type.MOD -> JsBinaryOperator.MOD - BinaryOperation.Type.ADD -> JsBinaryOperator.ADD - BinaryOperation.Type.SUB -> JsBinaryOperator.SUB - BinaryOperation.Type.SHL -> JsBinaryOperator.SHL - BinaryOperation.Type.SHR -> JsBinaryOperator.SHR - BinaryOperation.Type.SHRU -> JsBinaryOperator.SHRU - BinaryOperation.Type.LT -> JsBinaryOperator.LT - BinaryOperation.Type.LTE -> JsBinaryOperator.LTE - BinaryOperation.Type.GT -> JsBinaryOperator.GT - BinaryOperation.Type.GTE -> JsBinaryOperator.GTE - BinaryOperation.Type.INSTANCEOF -> JsBinaryOperator.INSTANCEOF - BinaryOperation.Type.IN -> JsBinaryOperator.INOP - BinaryOperation.Type.EQ -> JsBinaryOperator.EQ - BinaryOperation.Type.NEQ -> JsBinaryOperator.NEQ - BinaryOperation.Type.REF_EQ -> JsBinaryOperator.REF_EQ - BinaryOperation.Type.REF_NEQ -> JsBinaryOperator.REF_NEQ - BinaryOperation.Type.BIT_AND -> JsBinaryOperator.BIT_AND - BinaryOperation.Type.BIT_XOR -> JsBinaryOperator.BIT_XOR - BinaryOperation.Type.BIT_OR -> JsBinaryOperator.BIT_OR - BinaryOperation.Type.AND -> JsBinaryOperator.AND - BinaryOperation.Type.OR -> JsBinaryOperator.OR - BinaryOperation.Type.ASG -> JsBinaryOperator.ASG - BinaryOperation.Type.ASG_ADD -> JsBinaryOperator.ASG_ADD - BinaryOperation.Type.ASG_SUB -> JsBinaryOperator.ASG_SUB - BinaryOperation.Type.ASG_MUL -> JsBinaryOperator.ASG_MUL - BinaryOperation.Type.ASG_DIV -> JsBinaryOperator.ASG_DIV - BinaryOperation.Type.ASG_MOD -> JsBinaryOperator.ASG_MOD - BinaryOperation.Type.ASG_SHL -> JsBinaryOperator.ASG_SHL - BinaryOperation.Type.ASG_SHR -> JsBinaryOperator.ASG_SHR - BinaryOperation.Type.ASG_SHRU -> JsBinaryOperator.ASG_SHRU - BinaryOperation.Type.ASG_BIT_AND -> JsBinaryOperator.ASG_BIT_AND - BinaryOperation.Type.ASG_BIT_OR -> JsBinaryOperator.ASG_BIT_OR - BinaryOperation.Type.ASG_BIT_XOR -> JsBinaryOperator.ASG_BIT_XOR - BinaryOperation.Type.COMMA -> JsBinaryOperator.COMMA - } - - private fun map(op: UnaryOperation.Type) = when (op) { - UnaryOperation.Type.BIT_NOT -> JsUnaryOperator.BIT_NOT - UnaryOperation.Type.DEC -> JsUnaryOperator.DEC - UnaryOperation.Type.DELETE -> JsUnaryOperator.DELETE - UnaryOperation.Type.INC -> JsUnaryOperator.INC - UnaryOperation.Type.NEG -> JsUnaryOperator.NEG - UnaryOperation.Type.POS -> JsUnaryOperator.POS - UnaryOperation.Type.NOT -> JsUnaryOperator.NOT - UnaryOperation.Type.TYPEOF -> JsUnaryOperator.TYPEOF - UnaryOperation.Type.VOID -> JsUnaryOperator.VOID - } - - private fun map(sideEffects: SideEffects) = when (sideEffects) { - SideEffects.AFFECTS_STATE -> SideEffectKind.AFFECTS_STATE - SideEffects.DEPENDS_ON_STATE -> SideEffectKind.DEPENDS_ON_STATE - SideEffects.PURE -> SideEffectKind.PURE - } - - private fun map(inlineStrategy: InlineStrategy) = - inlineStrategy == InlineStrategy.AS_FUNCTION || inlineStrategy == InlineStrategy.IN_PLACE - - private fun map(specialFunction: JsAstProtoBuf.SpecialFunction) = when(specialFunction) { - JsAstProtoBuf.SpecialFunction.DEFINE_INLINE_FUNCTION -> SpecialFunction.DEFINE_INLINE_FUNCTION - JsAstProtoBuf.SpecialFunction.WRAP_FUNCTION -> SpecialFunction.WRAP_FUNCTION - JsAstProtoBuf.SpecialFunction.TO_BOXED_CHAR -> SpecialFunction.TO_BOXED_CHAR - JsAstProtoBuf.SpecialFunction.UNBOX_CHAR -> SpecialFunction.UNBOX_CHAR - JsAstProtoBuf.SpecialFunction.SUSPEND_CALL -> SpecialFunction.SUSPEND_CALL - JsAstProtoBuf.SpecialFunction.COROUTINE_RESULT -> SpecialFunction.COROUTINE_RESULT - JsAstProtoBuf.SpecialFunction.COROUTINE_CONTROLLER -> SpecialFunction.COROUTINE_CONTROLLER - JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER -> SpecialFunction.COROUTINE_RECEIVER - JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT -> SpecialFunction.SET_COROUTINE_RESULT - JsAstProtoBuf.SpecialFunction.GET_KCLASS -> SpecialFunction.GET_KCLASS - JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE - } - - private fun withLocation(fileId: Int?, location: Location?, action: () -> T): T { - val deserializedFile = fileId?.let { deserializeString(it) } - val file = deserializedFile ?: fileStack.peek() - val deserializedLocation = if (file != null && location != null) { - JsLocation(file, location.startLine, location.startChar) - } - else { - null - } - - val shouldUpdateFile = location != null && deserializedFile != null && deserializedFile != fileStack.peek() - if (shouldUpdateFile) { - fileStack.push(deserializedFile) - } - val node = action() - if (deserializedLocation != null) { - val contentFile = sourceRoots - .map { File(it, file) } - .firstOrNull { it.exists() } - node.source = if (contentFile != null) { - JsLocationWithEmbeddedSource(deserializedLocation, null) { InputStreamReader(FileInputStream(contentFile), "UTF-8") } - } - else { - deserializedLocation - } - } - if (shouldUpdateFile) { - fileStack.pop() - } - - return node + return if (contentFile != null) { + JsLocationWithEmbeddedSource(deserializedLocation, null) { InputStreamReader(FileInputStream(contentFile), "UTF-8") } + } else null } } diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializerBase.kt b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializerBase.kt new file mode 100644 index 00000000000..9e147e69300 --- /dev/null +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstDeserializerBase.kt @@ -0,0 +1,481 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.serialization.js.ast + +import org.jetbrains.kotlin.js.backend.ast.* +import org.jetbrains.kotlin.js.backend.ast.metadata.* +import java.util.* + +abstract class JsAstDeserializerBase { + abstract val scope: JsScope + protected val stringTable = mutableListOf() + protected val nameTable = mutableListOf() + protected val nameCache = mutableListOf() + protected val fileStack: Deque = ArrayDeque() + + protected fun deserialize(proto: JsAstProtoBuf.Statement): JsStatement { + val statement = withLocation( + fileId = if (proto.hasFileId()) proto.fileId else null, + location = if (proto.hasLocation()) proto.location else null, + action = { deserializeNoMetadata(proto) } + ) + if (statement is HasMetadata) { + statement.synthetic = proto.synthetic + } + return statement + } + + protected fun deserializeNoMetadata(proto: JsAstProtoBuf.Statement): JsStatement = when (proto.statementCase) { + JsAstProtoBuf.Statement.StatementCase.RETURN_STATEMENT -> { + val returnProto = proto.returnStatement + JsReturn(if (returnProto.hasValue()) deserialize(returnProto.value) else null) + } + + JsAstProtoBuf.Statement.StatementCase.THROW_STATEMENT -> { + val throwProto = proto.throwStatement + JsThrow(deserialize(throwProto.exception)) + } + + JsAstProtoBuf.Statement.StatementCase.BREAK_STATEMENT -> { + val breakProto = proto.breakStatement + JsBreak(if (breakProto.hasLabelId()) JsNameRef(deserializeName(breakProto.labelId)) else null) + } + + JsAstProtoBuf.Statement.StatementCase.CONTINUE_STATEMENT -> { + val continueProto = proto.continueStatement + JsContinue(if (continueProto.hasLabelId()) JsNameRef(deserializeName(continueProto.labelId)) else null) + } + + JsAstProtoBuf.Statement.StatementCase.DEBUGGER -> { + JsDebugger() + } + + JsAstProtoBuf.Statement.StatementCase.EXPRESSION -> { + val expressionProto = proto.expression + JsExpressionStatement(deserialize(expressionProto.expression)).also { + if (expressionProto.hasExportedTagId()) { + it.exportedTag = deserializeString(expressionProto.exportedTagId) + } + } + } + + JsAstProtoBuf.Statement.StatementCase.VARS -> { + deserializeVars(proto.vars) + } + + JsAstProtoBuf.Statement.StatementCase.BLOCK -> { + val blockProto = proto.block + val block = JsBlock() + block.statements += blockProto.statementList.map { deserialize(it) } + block + } + + JsAstProtoBuf.Statement.StatementCase.GLOBAL_BLOCK -> { + deserializeGlobalBlock(proto.globalBlock) + } + + JsAstProtoBuf.Statement.StatementCase.LABEL -> { + val labelProto = proto.label + JsLabel(deserializeName(labelProto.nameId), deserialize(labelProto.innerStatement)) + } + + JsAstProtoBuf.Statement.StatementCase.IF_STATEMENT -> { + val ifProto = proto.ifStatement + JsIf( + deserialize(ifProto.condition), + deserialize(ifProto.thenStatement), + if (ifProto.hasElseStatement()) deserialize(ifProto.elseStatement) else null + ) + } + + JsAstProtoBuf.Statement.StatementCase.SWITCH_STATEMENT -> { + val switchProto = proto.switchStatement + JsSwitch( + deserialize(switchProto.expression), + switchProto.entryList.map { entryProto -> + val member = withLocation( + fileId = if (entryProto.hasFileId()) entryProto.fileId else null, + location = if (entryProto.hasLocation()) entryProto.location else null + ) { + if (entryProto.hasLabel()) { + JsCase().apply { caseExpression = deserialize(entryProto.label) } + } else { + JsDefault() + } + } + member.statements += entryProto.statementList.map { deserialize(it) } + member + } + ) + } + + JsAstProtoBuf.Statement.StatementCase.WHILE_STATEMENT -> { + val whileProto = proto.whileStatement + JsWhile(deserialize(whileProto.condition), deserialize(whileProto.body)) + } + + JsAstProtoBuf.Statement.StatementCase.DO_WHILE_STATEMENT -> { + val doWhileProto = proto.doWhileStatement + JsDoWhile(deserialize(doWhileProto.condition), deserialize(doWhileProto.body)) + } + + JsAstProtoBuf.Statement.StatementCase.FOR_STATEMENT -> { + val forProto = proto.forStatement + val initVars = if (forProto.hasVariables()) deserialize(forProto.variables) as JsVars else null + val initExpr = if (forProto.hasExpression()) deserialize(forProto.expression) else null + val condition = if (forProto.hasCondition()) deserialize(forProto.condition) else null + val increment = if (forProto.hasIncrement()) deserialize(forProto.increment) else null + val body = deserialize(forProto.body) + if (initVars != null) { + JsFor(initVars, condition, increment, body) + } else { + JsFor(initExpr, condition, increment, body) + } + } + + JsAstProtoBuf.Statement.StatementCase.FOR_IN_STATEMENT -> { + val forInProto = proto.forInStatement + val iterName = if (forInProto.hasNameId()) deserializeName(forInProto.nameId) else null + val iterExpr = if (forInProto.hasExpression()) deserialize(forInProto.expression) else null + val iterable = deserialize(forInProto.iterable) + val body = deserialize(forInProto.body) + JsForIn(iterName, iterExpr, iterable, body) + } + + JsAstProtoBuf.Statement.StatementCase.TRY_STATEMENT -> { + val tryProto = proto.tryStatement + val tryBlock = deserialize(tryProto.tryBlock) as JsBlock + val catchBlock = if (tryProto.hasCatchBlock()) { + val catchProto = tryProto.catchBlock + JsCatch(deserializeName(catchProto.parameter.nameId)).apply { + body = deserialize(catchProto.body) as JsBlock + } + } else { + null + } + val finallyBlock = if (tryProto.hasFinallyBlock()) deserialize(tryProto.finallyBlock) as JsBlock else null + JsTry(tryBlock, catchBlock, finallyBlock) + } + + JsAstProtoBuf.Statement.StatementCase.EMPTY -> JsEmpty + + JsAstProtoBuf.Statement.StatementCase.SINGLE_LINE_COMMENT -> JsSingleLineComment(proto.singleLineComment.message) + + JsAstProtoBuf.Statement.StatementCase.STATEMENT_NOT_SET, + null -> error("Statement not set") + } + + protected fun deserialize(proto: JsAstProtoBuf.Expression): JsExpression { + val expression = withLocation( + fileId = if (proto.hasFileId()) proto.fileId else null, + location = if (proto.hasLocation()) proto.location else null, + action = { deserializeNoMetadata(proto) } + ) + expression.synthetic = proto.synthetic + expression.sideEffects = map(proto.sideEffects) + if (proto.hasLocalAlias()) { + expression.localAlias = deserializeJsImportedModule(proto.localAlias) + } + return expression + } + + protected fun deserializeJsImportedModule(proto: JsAstProtoBuf.JsImportedModule): JsImportedModule { + return JsImportedModule( + deserializeString(proto.externalName), + deserializeName(proto.internalName), + if (proto.hasPlainReference()) deserialize(proto.plainReference!!) else null + ) + } + + protected fun deserializeNoMetadata(proto: JsAstProtoBuf.Expression): JsExpression = when (proto.expressionCase) { + JsAstProtoBuf.Expression.ExpressionCase.THIS_LITERAL -> JsThisRef() + JsAstProtoBuf.Expression.ExpressionCase.NULL_LITERAL -> JsNullLiteral() + JsAstProtoBuf.Expression.ExpressionCase.TRUE_LITERAL -> JsBooleanLiteral(true) + JsAstProtoBuf.Expression.ExpressionCase.FALSE_LITERAL -> JsBooleanLiteral(false) + JsAstProtoBuf.Expression.ExpressionCase.STRING_LITERAL -> JsStringLiteral(deserializeString(proto.stringLiteral)) + JsAstProtoBuf.Expression.ExpressionCase.INT_LITERAL -> JsIntLiteral(proto.intLiteral) + JsAstProtoBuf.Expression.ExpressionCase.DOUBLE_LITERAL -> JsDoubleLiteral(proto.doubleLiteral) + JsAstProtoBuf.Expression.ExpressionCase.SIMPLE_NAME_REFERENCE -> JsNameRef(deserializeName(proto.simpleNameReference)) + + JsAstProtoBuf.Expression.ExpressionCase.REG_EXP_LITERAL -> { + val regExpProto = proto.regExpLiteral + JsRegExp().apply { + pattern = deserializeString(regExpProto.patternStringId) + if (regExpProto.hasFlagsStringId()) { + flags = deserializeString(regExpProto.flagsStringId) + } + } + } + + JsAstProtoBuf.Expression.ExpressionCase.ARRAY_LITERAL -> { + val arrayProto = proto.arrayLiteral + JsArrayLiteral(arrayProto.elementList.map { deserialize(it) }) + } + + JsAstProtoBuf.Expression.ExpressionCase.OBJECT_LITERAL -> { + val objectProto = proto.objectLiteral + JsObjectLiteral( + objectProto.entryList.map { entryProto -> + JsPropertyInitializer(deserialize(entryProto.key), deserialize(entryProto.value)) + }, + objectProto.multiline + ) + } + + JsAstProtoBuf.Expression.ExpressionCase.FUNCTION -> { + val functionProto = proto.function + JsFunction(scope, deserialize(functionProto.body) as JsBlock, "").apply { + parameters += functionProto.parameterList.map { deserializeParameter(it) } + if (functionProto.hasNameId()) { + name = deserializeName(functionProto.nameId) + } + isLocal = functionProto.local + } + } + + JsAstProtoBuf.Expression.ExpressionCase.DOC_COMMENT -> { + val docCommentProto = proto.docComment + JsDocComment(docCommentProto.tagList.associate { tagProto -> + val name = deserializeString(tagProto.nameId) + val value: Any = if (tagProto.hasExpression()) { + deserialize(tagProto.expression) + } else { + deserializeString(tagProto.valueStringId) + } + name to value + }) + } + + JsAstProtoBuf.Expression.ExpressionCase.BINARY -> { + val binaryProto = proto.binary + JsBinaryOperation(map(binaryProto.type), deserialize(binaryProto.left), deserialize(binaryProto.right)) + } + + JsAstProtoBuf.Expression.ExpressionCase.UNARY -> { + val unaryProto = proto.unary + val type = map(unaryProto.type) + val operand = deserialize(unaryProto.operand) + if (unaryProto.postfix) JsPostfixOperation(type, operand) else JsPrefixOperation(type, operand) + } + + JsAstProtoBuf.Expression.ExpressionCase.CONDITIONAL -> { + val conditionalProto = proto.conditional + JsConditional( + deserialize(conditionalProto.testExpression), + deserialize(conditionalProto.thenExpression), + deserialize(conditionalProto.elseExpression) + ) + } + + JsAstProtoBuf.Expression.ExpressionCase.ARRAY_ACCESS -> { + val arrayAccessProto = proto.arrayAccess + JsArrayAccess(deserialize(arrayAccessProto.array), deserialize(arrayAccessProto.index)) + } + + JsAstProtoBuf.Expression.ExpressionCase.NAME_REFERENCE -> { + val nameRefProto = proto.nameReference + val qualifier = if (nameRefProto.hasQualifier()) deserialize(nameRefProto.qualifier) else null + JsNameRef(deserializeName(nameRefProto.nameId), qualifier).apply { + if (nameRefProto.hasInlineStrategy()) { + isInline = map(nameRefProto.inlineStrategy) + } + } + } + + JsAstProtoBuf.Expression.ExpressionCase.PROPERTY_REFERENCE -> { + val propertyRefProto = proto.propertyReference + val qualifier = if (propertyRefProto.hasQualifier()) deserialize(propertyRefProto.qualifier) else null + JsNameRef(deserializeString(propertyRefProto.stringId), qualifier).apply { + if (propertyRefProto.hasInlineStrategy()) { + isInline = map(propertyRefProto.inlineStrategy) + } + } + } + + JsAstProtoBuf.Expression.ExpressionCase.INVOCATION -> { + val invocationProto = proto.invocation + JsInvocation( + deserialize(invocationProto.qualifier), + invocationProto.argumentList.map { deserialize(it) } + ).apply { + if (invocationProto.hasInlineStrategy()) { + isInline = map(invocationProto.inlineStrategy) + } + } + } + + JsAstProtoBuf.Expression.ExpressionCase.INSTANTIATION -> { + val instantiationProto = proto.instantiation + JsNew( + deserialize(instantiationProto.qualifier), + instantiationProto.argumentList.map { deserialize(it) } + ) + } + + null, + JsAstProtoBuf.Expression.ExpressionCase.EXPRESSION_NOT_SET -> error("Unknown expression") + } + + protected fun deserializeVars(proto: JsAstProtoBuf.Vars): JsVars { + val vars = JsVars(proto.multiline) + for (declProto in proto.declarationList) { + vars.vars += withLocation( + fileId = if (declProto.hasFileId()) declProto.fileId else null, + location = if (declProto.hasLocation()) declProto.location else null + ) { + val initialValue = if (declProto.hasInitialValue()) deserialize(declProto.initialValue) else null + JsVars.JsVar(deserializeName(declProto.nameId), initialValue) + } + } + if (proto.hasExportedPackageId()) { + vars.exportedPackage = deserializeString(proto.exportedPackageId) + } + return vars + } + + protected fun deserializeGlobalBlock(proto: JsAstProtoBuf.GlobalBlock): JsGlobalBlock { + return JsGlobalBlock().apply { statements += proto.statementList.map { deserialize(it) } } + } + + protected fun deserializeParameter(proto: JsAstProtoBuf.Parameter): JsParameter { + return JsParameter(deserializeName(proto.nameId)).apply { + hasDefaultValue = proto.hasDefaultValue + } + } + + protected fun deserializeName(id: Int): JsName { + return nameCache[id] ?: let { + val nameProto = nameTable[id] + val identifier = deserializeString(nameProto.identifier) + val name = if (nameProto.temporary) { + JsScope.declareTemporaryName(identifier) + } else { + JsDynamicScope.declareName(identifier) + } + if (nameProto.hasLocalNameId()) { + name.localAlias = deserializeLocalAlias(nameProto.localNameId) + } + if (nameProto.hasImported()) { + name.imported = nameProto.imported + } + if (nameProto.hasSpecialFunction()) { + name.specialFunction = map(nameProto.specialFunction) + } + nameCache[id] = name + name + } + } + + protected fun deserializeLocalAlias(localNameId: JsAstProtoBuf.LocalAlias): LocalAlias { + return LocalAlias( + deserializeName(localNameId.localNameId), + if (localNameId.hasTag()) deserializeString(localNameId.tag) else null + ) + } + + + protected fun deserializeString(id: Int): String = stringTable[id] + + protected fun map(op: JsAstProtoBuf.BinaryOperation.Type) = when (op) { + JsAstProtoBuf.BinaryOperation.Type.MUL -> JsBinaryOperator.MUL + JsAstProtoBuf.BinaryOperation.Type.DIV -> JsBinaryOperator.DIV + JsAstProtoBuf.BinaryOperation.Type.MOD -> JsBinaryOperator.MOD + JsAstProtoBuf.BinaryOperation.Type.ADD -> JsBinaryOperator.ADD + JsAstProtoBuf.BinaryOperation.Type.SUB -> JsBinaryOperator.SUB + JsAstProtoBuf.BinaryOperation.Type.SHL -> JsBinaryOperator.SHL + JsAstProtoBuf.BinaryOperation.Type.SHR -> JsBinaryOperator.SHR + JsAstProtoBuf.BinaryOperation.Type.SHRU -> JsBinaryOperator.SHRU + JsAstProtoBuf.BinaryOperation.Type.LT -> JsBinaryOperator.LT + JsAstProtoBuf.BinaryOperation.Type.LTE -> JsBinaryOperator.LTE + JsAstProtoBuf.BinaryOperation.Type.GT -> JsBinaryOperator.GT + JsAstProtoBuf.BinaryOperation.Type.GTE -> JsBinaryOperator.GTE + JsAstProtoBuf.BinaryOperation.Type.INSTANCEOF -> JsBinaryOperator.INSTANCEOF + JsAstProtoBuf.BinaryOperation.Type.IN -> JsBinaryOperator.INOP + JsAstProtoBuf.BinaryOperation.Type.EQ -> JsBinaryOperator.EQ + JsAstProtoBuf.BinaryOperation.Type.NEQ -> JsBinaryOperator.NEQ + JsAstProtoBuf.BinaryOperation.Type.REF_EQ -> JsBinaryOperator.REF_EQ + JsAstProtoBuf.BinaryOperation.Type.REF_NEQ -> JsBinaryOperator.REF_NEQ + JsAstProtoBuf.BinaryOperation.Type.BIT_AND -> JsBinaryOperator.BIT_AND + JsAstProtoBuf.BinaryOperation.Type.BIT_XOR -> JsBinaryOperator.BIT_XOR + JsAstProtoBuf.BinaryOperation.Type.BIT_OR -> JsBinaryOperator.BIT_OR + JsAstProtoBuf.BinaryOperation.Type.AND -> JsBinaryOperator.AND + JsAstProtoBuf.BinaryOperation.Type.OR -> JsBinaryOperator.OR + JsAstProtoBuf.BinaryOperation.Type.ASG -> JsBinaryOperator.ASG + JsAstProtoBuf.BinaryOperation.Type.ASG_ADD -> JsBinaryOperator.ASG_ADD + JsAstProtoBuf.BinaryOperation.Type.ASG_SUB -> JsBinaryOperator.ASG_SUB + JsAstProtoBuf.BinaryOperation.Type.ASG_MUL -> JsBinaryOperator.ASG_MUL + JsAstProtoBuf.BinaryOperation.Type.ASG_DIV -> JsBinaryOperator.ASG_DIV + JsAstProtoBuf.BinaryOperation.Type.ASG_MOD -> JsBinaryOperator.ASG_MOD + JsAstProtoBuf.BinaryOperation.Type.ASG_SHL -> JsBinaryOperator.ASG_SHL + JsAstProtoBuf.BinaryOperation.Type.ASG_SHR -> JsBinaryOperator.ASG_SHR + JsAstProtoBuf.BinaryOperation.Type.ASG_SHRU -> JsBinaryOperator.ASG_SHRU + JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_AND -> JsBinaryOperator.ASG_BIT_AND + JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_OR -> JsBinaryOperator.ASG_BIT_OR + JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_XOR -> JsBinaryOperator.ASG_BIT_XOR + JsAstProtoBuf.BinaryOperation.Type.COMMA -> JsBinaryOperator.COMMA + } + + protected fun map(op: JsAstProtoBuf.UnaryOperation.Type) = when (op) { + JsAstProtoBuf.UnaryOperation.Type.BIT_NOT -> JsUnaryOperator.BIT_NOT + JsAstProtoBuf.UnaryOperation.Type.DEC -> JsUnaryOperator.DEC + JsAstProtoBuf.UnaryOperation.Type.DELETE -> JsUnaryOperator.DELETE + JsAstProtoBuf.UnaryOperation.Type.INC -> JsUnaryOperator.INC + JsAstProtoBuf.UnaryOperation.Type.NEG -> JsUnaryOperator.NEG + JsAstProtoBuf.UnaryOperation.Type.POS -> JsUnaryOperator.POS + JsAstProtoBuf.UnaryOperation.Type.NOT -> JsUnaryOperator.NOT + JsAstProtoBuf.UnaryOperation.Type.TYPEOF -> JsUnaryOperator.TYPEOF + JsAstProtoBuf.UnaryOperation.Type.VOID -> JsUnaryOperator.VOID + } + + protected fun map(sideEffects: JsAstProtoBuf.SideEffects) = when (sideEffects) { + JsAstProtoBuf.SideEffects.AFFECTS_STATE -> SideEffectKind.AFFECTS_STATE + JsAstProtoBuf.SideEffects.DEPENDS_ON_STATE -> SideEffectKind.DEPENDS_ON_STATE + JsAstProtoBuf.SideEffects.PURE -> SideEffectKind.PURE + } + + protected fun map(inlineStrategy: JsAstProtoBuf.InlineStrategy) = + inlineStrategy == JsAstProtoBuf.InlineStrategy.AS_FUNCTION || inlineStrategy == JsAstProtoBuf.InlineStrategy.IN_PLACE + + protected fun map(specialFunction: JsAstProtoBuf.SpecialFunction) = when (specialFunction) { + JsAstProtoBuf.SpecialFunction.DEFINE_INLINE_FUNCTION -> SpecialFunction.DEFINE_INLINE_FUNCTION + JsAstProtoBuf.SpecialFunction.WRAP_FUNCTION -> SpecialFunction.WRAP_FUNCTION + JsAstProtoBuf.SpecialFunction.TO_BOXED_CHAR -> SpecialFunction.TO_BOXED_CHAR + JsAstProtoBuf.SpecialFunction.UNBOX_CHAR -> SpecialFunction.UNBOX_CHAR + JsAstProtoBuf.SpecialFunction.SUSPEND_CALL -> SpecialFunction.SUSPEND_CALL + JsAstProtoBuf.SpecialFunction.COROUTINE_RESULT -> SpecialFunction.COROUTINE_RESULT + JsAstProtoBuf.SpecialFunction.COROUTINE_CONTROLLER -> SpecialFunction.COROUTINE_CONTROLLER + JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER -> SpecialFunction.COROUTINE_RECEIVER + JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT -> SpecialFunction.SET_COROUTINE_RESULT + JsAstProtoBuf.SpecialFunction.GET_KCLASS -> SpecialFunction.GET_KCLASS + JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE + } + + protected fun withLocation(fileId: Int?, location: JsAstProtoBuf.Location?, action: () -> T): T { + val deserializedFile = fileId?.let { deserializeString(it) } + val file = deserializedFile ?: fileStack.peek() + val deserializedLocation = if (file != null && location != null) { + JsLocation(file, location.startLine, location.startChar) + } else { + null + } + + val shouldUpdateFile = location != null && deserializedFile != null && deserializedFile != fileStack.peek() + if (shouldUpdateFile) { + fileStack.push(deserializedFile) + } + val node = action() + if (deserializedLocation != null) { + node.source = embedSources(deserializedLocation, file) ?: deserializedLocation + } + if (shouldUpdateFile) { + fileStack.pop() + } + + return node + } + + protected abstract fun embedSources(deserializedLocation: JsLocation, file: String): JsLocationWithSource? +} \ No newline at end of file diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java index 1967910a8cd..ece753168a1 100644 --- a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java @@ -15655,2727 +15655,33 @@ public final class JsAstProtoBuf { * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; */ org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + boolean hasSingleLineComment(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment(); } - /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} - */ - public static final class Statement extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) - StatementOrBuilder { - // Use Statement.newBuilder() to construct. - private Statement(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Statement(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - - private static final Statement defaultInstance; - public static Statement getDefaultInstance() { - return defaultInstance; - } - - public Statement getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private Statement( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = - org.jetbrains.kotlin.protobuf.ByteString.newOutput(); - org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = - org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - fileId_ = input.readInt32(); - break; - } - case 18: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = location_.toBuilder(); - } - location_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(location_); - location_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 24: { - bitField0_ |= 0x00000004; - synthetic_ = input.readBool(); - break; - } - case 170: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder subBuilder = null; - if (statementCase_ == 21) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 21; - break; - } - case 178: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder subBuilder = null; - if (statementCase_ == 22) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 22; - break; - } - case 186: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder subBuilder = null; - if (statementCase_ == 23) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 23; - break; - } - case 194: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder subBuilder = null; - if (statementCase_ == 24) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 24; - break; - } - case 202: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder subBuilder = null; - if (statementCase_ == 25) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 25; - break; - } - case 210: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder subBuilder = null; - if (statementCase_ == 26) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 26; - break; - } - case 218: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder subBuilder = null; - if (statementCase_ == 27) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 27; - break; - } - case 226: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder subBuilder = null; - if (statementCase_ == 28) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 28; - break; - } - case 234: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (statementCase_ == 29) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 29; - break; - } - case 242: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder subBuilder = null; - if (statementCase_ == 30) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 30; - break; - } - case 250: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder subBuilder = null; - if (statementCase_ == 31) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 31; - break; - } - case 258: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder subBuilder = null; - if (statementCase_ == 32) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 32; - break; - } - case 266: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder subBuilder = null; - if (statementCase_ == 33) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 33; - break; - } - case 274: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder subBuilder = null; - if (statementCase_ == 34) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 34; - break; - } - case 282: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder subBuilder = null; - if (statementCase_ == 35) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 35; - break; - } - case 290: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder subBuilder = null; - if (statementCase_ == 36) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 36; - break; - } - case 298: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder subBuilder = null; - if (statementCase_ == 37) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 37; - break; - } - case 306: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder subBuilder = null; - if (statementCase_ == 38) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 38; - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public Statement parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new Statement(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - private int statementCase_ = 0; - private java.lang.Object statement_; - public enum StatementCase - implements org.jetbrains.kotlin.protobuf.Internal.EnumLite { - RETURN_STATEMENT(21), - THROW_STATEMENT(22), - BREAK_STATEMENT(23), - CONTINUE_STATEMENT(24), - DEBUGGER(25), - EXPRESSION(26), - VARS(27), - BLOCK(28), - GLOBAL_BLOCK(29), - LABEL(30), - IF_STATEMENT(31), - SWITCH_STATEMENT(32), - WHILE_STATEMENT(33), - DO_WHILE_STATEMENT(34), - FOR_STATEMENT(35), - FOR_IN_STATEMENT(36), - TRY_STATEMENT(37), - EMPTY(38), - STATEMENT_NOT_SET(0); - private int value = 0; - private StatementCase(int value) { - this.value = value; - } - public static StatementCase valueOf(int value) { - switch (value) { - case 21: return RETURN_STATEMENT; - case 22: return THROW_STATEMENT; - case 23: return BREAK_STATEMENT; - case 24: return CONTINUE_STATEMENT; - case 25: return DEBUGGER; - case 26: return EXPRESSION; - case 27: return VARS; - case 28: return BLOCK; - case 29: return GLOBAL_BLOCK; - case 30: return LABEL; - case 31: return IF_STATEMENT; - case 32: return SWITCH_STATEMENT; - case 33: return WHILE_STATEMENT; - case 34: return DO_WHILE_STATEMENT; - case 35: return FOR_STATEMENT; - case 36: return FOR_IN_STATEMENT; - case 37: return TRY_STATEMENT; - case 38: return EMPTY; - case 0: return STATEMENT_NOT_SET; - default: throw new java.lang.IllegalArgumentException( - "Value is undefined for this oneof enum."); - } - } - public int getNumber() { - return this.value; - } - }; - - public StatementCase - getStatementCase() { - return StatementCase.valueOf( - statementCase_); - } - - public static final int FILEID_FIELD_NUMBER = 1; - private int fileId_; - /** - * optional int32 fileId = 1; - */ - public boolean hasFileId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 fileId = 1; - */ - public int getFileId() { - return fileId_; - } - - public static final int LOCATION_FIELD_NUMBER = 2; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public boolean hasLocation() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { - return location_; - } - - public static final int SYNTHETIC_FIELD_NUMBER = 3; - private boolean synthetic_; - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean hasSynthetic() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean getSynthetic() { - return synthetic_; - } - - public static final int RETURN_STATEMENT_FIELD_NUMBER = 21; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public boolean hasReturnStatement() { - return statementCase_ == 21; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { - if (statementCase_ == 21) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); - } - - public static final int THROW_STATEMENT_FIELD_NUMBER = 22; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public boolean hasThrowStatement() { - return statementCase_ == 22; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { - if (statementCase_ == 22) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); - } - - public static final int BREAK_STATEMENT_FIELD_NUMBER = 23; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public boolean hasBreakStatement() { - return statementCase_ == 23; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { - if (statementCase_ == 23) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); - } - - public static final int CONTINUE_STATEMENT_FIELD_NUMBER = 24; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public boolean hasContinueStatement() { - return statementCase_ == 24; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { - if (statementCase_ == 24) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); - } - - public static final int DEBUGGER_FIELD_NUMBER = 25; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public boolean hasDebugger() { - return statementCase_ == 25; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { - if (statementCase_ == 25) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); - } - - public static final int EXPRESSION_FIELD_NUMBER = 26; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public boolean hasExpression() { - return statementCase_ == 26; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { - if (statementCase_ == 26) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); - } - - public static final int VARS_FIELD_NUMBER = 27; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public boolean hasVars() { - return statementCase_ == 27; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { - if (statementCase_ == 27) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); - } - - public static final int BLOCK_FIELD_NUMBER = 28; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public boolean hasBlock() { - return statementCase_ == 28; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { - if (statementCase_ == 28) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); - } - - public static final int GLOBAL_BLOCK_FIELD_NUMBER = 29; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public boolean hasGlobalBlock() { - return statementCase_ == 29; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { - if (statementCase_ == 29) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - } - - public static final int LABEL_FIELD_NUMBER = 30; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public boolean hasLabel() { - return statementCase_ == 30; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { - if (statementCase_ == 30) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); - } - - public static final int IF_STATEMENT_FIELD_NUMBER = 31; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public boolean hasIfStatement() { - return statementCase_ == 31; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { - if (statementCase_ == 31) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); - } - - public static final int SWITCH_STATEMENT_FIELD_NUMBER = 32; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public boolean hasSwitchStatement() { - return statementCase_ == 32; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { - if (statementCase_ == 32) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); - } - - public static final int WHILE_STATEMENT_FIELD_NUMBER = 33; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public boolean hasWhileStatement() { - return statementCase_ == 33; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { - if (statementCase_ == 33) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); - } - - public static final int DO_WHILE_STATEMENT_FIELD_NUMBER = 34; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public boolean hasDoWhileStatement() { - return statementCase_ == 34; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { - if (statementCase_ == 34) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); - } - - public static final int FOR_STATEMENT_FIELD_NUMBER = 35; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public boolean hasForStatement() { - return statementCase_ == 35; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { - if (statementCase_ == 35) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); - } - - public static final int FOR_IN_STATEMENT_FIELD_NUMBER = 36; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public boolean hasForInStatement() { - return statementCase_ == 36; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { - if (statementCase_ == 36) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); - } - - public static final int TRY_STATEMENT_FIELD_NUMBER = 37; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public boolean hasTryStatement() { - return statementCase_ == 37; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { - if (statementCase_ == 37) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); - } - - public static final int EMPTY_FIELD_NUMBER = 38; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public boolean hasEmpty() { - return statementCase_ == 38; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { - if (statementCase_ == 38) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); - } - - private void initFields() { - fileId_ = 0; - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - synthetic_ = false; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (hasLocation()) { - if (!getLocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReturnStatement()) { - if (!getReturnStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasThrowStatement()) { - if (!getThrowStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasExpression()) { - if (!getExpression().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasVars()) { - if (!getVars().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasBlock()) { - if (!getBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasGlobalBlock()) { - if (!getGlobalBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasLabel()) { - if (!getLabel().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasIfStatement()) { - if (!getIfStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSwitchStatement()) { - if (!getSwitchStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasWhileStatement()) { - if (!getWhileStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasDoWhileStatement()) { - if (!getDoWhileStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasForStatement()) { - if (!getForStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasForInStatement()) { - if (!getForInStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTryStatement()) { - if (!getTryStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, fileId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, location_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(3, synthetic_); - } - if (statementCase_ == 21) { - output.writeMessage(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - } - if (statementCase_ == 22) { - output.writeMessage(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - } - if (statementCase_ == 23) { - output.writeMessage(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - } - if (statementCase_ == 24) { - output.writeMessage(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - } - if (statementCase_ == 25) { - output.writeMessage(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - } - if (statementCase_ == 26) { - output.writeMessage(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - } - if (statementCase_ == 27) { - output.writeMessage(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - } - if (statementCase_ == 28) { - output.writeMessage(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - } - if (statementCase_ == 29) { - output.writeMessage(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - } - if (statementCase_ == 30) { - output.writeMessage(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - } - if (statementCase_ == 31) { - output.writeMessage(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - } - if (statementCase_ == 32) { - output.writeMessage(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - } - if (statementCase_ == 33) { - output.writeMessage(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - } - if (statementCase_ == 34) { - output.writeMessage(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - } - if (statementCase_ == 35) { - output.writeMessage(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - } - if (statementCase_ == 36) { - output.writeMessage(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - } - if (statementCase_ == 37) { - output.writeMessage(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - } - if (statementCase_ == 38) { - output.writeMessage(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(1, fileId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, location_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeBoolSize(3, synthetic_); - } - if (statementCase_ == 21) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - } - if (statementCase_ == 22) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - } - if (statementCase_ == 23) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - } - if (statementCase_ == 24) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - } - if (statementCase_ == 25) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - } - if (statementCase_ == 26) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - } - if (statementCase_ == 27) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - } - if (statementCase_ == 28) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - } - if (statementCase_ == 29) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - } - if (statementCase_ == 30) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - } - if (statementCase_ == 31) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - } - if (statementCase_ == 32) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - } - if (statementCase_ == 33) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - } - if (statementCase_ == 34) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - } - if (statementCase_ == 35) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - } - if (statementCase_ == 36) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - } - if (statementCase_ == 37) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - } - if (statementCase_ == 38) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } + public interface SingleLineCommentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} + * required string message = 1; */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.StatementOrBuilder { - // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - fileId_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - synthetic_ = false; - bitField0_ = (bitField0_ & ~0x00000004); - statementCase_ = 0; - statement_ = null; - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getDefaultInstanceForType() { - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement build() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement buildPartial() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.fileId_ = fileId_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.location_ = location_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.synthetic_ = synthetic_; - if (statementCase_ == 21) { - result.statement_ = statement_; - } - if (statementCase_ == 22) { - result.statement_ = statement_; - } - if (statementCase_ == 23) { - result.statement_ = statement_; - } - if (statementCase_ == 24) { - result.statement_ = statement_; - } - if (statementCase_ == 25) { - result.statement_ = statement_; - } - if (statementCase_ == 26) { - result.statement_ = statement_; - } - if (statementCase_ == 27) { - result.statement_ = statement_; - } - if (statementCase_ == 28) { - result.statement_ = statement_; - } - if (statementCase_ == 29) { - result.statement_ = statement_; - } - if (statementCase_ == 30) { - result.statement_ = statement_; - } - if (statementCase_ == 31) { - result.statement_ = statement_; - } - if (statementCase_ == 32) { - result.statement_ = statement_; - } - if (statementCase_ == 33) { - result.statement_ = statement_; - } - if (statementCase_ == 34) { - result.statement_ = statement_; - } - if (statementCase_ == 35) { - result.statement_ = statement_; - } - if (statementCase_ == 36) { - result.statement_ = statement_; - } - if (statementCase_ == 37) { - result.statement_ = statement_; - } - if (statementCase_ == 38) { - result.statement_ = statement_; - } - result.bitField0_ = to_bitField0_; - result.statementCase_ = statementCase_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement other) { - if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) return this; - if (other.hasFileId()) { - setFileId(other.getFileId()); - } - if (other.hasLocation()) { - mergeLocation(other.getLocation()); - } - if (other.hasSynthetic()) { - setSynthetic(other.getSynthetic()); - } - switch (other.getStatementCase()) { - case RETURN_STATEMENT: { - mergeReturnStatement(other.getReturnStatement()); - break; - } - case THROW_STATEMENT: { - mergeThrowStatement(other.getThrowStatement()); - break; - } - case BREAK_STATEMENT: { - mergeBreakStatement(other.getBreakStatement()); - break; - } - case CONTINUE_STATEMENT: { - mergeContinueStatement(other.getContinueStatement()); - break; - } - case DEBUGGER: { - mergeDebugger(other.getDebugger()); - break; - } - case EXPRESSION: { - mergeExpression(other.getExpression()); - break; - } - case VARS: { - mergeVars(other.getVars()); - break; - } - case BLOCK: { - mergeBlock(other.getBlock()); - break; - } - case GLOBAL_BLOCK: { - mergeGlobalBlock(other.getGlobalBlock()); - break; - } - case LABEL: { - mergeLabel(other.getLabel()); - break; - } - case IF_STATEMENT: { - mergeIfStatement(other.getIfStatement()); - break; - } - case SWITCH_STATEMENT: { - mergeSwitchStatement(other.getSwitchStatement()); - break; - } - case WHILE_STATEMENT: { - mergeWhileStatement(other.getWhileStatement()); - break; - } - case DO_WHILE_STATEMENT: { - mergeDoWhileStatement(other.getDoWhileStatement()); - break; - } - case FOR_STATEMENT: { - mergeForStatement(other.getForStatement()); - break; - } - case FOR_IN_STATEMENT: { - mergeForInStatement(other.getForInStatement()); - break; - } - case TRY_STATEMENT: { - mergeTryStatement(other.getTryStatement()); - break; - } - case EMPTY: { - mergeEmpty(other.getEmpty()); - break; - } - case STATEMENT_NOT_SET: { - break; - } - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (hasLocation()) { - if (!getLocation().isInitialized()) { - - return false; - } - } - if (hasReturnStatement()) { - if (!getReturnStatement().isInitialized()) { - - return false; - } - } - if (hasThrowStatement()) { - if (!getThrowStatement().isInitialized()) { - - return false; - } - } - if (hasExpression()) { - if (!getExpression().isInitialized()) { - - return false; - } - } - if (hasVars()) { - if (!getVars().isInitialized()) { - - return false; - } - } - if (hasBlock()) { - if (!getBlock().isInitialized()) { - - return false; - } - } - if (hasGlobalBlock()) { - if (!getGlobalBlock().isInitialized()) { - - return false; - } - } - if (hasLabel()) { - if (!getLabel().isInitialized()) { - - return false; - } - } - if (hasIfStatement()) { - if (!getIfStatement().isInitialized()) { - - return false; - } - } - if (hasSwitchStatement()) { - if (!getSwitchStatement().isInitialized()) { - - return false; - } - } - if (hasWhileStatement()) { - if (!getWhileStatement().isInitialized()) { - - return false; - } - } - if (hasDoWhileStatement()) { - if (!getDoWhileStatement().isInitialized()) { - - return false; - } - } - if (hasForStatement()) { - if (!getForStatement().isInitialized()) { - - return false; - } - } - if (hasForInStatement()) { - if (!getForInStatement().isInitialized()) { - - return false; - } - } - if (hasTryStatement()) { - if (!getTryStatement().isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int statementCase_ = 0; - private java.lang.Object statement_; - public StatementCase - getStatementCase() { - return StatementCase.valueOf( - statementCase_); - } - - public Builder clearStatement() { - statementCase_ = 0; - statement_ = null; - return this; - } - - private int bitField0_; - - private int fileId_ ; - /** - * optional int32 fileId = 1; - */ - public boolean hasFileId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 fileId = 1; - */ - public int getFileId() { - return fileId_; - } - /** - * optional int32 fileId = 1; - */ - public Builder setFileId(int value) { - bitField0_ |= 0x00000001; - fileId_ = value; - - return this; - } - /** - * optional int32 fileId = 1; - */ - public Builder clearFileId() { - bitField0_ = (bitField0_ & ~0x00000001); - fileId_ = 0; - - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public boolean hasLocation() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { - return location_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder setLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { - if (value == null) { - throw new NullPointerException(); - } - location_ = value; - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder setLocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder builderForValue) { - location_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder mergeLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - location_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance()) { - location_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.newBuilder(location_).mergeFrom(value).buildPartial(); - } else { - location_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder clearLocation() { - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - private boolean synthetic_ ; - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean hasSynthetic() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean getSynthetic() { - return synthetic_; - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public Builder setSynthetic(boolean value) { - bitField0_ |= 0x00000004; - synthetic_ = value; - - return this; - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public Builder clearSynthetic() { - bitField0_ = (bitField0_ & ~0x00000004); - synthetic_ = false; - - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public boolean hasReturnStatement() { - return statementCase_ == 21; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { - if (statementCase_ == 21) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder setReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder setReturnStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder mergeReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { - if (statementCase_ == 21 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder clearReturnStatement() { - if (statementCase_ == 21) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public boolean hasThrowStatement() { - return statementCase_ == 22; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { - if (statementCase_ == 22) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder setThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder setThrowStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder mergeThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { - if (statementCase_ == 22 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder clearThrowStatement() { - if (statementCase_ == 22) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public boolean hasBreakStatement() { - return statementCase_ == 23; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { - if (statementCase_ == 23) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder setBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder setBreakStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder mergeBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { - if (statementCase_ == 23 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder clearBreakStatement() { - if (statementCase_ == 23) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public boolean hasContinueStatement() { - return statementCase_ == 24; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { - if (statementCase_ == 24) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder setContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder setContinueStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder mergeContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { - if (statementCase_ == 24 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder clearContinueStatement() { - if (statementCase_ == 24) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public boolean hasDebugger() { - return statementCase_ == 25; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { - if (statementCase_ == 25) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder setDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder setDebugger( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder mergeDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { - if (statementCase_ == 25 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder clearDebugger() { - if (statementCase_ == 25) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public boolean hasExpression() { - return statementCase_ == 26; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { - if (statementCase_ == 26) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder setExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder setExpression( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder mergeExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { - if (statementCase_ == 26 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder clearExpression() { - if (statementCase_ == 26) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public boolean hasVars() { - return statementCase_ == 27; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { - if (statementCase_ == 27) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder setVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder setVars( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder mergeVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { - if (statementCase_ == 27 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder clearVars() { - if (statementCase_ == 27) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public boolean hasBlock() { - return statementCase_ == 28; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { - if (statementCase_ == 28) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder setBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder setBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder mergeBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { - if (statementCase_ == 28 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder clearBlock() { - if (statementCase_ == 28) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public boolean hasGlobalBlock() { - return statementCase_ == 29; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { - if (statementCase_ == 29) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder setGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder setGlobalBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder mergeGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (statementCase_ == 29 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder clearGlobalBlock() { - if (statementCase_ == 29) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public boolean hasLabel() { - return statementCase_ == 30; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { - if (statementCase_ == 30) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder setLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder setLabel( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder mergeLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { - if (statementCase_ == 30 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder clearLabel() { - if (statementCase_ == 30) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public boolean hasIfStatement() { - return statementCase_ == 31; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { - if (statementCase_ == 31) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder setIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder setIfStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder mergeIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { - if (statementCase_ == 31 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder clearIfStatement() { - if (statementCase_ == 31) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public boolean hasSwitchStatement() { - return statementCase_ == 32; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { - if (statementCase_ == 32) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder setSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder setSwitchStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder mergeSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { - if (statementCase_ == 32 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder clearSwitchStatement() { - if (statementCase_ == 32) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public boolean hasWhileStatement() { - return statementCase_ == 33; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { - if (statementCase_ == 33) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder setWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder setWhileStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder mergeWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { - if (statementCase_ == 33 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder clearWhileStatement() { - if (statementCase_ == 33) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public boolean hasDoWhileStatement() { - return statementCase_ == 34; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { - if (statementCase_ == 34) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder setDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder setDoWhileStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder mergeDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { - if (statementCase_ == 34 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder clearDoWhileStatement() { - if (statementCase_ == 34) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public boolean hasForStatement() { - return statementCase_ == 35; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { - if (statementCase_ == 35) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder setForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder setForStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder mergeForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { - if (statementCase_ == 35 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder clearForStatement() { - if (statementCase_ == 35) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public boolean hasForInStatement() { - return statementCase_ == 36; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { - if (statementCase_ == 36) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder setForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder setForInStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder mergeForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { - if (statementCase_ == 36 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder clearForInStatement() { - if (statementCase_ == 36) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public boolean hasTryStatement() { - return statementCase_ == 37; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { - if (statementCase_ == 37) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder setTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder setTryStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder mergeTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { - if (statementCase_ == 37 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder clearTryStatement() { - if (statementCase_ == 37) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public boolean hasEmpty() { - return statementCase_ == 38; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { - if (statementCase_ == 38) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder setEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder setEmpty( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder mergeEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { - if (statementCase_ == 38 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder clearEmpty() { - if (statementCase_ == 38) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) - } - - static { - defaultInstance = new Statement(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + org.jetbrains.kotlin.protobuf.ByteString + getMessageBytes(); } public interface ReturnOrBuilder extends @@ -30252,7 +27558,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; */ - java.util.List + java.util.List getImportedModuleList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; @@ -30266,7 +27572,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; */ - java.util.List + java.util.List getImportEntryList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; @@ -30307,7 +27613,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; */ - java.util.List + java.util.List getNameBindingList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; @@ -30321,7 +27627,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; */ - java.util.List + java.util.List getClassModelList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; @@ -30335,7 +27641,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; */ - java.util.List + java.util.List getModuleExpressionList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; @@ -30349,7 +27655,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; */ - java.util.List + java.util.List getInlineModuleList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; @@ -30395,7 +27701,7 @@ public final class JsAstProtoBuf { /** * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; */ - java.util.List + java.util.List getInlinedLocalDeclarationsList(); /** * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; @@ -30405,32 +27711,2973 @@ public final class JsAstProtoBuf { * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; */ int getInlinedLocalDeclarationsCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + java.util.List + getIrClassModelList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + int getIrClassModelCount(); + + /** + * optional string dts = 15; + */ + boolean hasDts(); + /** + * optional string dts = 15; + */ + java.lang.String getDts(); + /** + * optional string dts = 15; + */ + org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes(); + + /** + * optional int32 suite_function = 16; + */ + boolean hasSuiteFunction(); + /** + * optional int32 suite_function = 16; + */ + int getSuiteFunction(); } + public interface IrClassModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { + + /** + * required int32 name_id = 1; + */ + boolean hasNameId(); + /** + * required int32 name_id = 1; + */ + int getNameId(); + + /** + * repeated int32 super_classes = 2; + */ + java.util.List getSuperClassesList(); + /** + * repeated int32 super_classes = 2; + */ + int getSuperClassesCount(); + /** + * repeated int32 super_classes = 2; + */ + int getSuperClasses(int index); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + boolean hasPreDeclarationBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + boolean hasPostDeclarationBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPostDeclarationBlock(); + } + /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} */ - public static final class Fragment extends + public static final class Statement extends org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) - FragmentOrBuilder { - // Use Fragment.newBuilder() to construct. - private Fragment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) + StatementOrBuilder { + // Use Statement.newBuilder() to construct. + private Statement(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private Fragment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + private Statement(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - private static final Fragment defaultInstance; - public static Fragment getDefaultInstance() { + private static final Statement defaultInstance; + public static Statement getDefaultInstance() { return defaultInstance; } - public Fragment getDefaultInstanceForType() { + public Statement getDefaultInstanceForType() { return defaultInstance; } private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private Fragment( + public static final int SINGLE_LINE_COMMENT_FIELD_NUMBER = 39; + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public Statement parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new Statement(input, extensionRegistry); + } + }; + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + private int statementCase_ = 0; + private java.lang.Object statement_; + private Statement( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + fileId_ = input.readInt32(); + break; + } + case 18: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = location_.toBuilder(); + } + location_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(location_); + location_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 24: { + bitField0_ |= 0x00000004; + synthetic_ = input.readBool(); + break; + } + case 170: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder subBuilder = null; + if (statementCase_ == 21) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 21; + break; + } + case 178: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder subBuilder = null; + if (statementCase_ == 22) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 22; + break; + } + case 186: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder subBuilder = null; + if (statementCase_ == 23) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 23; + break; + } + case 194: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder subBuilder = null; + if (statementCase_ == 24) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 24; + break; + } + case 202: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder subBuilder = null; + if (statementCase_ == 25) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 25; + break; + } + case 210: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder subBuilder = null; + if (statementCase_ == 26) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 26; + break; + } + case 218: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder subBuilder = null; + if (statementCase_ == 27) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 27; + break; + } + case 226: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder subBuilder = null; + if (statementCase_ == 28) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 28; + break; + } + case 234: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (statementCase_ == 29) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 29; + break; + } + case 242: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder subBuilder = null; + if (statementCase_ == 30) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 30; + break; + } + case 250: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder subBuilder = null; + if (statementCase_ == 31) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 31; + break; + } + case 258: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder subBuilder = null; + if (statementCase_ == 32) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 32; + break; + } + case 266: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder subBuilder = null; + if (statementCase_ == 33) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 33; + break; + } + case 274: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder subBuilder = null; + if (statementCase_ == 34) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 34; + break; + } + case 282: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder subBuilder = null; + if (statementCase_ == 35) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 35; + break; + } + case 290: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder subBuilder = null; + if (statementCase_ == 36) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 36; + break; + } + case 298: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder subBuilder = null; + if (statementCase_ == 37) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 37; + break; + } + case 306: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder subBuilder = null; + if (statementCase_ == 38) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 38; + break; + } + case 314: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder subBuilder = null; + if (statementCase_ == 39) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 39; + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + }; + + public StatementCase + getStatementCase() { + return StatementCase.valueOf( + statementCase_); + } + + public static final int FILEID_FIELD_NUMBER = 1; + private int fileId_; + /** + * optional int32 fileId = 1; + */ + public boolean hasFileId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 fileId = 1; + */ + public int getFileId() { + return fileId_; + } + + public static final int LOCATION_FIELD_NUMBER = 2; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { + return location_; + } + + public static final int SYNTHETIC_FIELD_NUMBER = 3; + private boolean synthetic_; + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean hasSynthetic() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean getSynthetic() { + return synthetic_; + } + + public static final int RETURN_STATEMENT_FIELD_NUMBER = 21; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public boolean hasReturnStatement() { + return statementCase_ == 21; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { + if (statementCase_ == 21) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); + } + + public static final int THROW_STATEMENT_FIELD_NUMBER = 22; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public boolean hasThrowStatement() { + return statementCase_ == 22; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { + if (statementCase_ == 22) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); + } + + public static final int BREAK_STATEMENT_FIELD_NUMBER = 23; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public boolean hasBreakStatement() { + return statementCase_ == 23; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { + if (statementCase_ == 23) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); + } + + public static final int CONTINUE_STATEMENT_FIELD_NUMBER = 24; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public boolean hasContinueStatement() { + return statementCase_ == 24; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { + if (statementCase_ == 24) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); + } + + public static final int DEBUGGER_FIELD_NUMBER = 25; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public boolean hasDebugger() { + return statementCase_ == 25; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { + if (statementCase_ == 25) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); + } + + public static final int EXPRESSION_FIELD_NUMBER = 26; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public boolean hasExpression() { + return statementCase_ == 26; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { + if (statementCase_ == 26) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); + } + + public static final int VARS_FIELD_NUMBER = 27; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public boolean hasVars() { + return statementCase_ == 27; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { + if (statementCase_ == 27) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); + } + + public static final int BLOCK_FIELD_NUMBER = 28; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public boolean hasBlock() { + return statementCase_ == 28; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { + if (statementCase_ == 28) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); + } + + public static final int GLOBAL_BLOCK_FIELD_NUMBER = 29; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public boolean hasGlobalBlock() { + return statementCase_ == 29; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { + if (statementCase_ == 29) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + + public static final int LABEL_FIELD_NUMBER = 30; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public boolean hasLabel() { + return statementCase_ == 30; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { + if (statementCase_ == 30) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); + } + + public static final int IF_STATEMENT_FIELD_NUMBER = 31; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public boolean hasIfStatement() { + return statementCase_ == 31; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { + if (statementCase_ == 31) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); + } + + public static final int SWITCH_STATEMENT_FIELD_NUMBER = 32; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public boolean hasSwitchStatement() { + return statementCase_ == 32; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { + if (statementCase_ == 32) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); + } + + public static final int WHILE_STATEMENT_FIELD_NUMBER = 33; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public boolean hasWhileStatement() { + return statementCase_ == 33; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { + if (statementCase_ == 33) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); + } + + public static final int DO_WHILE_STATEMENT_FIELD_NUMBER = 34; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public boolean hasDoWhileStatement() { + return statementCase_ == 34; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { + if (statementCase_ == 34) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); + } + + public static final int FOR_STATEMENT_FIELD_NUMBER = 35; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public boolean hasForStatement() { + return statementCase_ == 35; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { + if (statementCase_ == 35) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); + } + + public static final int FOR_IN_STATEMENT_FIELD_NUMBER = 36; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public boolean hasForInStatement() { + return statementCase_ == 36; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { + if (statementCase_ == 36) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); + } + + public static final int TRY_STATEMENT_FIELD_NUMBER = 37; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public boolean hasTryStatement() { + return statementCase_ == 37; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { + if (statementCase_ == 37) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); + } + + public static final int EMPTY_FIELD_NUMBER = 38; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public boolean hasEmpty() { + return statementCase_ == 38; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { + if (statementCase_ == 38) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public boolean hasSingleLineComment() { + return statementCase_ == 39; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { + if (statementCase_ == 39) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); + } + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasLocation()) { + if (!getLocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReturnStatement()) { + if (!getReturnStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasThrowStatement()) { + if (!getThrowStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasExpression()) { + if (!getExpression().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasVars()) { + if (!getVars().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasBlock()) { + if (!getBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasGlobalBlock()) { + if (!getGlobalBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasLabel()) { + if (!getLabel().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasIfStatement()) { + if (!getIfStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSwitchStatement()) { + if (!getSwitchStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasWhileStatement()) { + if (!getWhileStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDoWhileStatement()) { + if (!getDoWhileStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasForStatement()) { + if (!getForStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasForInStatement()) { + if (!getForInStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTryStatement()) { + if (!getTryStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSingleLineComment()) { + if (!getSingleLineComment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + private void initFields() { + fileId_ = 0; + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + synthetic_ = false; + } + private byte memoizedIsInitialized = -1; + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, fileId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, location_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, synthetic_); + } + if (statementCase_ == 21) { + output.writeMessage(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + } + if (statementCase_ == 22) { + output.writeMessage(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + } + if (statementCase_ == 23) { + output.writeMessage(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + } + if (statementCase_ == 24) { + output.writeMessage(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + } + if (statementCase_ == 25) { + output.writeMessage(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + } + if (statementCase_ == 26) { + output.writeMessage(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + } + if (statementCase_ == 27) { + output.writeMessage(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + } + if (statementCase_ == 28) { + output.writeMessage(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + } + if (statementCase_ == 29) { + output.writeMessage(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + } + if (statementCase_ == 30) { + output.writeMessage(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + } + if (statementCase_ == 31) { + output.writeMessage(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + } + if (statementCase_ == 32) { + output.writeMessage(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + } + if (statementCase_ == 33) { + output.writeMessage(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + } + if (statementCase_ == 34) { + output.writeMessage(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + } + if (statementCase_ == 35) { + output.writeMessage(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + } + if (statementCase_ == 36) { + output.writeMessage(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + } + if (statementCase_ == 37) { + output.writeMessage(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + } + if (statementCase_ == 38) { + output.writeMessage(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + } + if (statementCase_ == 39) { + output.writeMessage(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + } + output.writeRawBytes(unknownFields); + } + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32Size(1, fileId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(2, location_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBoolSize(3, synthetic_); + } + if (statementCase_ == 21) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + } + if (statementCase_ == 22) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + } + if (statementCase_ == 23) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + } + if (statementCase_ == 24) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + } + if (statementCase_ == 25) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + } + if (statementCase_ == 26) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + } + if (statementCase_ == 27) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + } + if (statementCase_ == 28) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + } + if (statementCase_ == 29) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + } + if (statementCase_ == 30) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + } + if (statementCase_ == 31) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + } + if (statementCase_ == 32) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + } + if (statementCase_ == 33) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + } + if (statementCase_ == 34) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + } + if (statementCase_ == 35) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + } + if (statementCase_ == 36) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + } + if (statementCase_ == 37) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + } + if (statementCase_ == 38) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + } + if (statementCase_ == 39) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private int memoizedSerializedSize = -1; +public enum StatementCase + implements org.jetbrains.kotlin.protobuf.Internal.EnumLite { + RETURN_STATEMENT(21), + THROW_STATEMENT(22), + BREAK_STATEMENT(23), + CONTINUE_STATEMENT(24), + DEBUGGER(25), + EXPRESSION(26), + VARS(27), + BLOCK(28), + GLOBAL_BLOCK(29), + LABEL(30), + IF_STATEMENT(31), + SWITCH_STATEMENT(32), + WHILE_STATEMENT(33), + DO_WHILE_STATEMENT(34), + FOR_STATEMENT(35), + FOR_IN_STATEMENT(36), + TRY_STATEMENT(37), + EMPTY(38), + SINGLE_LINE_COMMENT(39), + STATEMENT_NOT_SET(0); + private int value = 0; + private StatementCase(int value) { + this.value = value; + } + public static StatementCase valueOf(int value) { + switch (value) { + case 21: return RETURN_STATEMENT; + case 22: return THROW_STATEMENT; + case 23: return BREAK_STATEMENT; + case 24: return CONTINUE_STATEMENT; + case 25: return DEBUGGER; + case 26: return EXPRESSION; + case 27: return VARS; + case 28: return BLOCK; + case 29: return GLOBAL_BLOCK; + case 30: return LABEL; + case 31: return IF_STATEMENT; + case 32: return SWITCH_STATEMENT; + case 33: return WHILE_STATEMENT; + case 34: return DO_WHILE_STATEMENT; + case 35: return FOR_STATEMENT; + case 36: return FOR_IN_STATEMENT; + case 37: return TRY_STATEMENT; + case 38: return EMPTY; + case 39: return SINGLE_LINE_COMMENT; + case 0: return STATEMENT_NOT_SET; + default: throw new java.lang.IllegalArgumentException( + "Value is undefined for this oneof enum."); + } + } + public int getNumber() { + return this.value; + } + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} + */ + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.StatementOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + fileId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + synthetic_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + statementCase_ = 0; + statement_ = null; + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.fileId_ = fileId_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.location_ = location_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.synthetic_ = synthetic_; + if (statementCase_ == 21) { + result.statement_ = statement_; + } + if (statementCase_ == 22) { + result.statement_ = statement_; + } + if (statementCase_ == 23) { + result.statement_ = statement_; + } + if (statementCase_ == 24) { + result.statement_ = statement_; + } + if (statementCase_ == 25) { + result.statement_ = statement_; + } + if (statementCase_ == 26) { + result.statement_ = statement_; + } + if (statementCase_ == 27) { + result.statement_ = statement_; + } + if (statementCase_ == 28) { + result.statement_ = statement_; + } + if (statementCase_ == 29) { + result.statement_ = statement_; + } + if (statementCase_ == 30) { + result.statement_ = statement_; + } + if (statementCase_ == 31) { + result.statement_ = statement_; + } + if (statementCase_ == 32) { + result.statement_ = statement_; + } + if (statementCase_ == 33) { + result.statement_ = statement_; + } + if (statementCase_ == 34) { + result.statement_ = statement_; + } + if (statementCase_ == 35) { + result.statement_ = statement_; + } + if (statementCase_ == 36) { + result.statement_ = statement_; + } + if (statementCase_ == 37) { + result.statement_ = statement_; + } + if (statementCase_ == 38) { + result.statement_ = statement_; + } + if (statementCase_ == 39) { + result.statement_ = statement_; + } + result.bitField0_ = to_bitField0_; + result.statementCase_ = statementCase_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) return this; + if (other.hasFileId()) { + setFileId(other.getFileId()); + } + if (other.hasLocation()) { + mergeLocation(other.getLocation()); + } + if (other.hasSynthetic()) { + setSynthetic(other.getSynthetic()); + } + switch (other.getStatementCase()) { + case RETURN_STATEMENT: { + mergeReturnStatement(other.getReturnStatement()); + break; + } + case THROW_STATEMENT: { + mergeThrowStatement(other.getThrowStatement()); + break; + } + case BREAK_STATEMENT: { + mergeBreakStatement(other.getBreakStatement()); + break; + } + case CONTINUE_STATEMENT: { + mergeContinueStatement(other.getContinueStatement()); + break; + } + case DEBUGGER: { + mergeDebugger(other.getDebugger()); + break; + } + case EXPRESSION: { + mergeExpression(other.getExpression()); + break; + } + case VARS: { + mergeVars(other.getVars()); + break; + } + case BLOCK: { + mergeBlock(other.getBlock()); + break; + } + case GLOBAL_BLOCK: { + mergeGlobalBlock(other.getGlobalBlock()); + break; + } + case LABEL: { + mergeLabel(other.getLabel()); + break; + } + case IF_STATEMENT: { + mergeIfStatement(other.getIfStatement()); + break; + } + case SWITCH_STATEMENT: { + mergeSwitchStatement(other.getSwitchStatement()); + break; + } + case WHILE_STATEMENT: { + mergeWhileStatement(other.getWhileStatement()); + break; + } + case DO_WHILE_STATEMENT: { + mergeDoWhileStatement(other.getDoWhileStatement()); + break; + } + case FOR_STATEMENT: { + mergeForStatement(other.getForStatement()); + break; + } + case FOR_IN_STATEMENT: { + mergeForInStatement(other.getForInStatement()); + break; + } + case TRY_STATEMENT: { + mergeTryStatement(other.getTryStatement()); + break; + } + case EMPTY: { + mergeEmpty(other.getEmpty()); + break; + } + case SINGLE_LINE_COMMENT: { + mergeSingleLineComment(other.getSingleLineComment()); + break; + } + case STATEMENT_NOT_SET: { + break; + } + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (hasLocation()) { + if (!getLocation().isInitialized()) { + + return false; + } + } + if (hasReturnStatement()) { + if (!getReturnStatement().isInitialized()) { + + return false; + } + } + if (hasThrowStatement()) { + if (!getThrowStatement().isInitialized()) { + + return false; + } + } + if (hasExpression()) { + if (!getExpression().isInitialized()) { + + return false; + } + } + if (hasVars()) { + if (!getVars().isInitialized()) { + + return false; + } + } + if (hasBlock()) { + if (!getBlock().isInitialized()) { + + return false; + } + } + if (hasGlobalBlock()) { + if (!getGlobalBlock().isInitialized()) { + + return false; + } + } + if (hasLabel()) { + if (!getLabel().isInitialized()) { + + return false; + } + } + if (hasIfStatement()) { + if (!getIfStatement().isInitialized()) { + + return false; + } + } + if (hasSwitchStatement()) { + if (!getSwitchStatement().isInitialized()) { + + return false; + } + } + if (hasWhileStatement()) { + if (!getWhileStatement().isInitialized()) { + + return false; + } + } + if (hasDoWhileStatement()) { + if (!getDoWhileStatement().isInitialized()) { + + return false; + } + } + if (hasForStatement()) { + if (!getForStatement().isInitialized()) { + + return false; + } + } + if (hasForInStatement()) { + if (!getForInStatement().isInitialized()) { + + return false; + } + } + if (hasTryStatement()) { + if (!getTryStatement().isInitialized()) { + + return false; + } + } + if (hasSingleLineComment()) { + if (!getSingleLineComment().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int statementCase_ = 0; + private java.lang.Object statement_; + public StatementCase + getStatementCase() { + return StatementCase.valueOf( + statementCase_); + } + + public Builder clearStatement() { + statementCase_ = 0; + statement_ = null; + return this; + } + + private int bitField0_; + + private int fileId_ ; + /** + * optional int32 fileId = 1; + */ + public boolean hasFileId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 fileId = 1; + */ + public int getFileId() { + return fileId_; + } + /** + * optional int32 fileId = 1; + */ + public Builder setFileId(int value) { + bitField0_ |= 0x00000001; + fileId_ = value; + + return this; + } + /** + * optional int32 fileId = 1; + */ + public Builder clearFileId() { + bitField0_ = (bitField0_ & ~0x00000001); + fileId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { + return location_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder setLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder setLocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder builderForValue) { + location_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder mergeLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + location_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance()) { + location_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.newBuilder(location_).mergeFrom(value).buildPartial(); + } else { + location_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder clearLocation() { + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + private boolean synthetic_ ; + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean hasSynthetic() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean getSynthetic() { + return synthetic_; + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public Builder setSynthetic(boolean value) { + bitField0_ |= 0x00000004; + synthetic_ = value; + + return this; + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public Builder clearSynthetic() { + bitField0_ = (bitField0_ & ~0x00000004); + synthetic_ = false; + + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public boolean hasReturnStatement() { + return statementCase_ == 21; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { + if (statementCase_ == 21) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder setReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder setReturnStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder mergeReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { + if (statementCase_ == 21 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder clearReturnStatement() { + if (statementCase_ == 21) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public boolean hasThrowStatement() { + return statementCase_ == 22; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { + if (statementCase_ == 22) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder setThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder setThrowStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder mergeThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { + if (statementCase_ == 22 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder clearThrowStatement() { + if (statementCase_ == 22) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public boolean hasBreakStatement() { + return statementCase_ == 23; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { + if (statementCase_ == 23) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder setBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder setBreakStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder mergeBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { + if (statementCase_ == 23 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder clearBreakStatement() { + if (statementCase_ == 23) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public boolean hasContinueStatement() { + return statementCase_ == 24; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { + if (statementCase_ == 24) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder setContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder setContinueStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder mergeContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { + if (statementCase_ == 24 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder clearContinueStatement() { + if (statementCase_ == 24) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public boolean hasDebugger() { + return statementCase_ == 25; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { + if (statementCase_ == 25) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder setDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder setDebugger( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder mergeDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { + if (statementCase_ == 25 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder clearDebugger() { + if (statementCase_ == 25) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public boolean hasExpression() { + return statementCase_ == 26; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { + if (statementCase_ == 26) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder setExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder setExpression( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder mergeExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { + if (statementCase_ == 26 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder clearExpression() { + if (statementCase_ == 26) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public boolean hasVars() { + return statementCase_ == 27; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { + if (statementCase_ == 27) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder setVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder setVars( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder mergeVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { + if (statementCase_ == 27 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder clearVars() { + if (statementCase_ == 27) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public boolean hasBlock() { + return statementCase_ == 28; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { + if (statementCase_ == 28) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder setBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder setBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder mergeBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { + if (statementCase_ == 28 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder clearBlock() { + if (statementCase_ == 28) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public boolean hasGlobalBlock() { + return statementCase_ == 29; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { + if (statementCase_ == 29) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder setGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder setGlobalBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder mergeGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (statementCase_ == 29 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder clearGlobalBlock() { + if (statementCase_ == 29) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public boolean hasLabel() { + return statementCase_ == 30; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { + if (statementCase_ == 30) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder setLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder setLabel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder mergeLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { + if (statementCase_ == 30 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder clearLabel() { + if (statementCase_ == 30) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public boolean hasIfStatement() { + return statementCase_ == 31; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { + if (statementCase_ == 31) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder setIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder setIfStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder mergeIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { + if (statementCase_ == 31 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder clearIfStatement() { + if (statementCase_ == 31) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public boolean hasSwitchStatement() { + return statementCase_ == 32; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { + if (statementCase_ == 32) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder setSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder setSwitchStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder mergeSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { + if (statementCase_ == 32 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder clearSwitchStatement() { + if (statementCase_ == 32) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public boolean hasWhileStatement() { + return statementCase_ == 33; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { + if (statementCase_ == 33) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder setWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder setWhileStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder mergeWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { + if (statementCase_ == 33 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder clearWhileStatement() { + if (statementCase_ == 33) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public boolean hasDoWhileStatement() { + return statementCase_ == 34; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { + if (statementCase_ == 34) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder setDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder setDoWhileStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder mergeDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { + if (statementCase_ == 34 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder clearDoWhileStatement() { + if (statementCase_ == 34) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public boolean hasForStatement() { + return statementCase_ == 35; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { + if (statementCase_ == 35) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder setForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder setForStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder mergeForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { + if (statementCase_ == 35 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder clearForStatement() { + if (statementCase_ == 35) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public boolean hasForInStatement() { + return statementCase_ == 36; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { + if (statementCase_ == 36) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder setForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder setForInStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder mergeForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { + if (statementCase_ == 36 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder clearForInStatement() { + if (statementCase_ == 36) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public boolean hasTryStatement() { + return statementCase_ == 37; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { + if (statementCase_ == 37) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder setTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder setTryStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder mergeTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { + if (statementCase_ == 37 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder clearTryStatement() { + if (statementCase_ == 37) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public boolean hasEmpty() { + return statementCase_ == 38; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { + if (statementCase_ == 38) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder setEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder setEmpty( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder mergeEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { + if (statementCase_ == 38 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder clearEmpty() { + if (statementCase_ == 38) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public boolean hasSingleLineComment() { + return statementCase_ == 39; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { + if (statementCase_ == 39) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder setSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder setSingleLineComment( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder mergeSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { + if (statementCase_ == 39 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder clearSingleLineComment() { + if (statementCase_ == 39) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + } + + static { + defaultInstance = new Statement(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.SingleLineComment} + */ + public static final class SingleLineComment extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) + SingleLineCommentOrBuilder { + public static final int MESSAGE_FIELD_NUMBER = 1; + private static final SingleLineComment defaultInstance; + private static final long serialVersionUID = 0L; + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public SingleLineComment parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new SingleLineComment(input, extensionRegistry); + } + }; + + static { + defaultInstance = new SingleLineComment(true); + defaultInstance.initFields(); + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private int bitField0_; + private java.lang.Object message_; + private byte memoizedIsInitialized = -1; + private int memoizedSerializedSize = -1; + // Use SingleLineComment.newBuilder() to construct. + private SingleLineComment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private SingleLineComment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + private SingleLineComment( org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { @@ -30457,130 +30704,9 @@ public final class JsAstProtoBuf { break; } case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - importedModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.PARSER, extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - importEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.PARSER, extensionRegistry)); - break; - } - case 26: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = declarationBlock_.toBuilder(); - } - declarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(declarationBlock_); - declarationBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 34: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = exportBlock_.toBuilder(); - } - exportBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(exportBlock_); - exportBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 42: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = initializerBlock_.toBuilder(); - } - initializerBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(initializerBlock_); - initializerBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - nameBinding_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.PARSER, extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - classModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.PARSER, extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - moduleExpression_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.PARSER, extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - inlineModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.PARSER, extensionRegistry)); - break; - } - case 82: { org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000008; - packageFqn_ = bs; - break; - } - case 90: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = testsInvocation_.toBuilder(); - } - testsInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(testsInvocation_); - testsInvocation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 98: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = mainInvocation_.toBuilder(); - } - mainInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(mainInvocation_); - mainInvocation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 106: { - if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00001000; - } - inlinedLocalDeclarations_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.PARSER, extensionRegistry)); + bitField0_ |= 0x00000001; + message_ = bs; break; } } @@ -30591,27 +30717,6 @@ public final class JsAstProtoBuf { throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = java.util.Collections.unmodifiableList(importedModule_); - } - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = java.util.Collections.unmodifiableList(importEntry_); - } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); - } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = java.util.Collections.unmodifiableList(classModel_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); - } - if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - } try { unknownFieldsCodedOutput.flush(); } catch (java.io.IOException e) { @@ -30622,476 +30727,142 @@ public final class JsAstProtoBuf { makeExtensionsImmutable(); } } - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public Fragment parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new Fragment(input, extensionRegistry); - } - }; + + public static SingleLineComment getDefaultInstance() { + return defaultInstance; + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment prototype) { + return newBuilder().mergeFrom(prototype); + } + + public SingleLineComment getDefaultInstanceForType() { + return defaultInstance; + } @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { return PARSER; } - private int bitField0_; - public static final int IMPORTED_MODULE_FIELD_NUMBER = 1; - private java.util.List importedModule_; /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * required string message = 1; */ - public java.util.List getImportedModuleList() { - return importedModule_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public java.util.List - getImportedModuleOrBuilderList() { - return importedModule_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public int getImportedModuleCount() { - return importedModule_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { - return importedModule_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModuleOrBuilder getImportedModuleOrBuilder( - int index) { - return importedModule_.get(index); - } - - public static final int IMPORT_ENTRY_FIELD_NUMBER = 2; - private java.util.List importEntry_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List getImportEntryList() { - return importEntry_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List - getImportEntryOrBuilderList() { - return importEntry_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public int getImportEntryCount() { - return importEntry_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { - return importEntry_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportOrBuilder getImportEntryOrBuilder( - int index) { - return importEntry_.get(index); - } - - public static final int DECLARATION_BLOCK_FIELD_NUMBER = 3; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public boolean hasDeclarationBlock() { + public boolean hasMessage() { return ((bitField0_ & 0x00000001) == 0x00000001); } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { - return declarationBlock_; - } - public static final int EXPORT_BLOCK_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_; /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + * required string message = 1; */ - public boolean hasExportBlock() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { - return exportBlock_; - } - - public static final int INITIALIZER_BLOCK_FIELD_NUMBER = 5; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public boolean hasInitializerBlock() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { - return initializerBlock_; - } - - public static final int NAME_BINDING_FIELD_NUMBER = 6; - private java.util.List nameBinding_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List getNameBindingList() { - return nameBinding_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List - getNameBindingOrBuilderList() { - return nameBinding_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public int getNameBindingCount() { - return nameBinding_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { - return nameBinding_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBindingOrBuilder getNameBindingOrBuilder( - int index) { - return nameBinding_.get(index); - } - - public static final int CLASS_MODEL_FIELD_NUMBER = 7; - private java.util.List classModel_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List getClassModelList() { - return classModel_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List - getClassModelOrBuilderList() { - return classModel_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public int getClassModelCount() { - return classModel_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { - return classModel_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModelOrBuilder getClassModelOrBuilder( - int index) { - return classModel_.get(index); - } - - public static final int MODULE_EXPRESSION_FIELD_NUMBER = 8; - private java.util.List moduleExpression_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List getModuleExpressionList() { - return moduleExpression_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List - getModuleExpressionOrBuilderList() { - return moduleExpression_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public int getModuleExpressionCount() { - return moduleExpression_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { - return moduleExpression_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionOrBuilder getModuleExpressionOrBuilder( - int index) { - return moduleExpression_.get(index); - } - - public static final int INLINE_MODULE_FIELD_NUMBER = 9; - private java.util.List inlineModule_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List getInlineModuleList() { - return inlineModule_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List - getInlineModuleOrBuilderList() { - return inlineModule_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public int getInlineModuleCount() { - return inlineModule_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { - return inlineModule_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModuleOrBuilder getInlineModuleOrBuilder( - int index) { - return inlineModule_.get(index); - } - - public static final int PACKAGE_FQN_FIELD_NUMBER = 10; - private java.lang.Object packageFqn_; - /** - * optional string package_fqn = 10; - */ - public boolean hasPackageFqn() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional string package_fqn = 10; - */ - public java.lang.String getPackageFqn() { - java.lang.Object ref = packageFqn_; + public java.lang.String getMessage() { + java.lang.Object ref = message_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { - org.jetbrains.kotlin.protobuf.ByteString bs = + org.jetbrains.kotlin.protobuf.ByteString bs = (org.jetbrains.kotlin.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - packageFqn_ = s; + message_ = s; } return s; } } + /** - * optional string package_fqn = 10; + * required string message = 1; */ public org.jetbrains.kotlin.protobuf.ByteString - getPackageFqnBytes() { - java.lang.Object ref = packageFqn_; + getMessageBytes() { + java.lang.Object ref = message_; if (ref instanceof java.lang.String) { - org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString b = org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - packageFqn_ = b; + message_ = b; return b; } else { return (org.jetbrains.kotlin.protobuf.ByteString) ref; } } - public static final int TESTS_INVOCATION_FIELD_NUMBER = 11; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public boolean hasTestsInvocation() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { - return testsInvocation_; - } - - public static final int MAIN_INVOCATION_FIELD_NUMBER = 12; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_; - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public boolean hasMainInvocation() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { - return mainInvocation_; - } - - public static final int INLINED_LOCAL_DECLARATIONS_FIELD_NUMBER = 13; - private java.util.List inlinedLocalDeclarations_; - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List getInlinedLocalDeclarationsList() { - return inlinedLocalDeclarations_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List - getInlinedLocalDeclarationsOrBuilderList() { - return inlinedLocalDeclarations_; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public int getInlinedLocalDeclarationsCount() { - return inlinedLocalDeclarations_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { - return inlinedLocalDeclarations_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarationsOrBuilder getInlinedLocalDeclarationsOrBuilder( - int index) { - return inlinedLocalDeclarations_.get(index); - } - private void initFields() { - importedModule_ = java.util.Collections.emptyList(); - importEntry_ = java.util.Collections.emptyList(); - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - nameBinding_ = java.util.Collections.emptyList(); - classModel_ = java.util.Collections.emptyList(); - moduleExpression_ = java.util.Collections.emptyList(); - inlineModule_ = java.util.Collections.emptyList(); - packageFqn_ = ""; - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + message_ = ""; } - private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; - for (int i = 0; i < getImportedModuleCount(); i++) { - if (!getImportedModule(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getImportEntryCount(); i++) { - if (!getImportEntry(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasDeclarationBlock()) { - if (!getDeclarationBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasExportBlock()) { - if (!getExportBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasInitializerBlock()) { - if (!getInitializerBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getNameBindingCount(); i++) { - if (!getNameBinding(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getClassModelCount(); i++) { - if (!getClassModel(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getModuleExpressionCount(); i++) { - if (!getModuleExpression(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getInlineModuleCount(); i++) { - if (!getInlineModule(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTestsInvocation()) { - if (!getTestsInvocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasMainInvocation()) { - if (!getMainInvocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { - if (!getInlinedLocalDeclarations(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + if (!hasMessage()) { + memoizedIsInitialized = 0; + return false; } memoizedIsInitialized = 1; return true; @@ -31100,226 +30871,63 @@ public final class JsAstProtoBuf { public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - for (int i = 0; i < importedModule_.size(); i++) { - output.writeMessage(1, importedModule_.get(i)); - } - for (int i = 0; i < importEntry_.size(); i++) { - output.writeMessage(2, importEntry_.get(i)); - } if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(3, declarationBlock_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(4, exportBlock_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(5, initializerBlock_); - } - for (int i = 0; i < nameBinding_.size(); i++) { - output.writeMessage(6, nameBinding_.get(i)); - } - for (int i = 0; i < classModel_.size(); i++) { - output.writeMessage(7, classModel_.get(i)); - } - for (int i = 0; i < moduleExpression_.size(); i++) { - output.writeMessage(8, moduleExpression_.get(i)); - } - for (int i = 0; i < inlineModule_.size(); i++) { - output.writeMessage(9, inlineModule_.get(i)); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(10, getPackageFqnBytes()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(11, testsInvocation_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(12, mainInvocation_); - } - for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { - output.writeMessage(13, inlinedLocalDeclarations_.get(i)); + output.writeBytes(1, getMessageBytes()); } output.writeRawBytes(unknownFields); } - private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - for (int i = 0; i < importedModule_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, importedModule_.get(i)); - } - for (int i = 0; i < importEntry_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, importEntry_.get(i)); - } if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(3, declarationBlock_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(4, exportBlock_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(5, initializerBlock_); - } - for (int i = 0; i < nameBinding_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(6, nameBinding_.get(i)); - } - for (int i = 0; i < classModel_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(7, classModel_.get(i)); - } - for (int i = 0; i < moduleExpression_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(8, moduleExpression_.get(i)); - } - for (int i = 0; i < inlineModule_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(9, inlineModule_.get(i)); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeBytesSize(10, getPackageFqnBytes()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(11, testsInvocation_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(12, mainInvocation_); - } - for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(13, inlinedLocalDeclarations_.get(i)); + .computeBytesSize(1, getMessageBytes()); } size += unknownFields.size(); memoizedSerializedSize = size; return size; } - private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment prototype) { - return newBuilder().mergeFrom(prototype); - } + public Builder toBuilder() { return newBuilder(this); } /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.SingleLineComment} */ public static final class Builder extends org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment, Builder> + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.FragmentOrBuilder { - // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.newBuilder() + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineCommentOrBuilder { + private int bitField0_; + private java.lang.Object message_ = ""; + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - private void maybeForceBuilderInitialization() { - } private static Builder create() { return new Builder(); } + private void maybeForceBuilderInitialization() { + } + public Builder clear() { super.clear(); - importedModule_ = java.util.Collections.emptyList(); + message_ = ""; bitField0_ = (bitField0_ & ~0x00000001); - importEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000010); - nameBinding_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - classModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - moduleExpression_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - inlineModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - packageFqn_ = ""; - bitField0_ = (bitField0_ & ~0x00000200); - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000400); - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000800); - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); return this; } @@ -31327,176 +30935,36 @@ public final class JsAstProtoBuf { return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment getDefaultInstanceForType() { - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance(); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment build() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = buildPartial(); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment buildPartial() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment(this); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = java.util.Collections.unmodifiableList(importedModule_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.importedModule_ = importedModule_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = java.util.Collections.unmodifiableList(importEntry_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.importEntry_ = importEntry_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.declarationBlock_ = declarationBlock_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000002; - } - result.exportBlock_ = exportBlock_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000004; - } - result.initializerBlock_ = initializerBlock_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.nameBinding_ = nameBinding_; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = java.util.Collections.unmodifiableList(classModel_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.classModel_ = classModel_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.moduleExpression_ = moduleExpression_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.inlineModule_ = inlineModule_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000008; - } - result.packageFqn_ = packageFqn_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000010; - } - result.testsInvocation_ = testsInvocation_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000020; - } - result.mainInvocation_ = mainInvocation_; - if (((bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.inlinedLocalDeclarations_ = inlinedLocalDeclarations_; + result.message_ = message_; result.bitField0_ = to_bitField0_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment other) { - if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance()) return this; - if (!other.importedModule_.isEmpty()) { - if (importedModule_.isEmpty()) { - importedModule_ = other.importedModule_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureImportedModuleIsMutable(); - importedModule_.addAll(other.importedModule_); - } - - } - if (!other.importEntry_.isEmpty()) { - if (importEntry_.isEmpty()) { - importEntry_ = other.importEntry_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureImportEntryIsMutable(); - importEntry_.addAll(other.importEntry_); - } - - } - if (other.hasDeclarationBlock()) { - mergeDeclarationBlock(other.getDeclarationBlock()); - } - if (other.hasExportBlock()) { - mergeExportBlock(other.getExportBlock()); - } - if (other.hasInitializerBlock()) { - mergeInitializerBlock(other.getInitializerBlock()); - } - if (!other.nameBinding_.isEmpty()) { - if (nameBinding_.isEmpty()) { - nameBinding_ = other.nameBinding_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureNameBindingIsMutable(); - nameBinding_.addAll(other.nameBinding_); - } - - } - if (!other.classModel_.isEmpty()) { - if (classModel_.isEmpty()) { - classModel_ = other.classModel_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureClassModelIsMutable(); - classModel_.addAll(other.classModel_); - } - - } - if (!other.moduleExpression_.isEmpty()) { - if (moduleExpression_.isEmpty()) { - moduleExpression_ = other.moduleExpression_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureModuleExpressionIsMutable(); - moduleExpression_.addAll(other.moduleExpression_); - } - - } - if (!other.inlineModule_.isEmpty()) { - if (inlineModule_.isEmpty()) { - inlineModule_ = other.inlineModule_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureInlineModuleIsMutable(); - inlineModule_.addAll(other.inlineModule_); - } - - } - if (other.hasPackageFqn()) { - bitField0_ |= 0x00000200; - packageFqn_ = other.packageFqn_; - - } - if (other.hasTestsInvocation()) { - mergeTestsInvocation(other.getTestsInvocation()); - } - if (other.hasMainInvocation()) { - mergeMainInvocation(other.getMainInvocation()); - } - if (!other.inlinedLocalDeclarations_.isEmpty()) { - if (inlinedLocalDeclarations_.isEmpty()) { - inlinedLocalDeclarations_ = other.inlinedLocalDeclarations_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.addAll(other.inlinedLocalDeclarations_); - } - + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance()) return this; + if (other.hasMessage()) { + bitField0_ |= 0x00000001; + message_ = other.message_; + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -31504,77 +30972,9 @@ public final class JsAstProtoBuf { } public final boolean isInitialized() { - for (int i = 0; i < getImportedModuleCount(); i++) { - if (!getImportedModule(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getImportEntryCount(); i++) { - if (!getImportEntry(i).isInitialized()) { - - return false; - } - } - if (hasDeclarationBlock()) { - if (!getDeclarationBlock().isInitialized()) { - - return false; - } - } - if (hasExportBlock()) { - if (!getExportBlock().isInitialized()) { - - return false; - } - } - if (hasInitializerBlock()) { - if (!getInitializerBlock().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getNameBindingCount(); i++) { - if (!getNameBinding(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getClassModelCount(); i++) { - if (!getClassModel(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getModuleExpressionCount(); i++) { - if (!getModuleExpression(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getInlineModuleCount(); i++) { - if (!getInlineModule(i).isInitialized()) { - - return false; - } - } - if (hasTestsInvocation()) { - if (!getTestsInvocation().isInitialized()) { - - return false; - } - } - if (hasMainInvocation()) { - if (!getMainInvocation().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { - if (!getInlinedLocalDeclarations(i).isInitialized()) { - - return false; - } + if (!hasMessage()) { + + return false; } return true; } @@ -31583,11 +30983,11 @@ public final class JsAstProtoBuf { org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parsedMessage = null; + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -31596,1268 +30996,90 @@ public final class JsAstProtoBuf { } return this; } - private int bitField0_; - private java.util.List importedModule_ = - java.util.Collections.emptyList(); - private void ensureImportedModuleIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = new java.util.ArrayList(importedModule_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public java.util.List getImportedModuleList() { - return java.util.Collections.unmodifiableList(importedModule_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public int getImportedModuleCount() { - return importedModule_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { - return importedModule_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder setImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder setImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addAllImportedModule( - java.lang.Iterable values) { - ensureImportedModuleIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, importedModule_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder clearImportedModule() { - importedModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder removeImportedModule(int index) { - ensureImportedModuleIsMutable(); - importedModule_.remove(index); - - return this; - } - - private java.util.List importEntry_ = - java.util.Collections.emptyList(); - private void ensureImportEntryIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = new java.util.ArrayList(importEntry_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List getImportEntryList() { - return java.util.Collections.unmodifiableList(importEntry_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public int getImportEntryCount() { - return importEntry_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { - return importEntry_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder setImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder setImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addAllImportEntry( - java.lang.Iterable values) { - ensureImportEntryIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, importEntry_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder clearImportEntry() { - importEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder removeImportEntry(int index) { - ensureImportEntryIsMutable(); - importEntry_.remove(index); - - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public boolean hasDeclarationBlock() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { - return declarationBlock_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder setDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - declarationBlock_ = value; - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder setDeclarationBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - declarationBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder mergeDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - declarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - declarationBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(declarationBlock_).mergeFrom(value).buildPartial(); - } else { - declarationBlock_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder clearDeclarationBlock() { - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public boolean hasExportBlock() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { - return exportBlock_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder setExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - exportBlock_ = value; - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder setExportBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - exportBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder mergeExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - exportBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - exportBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(exportBlock_).mergeFrom(value).buildPartial(); - } else { - exportBlock_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder clearExportBlock() { - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public boolean hasInitializerBlock() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { - return initializerBlock_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder setInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - initializerBlock_ = value; - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder setInitializerBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - initializerBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder mergeInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000010) == 0x00000010) && - initializerBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - initializerBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(initializerBlock_).mergeFrom(value).buildPartial(); - } else { - initializerBlock_ = value; - } - - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder clearInitializerBlock() { - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - private java.util.List nameBinding_ = - java.util.Collections.emptyList(); - private void ensureNameBindingIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = new java.util.ArrayList(nameBinding_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List getNameBindingList() { - return java.util.Collections.unmodifiableList(nameBinding_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public int getNameBindingCount() { - return nameBinding_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { - return nameBinding_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder setNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder setNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addAllNameBinding( - java.lang.Iterable values) { - ensureNameBindingIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, nameBinding_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder clearNameBinding() { - nameBinding_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder removeNameBinding(int index) { - ensureNameBindingIsMutable(); - nameBinding_.remove(index); - - return this; - } - - private java.util.List classModel_ = - java.util.Collections.emptyList(); - private void ensureClassModelIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = new java.util.ArrayList(classModel_); - bitField0_ |= 0x00000040; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List getClassModelList() { - return java.util.Collections.unmodifiableList(classModel_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public int getClassModelCount() { - return classModel_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { - return classModel_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder setClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder setClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addAllClassModel( - java.lang.Iterable values) { - ensureClassModelIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, classModel_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder clearClassModel() { - classModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder removeClassModel(int index) { - ensureClassModelIsMutable(); - classModel_.remove(index); - - return this; - } - - private java.util.List moduleExpression_ = - java.util.Collections.emptyList(); - private void ensureModuleExpressionIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = new java.util.ArrayList(moduleExpression_); - bitField0_ |= 0x00000080; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List getModuleExpressionList() { - return java.util.Collections.unmodifiableList(moduleExpression_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public int getModuleExpressionCount() { - return moduleExpression_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { - return moduleExpression_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder setModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder setModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addAllModuleExpression( - java.lang.Iterable values) { - ensureModuleExpressionIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, moduleExpression_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder clearModuleExpression() { - moduleExpression_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder removeModuleExpression(int index) { - ensureModuleExpressionIsMutable(); - moduleExpression_.remove(index); - - return this; - } - - private java.util.List inlineModule_ = - java.util.Collections.emptyList(); - private void ensureInlineModuleIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = new java.util.ArrayList(inlineModule_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List getInlineModuleList() { - return java.util.Collections.unmodifiableList(inlineModule_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public int getInlineModuleCount() { - return inlineModule_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { - return inlineModule_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder setInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder setInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addAllInlineModule( - java.lang.Iterable values) { - ensureInlineModuleIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, inlineModule_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder clearInlineModule() { - inlineModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder removeInlineModule(int index) { - ensureInlineModuleIsMutable(); - inlineModule_.remove(index); - - return this; - } - - private java.lang.Object packageFqn_ = ""; /** - * optional string package_fqn = 10; + * required string message = 1; */ - public boolean hasPackageFqn() { - return ((bitField0_ & 0x00000200) == 0x00000200); + public boolean hasMessage() { + return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional string package_fqn = 10; + * required string message = 1; */ - public java.lang.String getPackageFqn() { - java.lang.Object ref = packageFqn_; + public java.lang.String getMessage() { + java.lang.Object ref = message_; if (!(ref instanceof java.lang.String)) { org.jetbrains.kotlin.protobuf.ByteString bs = (org.jetbrains.kotlin.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - packageFqn_ = s; + message_ = s; } return s; } else { return (java.lang.String) ref; } } + /** - * optional string package_fqn = 10; + * required string message = 1; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + message_ = value; + + return this; + } + + /** + * required string message = 1; */ public org.jetbrains.kotlin.protobuf.ByteString - getPackageFqnBytes() { - java.lang.Object ref = packageFqn_; + getMessageBytes() { + java.lang.Object ref = message_; if (ref instanceof String) { - org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString b = org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - packageFqn_ = b; + message_ = b; return b; } else { return (org.jetbrains.kotlin.protobuf.ByteString) ref; } } + /** - * optional string package_fqn = 10; + * required string message = 1; */ - public Builder setPackageFqn( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000200; - packageFqn_ = value; - - return this; - } - /** - * optional string package_fqn = 10; - */ - public Builder clearPackageFqn() { - bitField0_ = (bitField0_ & ~0x00000200); - packageFqn_ = getDefaultInstance().getPackageFqn(); - - return this; - } - /** - * optional string package_fqn = 10; - */ - public Builder setPackageFqnBytes( + public Builder setMessageBytes( org.jetbrains.kotlin.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000200; - packageFqn_ = value; - - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public boolean hasTestsInvocation() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { - return testsInvocation_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder setTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (value == null) { - throw new NullPointerException(); - } - testsInvocation_ = value; - - bitField0_ |= 0x00000400; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder setTestsInvocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { - testsInvocation_ = builderForValue.build(); - - bitField0_ |= 0x00000400; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder mergeTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (((bitField0_ & 0x00000400) == 0x00000400) && - testsInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { - testsInvocation_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(testsInvocation_).mergeFrom(value).buildPartial(); - } else { - testsInvocation_ = value; - } - - bitField0_ |= 0x00000400; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder clearTestsInvocation() { - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000400); - return this; - } - - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public boolean hasMainInvocation() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { - return mainInvocation_; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder setMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (value == null) { - throw new NullPointerException(); - } - mainInvocation_ = value; - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder setMainInvocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { - mainInvocation_ = builderForValue.build(); - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder mergeMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (((bitField0_ & 0x00000800) == 0x00000800) && - mainInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { - mainInvocation_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(mainInvocation_).mergeFrom(value).buildPartial(); - } else { - mainInvocation_ = value; - } - - bitField0_ |= 0x00000800; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder clearMainInvocation() { - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - private java.util.List inlinedLocalDeclarations_ = - java.util.Collections.emptyList(); - private void ensureInlinedLocalDeclarationsIsMutable() { - if (!((bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = new java.util.ArrayList(inlinedLocalDeclarations_); - bitField0_ |= 0x00001000; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List getInlinedLocalDeclarationsList() { - return java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public int getInlinedLocalDeclarationsCount() { - return inlinedLocalDeclarations_.size(); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { - return inlinedLocalDeclarations_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder setInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder setInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addAllInlinedLocalDeclarations( - java.lang.Iterable values) { - ensureInlinedLocalDeclarationsIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, inlinedLocalDeclarations_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder clearInlinedLocalDeclarations() { - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder removeInlinedLocalDeclarations(int index) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.remove(index); + bitField0_ |= 0x00000001; + message_ = value; return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + /** + * required string message = 1; + */ + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) } - static { - defaultInstance = new Fragment(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) } public interface InlinedLocalDeclarationsOrBuilder extends @@ -35577,6 +33799,3661 @@ public final class JsAstProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.ClassModel) } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + */ + public static final class Fragment extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) + FragmentOrBuilder { + // Use Fragment.newBuilder() to construct. + private Fragment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Fragment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final Fragment defaultInstance; + public static Fragment getDefaultInstance() { + return defaultInstance; + } + + public Fragment getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + public static final int IR_CLASS_MODEL_FIELD_NUMBER = 14; + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public Fragment parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new Fragment(input, extensionRegistry); + } + }; + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int IMPORTED_MODULE_FIELD_NUMBER = 1; + private java.util.List importedModule_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List getImportedModuleList() { + return importedModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List + getImportedModuleOrBuilderList() { + return importedModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public int getImportedModuleCount() { + return importedModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { + return importedModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModuleOrBuilder getImportedModuleOrBuilder( + int index) { + return importedModule_.get(index); + } + + public static final int IMPORT_ENTRY_FIELD_NUMBER = 2; + private java.util.List importEntry_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List getImportEntryList() { + return importEntry_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List + getImportEntryOrBuilderList() { + return importEntry_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public int getImportEntryCount() { + return importEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { + return importEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportOrBuilder getImportEntryOrBuilder( + int index) { + return importEntry_.get(index); + } + + public static final int DECLARATION_BLOCK_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public boolean hasDeclarationBlock() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { + return declarationBlock_; + } + + public static final int EXPORT_BLOCK_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public boolean hasExportBlock() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { + return exportBlock_; + } + + public static final int INITIALIZER_BLOCK_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public boolean hasInitializerBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { + return initializerBlock_; + } + + public static final int NAME_BINDING_FIELD_NUMBER = 6; + private java.util.List nameBinding_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List getNameBindingList() { + return nameBinding_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List + getNameBindingOrBuilderList() { + return nameBinding_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public int getNameBindingCount() { + return nameBinding_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { + return nameBinding_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBindingOrBuilder getNameBindingOrBuilder( + int index) { + return nameBinding_.get(index); + } + + public static final int CLASS_MODEL_FIELD_NUMBER = 7; + private java.util.List classModel_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List getClassModelList() { + return classModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List + getClassModelOrBuilderList() { + return classModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public int getClassModelCount() { + return classModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { + return classModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModelOrBuilder getClassModelOrBuilder( + int index) { + return classModel_.get(index); + } + + public static final int MODULE_EXPRESSION_FIELD_NUMBER = 8; + private java.util.List moduleExpression_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List getModuleExpressionList() { + return moduleExpression_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List + getModuleExpressionOrBuilderList() { + return moduleExpression_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public int getModuleExpressionCount() { + return moduleExpression_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { + return moduleExpression_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionOrBuilder getModuleExpressionOrBuilder( + int index) { + return moduleExpression_.get(index); + } + + public static final int INLINE_MODULE_FIELD_NUMBER = 9; + private java.util.List inlineModule_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List getInlineModuleList() { + return inlineModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List + getInlineModuleOrBuilderList() { + return inlineModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public int getInlineModuleCount() { + return inlineModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { + return inlineModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModuleOrBuilder getInlineModuleOrBuilder( + int index) { + return inlineModule_.get(index); + } + + public static final int PACKAGE_FQN_FIELD_NUMBER = 10; + private java.lang.Object packageFqn_; + /** + * optional string package_fqn = 10; + */ + public boolean hasPackageFqn() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string package_fqn = 10; + */ + public java.lang.String getPackageFqn() { + java.lang.Object ref = packageFqn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + packageFqn_ = s; + } + return s; + } + } + /** + * optional string package_fqn = 10; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getPackageFqnBytes() { + java.lang.Object ref = packageFqn_; + if (ref instanceof java.lang.String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageFqn_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + + public static final int TESTS_INVOCATION_FIELD_NUMBER = 11; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public boolean hasTestsInvocation() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { + return testsInvocation_; + } + + public static final int MAIN_INVOCATION_FIELD_NUMBER = 12; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public boolean hasMainInvocation() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { + return mainInvocation_; + } + + public static final int INLINED_LOCAL_DECLARATIONS_FIELD_NUMBER = 13; + private java.util.List inlinedLocalDeclarations_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List getInlinedLocalDeclarationsList() { + return inlinedLocalDeclarations_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List + getInlinedLocalDeclarationsOrBuilderList() { + return inlinedLocalDeclarations_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public int getInlinedLocalDeclarationsCount() { + return inlinedLocalDeclarations_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { + return inlinedLocalDeclarations_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarationsOrBuilder getInlinedLocalDeclarationsOrBuilder( + int index) { + return inlinedLocalDeclarations_.get(index); + } + public static final int DTS_FIELD_NUMBER = 15; + public static final int SUITE_FUNCTION_FIELD_NUMBER = 16; + private java.util.List irClassModel_; + private java.lang.Object dts_; + private int suiteFunction_; + private Fragment( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + importedModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.PARSER, extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + importEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.PARSER, extensionRegistry)); + break; + } + case 26: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = declarationBlock_.toBuilder(); + } + declarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(declarationBlock_); + declarationBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 34: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = exportBlock_.toBuilder(); + } + exportBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(exportBlock_); + exportBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 42: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = initializerBlock_.toBuilder(); + } + initializerBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initializerBlock_); + initializerBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + nameBinding_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.PARSER, extensionRegistry)); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + classModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.PARSER, extensionRegistry)); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + moduleExpression_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.PARSER, extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + inlineModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.PARSER, extensionRegistry)); + break; + } + case 82: { + org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + packageFqn_ = bs; + break; + } + case 90: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = testsInvocation_.toBuilder(); + } + testsInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(testsInvocation_); + testsInvocation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 98: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = mainInvocation_.toBuilder(); + } + mainInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mainInvocation_); + mainInvocation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + inlinedLocalDeclarations_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.PARSER, extensionRegistry)); + break; + } + case 114: { + if (!((mutable_bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00002000; + } + irClassModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.PARSER, extensionRegistry)); + break; + } + case 122: { + org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + dts_ = bs; + break; + } + case 128: { + bitField0_ |= 0x00000080; + suiteFunction_ = input.readInt32(); + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = java.util.Collections.unmodifiableList(importedModule_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = java.util.Collections.unmodifiableList(importEntry_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = java.util.Collections.unmodifiableList(classModel_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); + } + if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + } + if (((mutable_bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List getIrClassModelList() { + return irClassModel_; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List + getIrClassModelOrBuilderList() { + return irClassModel_; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public int getIrClassModelCount() { + return irClassModel_.size(); + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { + return irClassModel_.get(index); + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModelOrBuilder getIrClassModelOrBuilder( + int index) { + return irClassModel_.get(index); + } + + /** + * optional string dts = 15; + */ + public boolean hasDts() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional string dts = 15; + */ + public java.lang.String getDts() { + java.lang.Object ref = dts_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + dts_ = s; + } + return s; + } + } + + /** + * optional string dts = 15; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes() { + java.lang.Object ref = dts_; + if (ref instanceof java.lang.String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dts_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + + /** + * optional int32 suite_function = 16; + */ + public boolean hasSuiteFunction() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 suite_function = 16; + */ + public int getSuiteFunction() { + return suiteFunction_; + } + + private void initFields() { + importedModule_ = java.util.Collections.emptyList(); + importEntry_ = java.util.Collections.emptyList(); + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + nameBinding_ = java.util.Collections.emptyList(); + classModel_ = java.util.Collections.emptyList(); + moduleExpression_ = java.util.Collections.emptyList(); + inlineModule_ = java.util.Collections.emptyList(); + packageFqn_ = ""; + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + irClassModel_ = java.util.Collections.emptyList(); + dts_ = ""; + suiteFunction_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getImportedModuleCount(); i++) { + if (!getImportedModule(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getImportEntryCount(); i++) { + if (!getImportEntry(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDeclarationBlock()) { + if (!getDeclarationBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasExportBlock()) { + if (!getExportBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInitializerBlock()) { + if (!getInitializerBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getNameBindingCount(); i++) { + if (!getNameBinding(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getClassModelCount(); i++) { + if (!getClassModel(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getModuleExpressionCount(); i++) { + if (!getModuleExpression(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getInlineModuleCount(); i++) { + if (!getInlineModule(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTestsInvocation()) { + if (!getTestsInvocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasMainInvocation()) { + if (!getMainInvocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { + if (!getInlinedLocalDeclarations(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getIrClassModelCount(); i++) { + if (!getIrClassModel(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < importedModule_.size(); i++) { + output.writeMessage(1, importedModule_.get(i)); + } + for (int i = 0; i < importEntry_.size(); i++) { + output.writeMessage(2, importEntry_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(3, declarationBlock_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(4, exportBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(5, initializerBlock_); + } + for (int i = 0; i < nameBinding_.size(); i++) { + output.writeMessage(6, nameBinding_.get(i)); + } + for (int i = 0; i < classModel_.size(); i++) { + output.writeMessage(7, classModel_.get(i)); + } + for (int i = 0; i < moduleExpression_.size(); i++) { + output.writeMessage(8, moduleExpression_.get(i)); + } + for (int i = 0; i < inlineModule_.size(); i++) { + output.writeMessage(9, inlineModule_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(10, getPackageFqnBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(11, testsInvocation_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(12, mainInvocation_); + } + for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { + output.writeMessage(13, inlinedLocalDeclarations_.get(i)); + } + for (int i = 0; i < irClassModel_.size(); i++) { + output.writeMessage(14, irClassModel_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(15, getDtsBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt32(16, suiteFunction_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < importedModule_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(1, importedModule_.get(i)); + } + for (int i = 0; i < importEntry_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(2, importEntry_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(3, declarationBlock_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(4, exportBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(5, initializerBlock_); + } + for (int i = 0; i < nameBinding_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(6, nameBinding_.get(i)); + } + for (int i = 0; i < classModel_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(7, classModel_.get(i)); + } + for (int i = 0; i < moduleExpression_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(8, moduleExpression_.get(i)); + } + for (int i = 0; i < inlineModule_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(9, inlineModule_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBytesSize(10, getPackageFqnBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(11, testsInvocation_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(12, mainInvocation_); + } + for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(13, inlinedLocalDeclarations_.get(i)); + } + for (int i = 0; i < irClassModel_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(14, irClassModel_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBytesSize(15, getDtsBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32Size(16, suiteFunction_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + */ + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.FragmentOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + private java.util.List irClassModel_ = + java.util.Collections.emptyList(); + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + private java.lang.Object dts_ = ""; + private int suiteFunction_ ; + + public Builder clear() { + super.clear(); + importedModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + importEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000010); + nameBinding_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + classModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + moduleExpression_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + inlineModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + packageFqn_ = ""; + bitField0_ = (bitField0_ & ~0x00000200); + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000400); + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000800); + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + irClassModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + dts_ = ""; + bitField0_ = (bitField0_ & ~0x00004000); + suiteFunction_ = 0; + bitField0_ = (bitField0_ & ~0x00008000); + return this; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List importedModule_ = + java.util.Collections.emptyList(); + private void ensureImportedModuleIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = new java.util.ArrayList(importedModule_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List getImportedModuleList() { + return java.util.Collections.unmodifiableList(importedModule_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public int getImportedModuleCount() { + return importedModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { + return importedModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder setImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder setImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addAllImportedModule( + java.lang.Iterable values) { + ensureImportedModuleIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, importedModule_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder clearImportedModule() { + importedModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder removeImportedModule(int index) { + ensureImportedModuleIsMutable(); + importedModule_.remove(index); + + return this; + } + + private java.util.List importEntry_ = + java.util.Collections.emptyList(); + private void ensureImportEntryIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = new java.util.ArrayList(importEntry_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List getImportEntryList() { + return java.util.Collections.unmodifiableList(importEntry_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public int getImportEntryCount() { + return importEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { + return importEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder setImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder setImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addAllImportEntry( + java.lang.Iterable values) { + ensureImportEntryIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, importEntry_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder clearImportEntry() { + importEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder removeImportEntry(int index) { + ensureImportEntryIsMutable(); + importEntry_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public boolean hasDeclarationBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { + return declarationBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder setDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + declarationBlock_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder setDeclarationBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + declarationBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder mergeDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + declarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + declarationBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(declarationBlock_).mergeFrom(value).buildPartial(); + } else { + declarationBlock_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder clearDeclarationBlock() { + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public boolean hasExportBlock() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { + return exportBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder setExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + exportBlock_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder setExportBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + exportBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder mergeExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + exportBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + exportBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(exportBlock_).mergeFrom(value).buildPartial(); + } else { + exportBlock_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder clearExportBlock() { + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public boolean hasInitializerBlock() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { + return initializerBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder setInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + initializerBlock_ = value; + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder setInitializerBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + initializerBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder mergeInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + initializerBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + initializerBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(initializerBlock_).mergeFrom(value).buildPartial(); + } else { + initializerBlock_ = value; + } + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder clearInitializerBlock() { + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + private java.util.List nameBinding_ = + java.util.Collections.emptyList(); + private void ensureNameBindingIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = new java.util.ArrayList(nameBinding_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List getNameBindingList() { + return java.util.Collections.unmodifiableList(nameBinding_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public int getNameBindingCount() { + return nameBinding_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { + return nameBinding_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder setNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder setNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addAllNameBinding( + java.lang.Iterable values) { + ensureNameBindingIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, nameBinding_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder clearNameBinding() { + nameBinding_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder removeNameBinding(int index) { + ensureNameBindingIsMutable(); + nameBinding_.remove(index); + + return this; + } + + private java.util.List classModel_ = + java.util.Collections.emptyList(); + private void ensureClassModelIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = new java.util.ArrayList(classModel_); + bitField0_ |= 0x00000040; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List getClassModelList() { + return java.util.Collections.unmodifiableList(classModel_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public int getClassModelCount() { + return classModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { + return classModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder setClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder setClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addAllClassModel( + java.lang.Iterable values) { + ensureClassModelIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, classModel_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder clearClassModel() { + classModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder removeClassModel(int index) { + ensureClassModelIsMutable(); + classModel_.remove(index); + + return this; + } + + private java.util.List moduleExpression_ = + java.util.Collections.emptyList(); + private void ensureModuleExpressionIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = new java.util.ArrayList(moduleExpression_); + bitField0_ |= 0x00000080; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List getModuleExpressionList() { + return java.util.Collections.unmodifiableList(moduleExpression_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public int getModuleExpressionCount() { + return moduleExpression_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { + return moduleExpression_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder setModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder setModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addAllModuleExpression( + java.lang.Iterable values) { + ensureModuleExpressionIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, moduleExpression_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder clearModuleExpression() { + moduleExpression_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder removeModuleExpression(int index) { + ensureModuleExpressionIsMutable(); + moduleExpression_.remove(index); + + return this; + } + + private java.util.List inlineModule_ = + java.util.Collections.emptyList(); + private void ensureInlineModuleIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = new java.util.ArrayList(inlineModule_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List getInlineModuleList() { + return java.util.Collections.unmodifiableList(inlineModule_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public int getInlineModuleCount() { + return inlineModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { + return inlineModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder setInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder setInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addAllInlineModule( + java.lang.Iterable values) { + ensureInlineModuleIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, inlineModule_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder clearInlineModule() { + inlineModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder removeInlineModule(int index) { + ensureInlineModuleIsMutable(); + inlineModule_.remove(index); + + return this; + } + + private java.lang.Object packageFqn_ = ""; + /** + * optional string package_fqn = 10; + */ + public boolean hasPackageFqn() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional string package_fqn = 10; + */ + public java.lang.String getPackageFqn() { + java.lang.Object ref = packageFqn_; + if (!(ref instanceof java.lang.String)) { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + packageFqn_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string package_fqn = 10; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getPackageFqnBytes() { + java.lang.Object ref = packageFqn_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageFqn_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + /** + * optional string package_fqn = 10; + */ + public Builder setPackageFqn( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + packageFqn_ = value; + + return this; + } + /** + * optional string package_fqn = 10; + */ + public Builder clearPackageFqn() { + bitField0_ = (bitField0_ & ~0x00000200); + packageFqn_ = getDefaultInstance().getPackageFqn(); + + return this; + } + /** + * optional string package_fqn = 10; + */ + public Builder setPackageFqnBytes( + org.jetbrains.kotlin.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + packageFqn_ = value; + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public boolean hasTestsInvocation() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { + return testsInvocation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder setTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (value == null) { + throw new NullPointerException(); + } + testsInvocation_ = value; + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder setTestsInvocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { + testsInvocation_ = builderForValue.build(); + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder mergeTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (((bitField0_ & 0x00000400) == 0x00000400) && + testsInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { + testsInvocation_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(testsInvocation_).mergeFrom(value).buildPartial(); + } else { + testsInvocation_ = value; + } + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder clearTestsInvocation() { + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public boolean hasMainInvocation() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { + return mainInvocation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder setMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (value == null) { + throw new NullPointerException(); + } + mainInvocation_ = value; + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder setMainInvocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { + mainInvocation_ = builderForValue.build(); + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder mergeMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + mainInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { + mainInvocation_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(mainInvocation_).mergeFrom(value).buildPartial(); + } else { + mainInvocation_ = value; + } + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder clearMainInvocation() { + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + private java.util.List inlinedLocalDeclarations_ = + java.util.Collections.emptyList(); + private void ensureInlinedLocalDeclarationsIsMutable() { + if (!((bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = new java.util.ArrayList(inlinedLocalDeclarations_); + bitField0_ |= 0x00001000; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List getInlinedLocalDeclarationsList() { + return java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public int getInlinedLocalDeclarationsCount() { + return inlinedLocalDeclarations_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { + return inlinedLocalDeclarations_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder setInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder setInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addAllInlinedLocalDeclarations( + java.lang.Iterable values) { + ensureInlinedLocalDeclarationsIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, inlinedLocalDeclarations_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder clearInlinedLocalDeclarations() { + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder removeInlinedLocalDeclarations(int index) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.remove(index); + + return this; + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = java.util.Collections.unmodifiableList(importedModule_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.importedModule_ = importedModule_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = java.util.Collections.unmodifiableList(importEntry_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.importEntry_ = importEntry_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000001; + } + result.declarationBlock_ = declarationBlock_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000002; + } + result.exportBlock_ = exportBlock_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000004; + } + result.initializerBlock_ = initializerBlock_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.nameBinding_ = nameBinding_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = java.util.Collections.unmodifiableList(classModel_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.classModel_ = classModel_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.moduleExpression_ = moduleExpression_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.inlineModule_ = inlineModule_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000008; + } + result.packageFqn_ = packageFqn_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000010; + } + result.testsInvocation_ = testsInvocation_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000020; + } + result.mainInvocation_ = mainInvocation_; + if (((bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.inlinedLocalDeclarations_ = inlinedLocalDeclarations_; + if (((bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.irClassModel_ = irClassModel_; + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00000040; + } + result.dts_ = dts_; + if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + to_bitField0_ |= 0x00000080; + } + result.suiteFunction_ = suiteFunction_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance()) return this; + if (!other.importedModule_.isEmpty()) { + if (importedModule_.isEmpty()) { + importedModule_ = other.importedModule_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureImportedModuleIsMutable(); + importedModule_.addAll(other.importedModule_); + } + + } + if (!other.importEntry_.isEmpty()) { + if (importEntry_.isEmpty()) { + importEntry_ = other.importEntry_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureImportEntryIsMutable(); + importEntry_.addAll(other.importEntry_); + } + + } + if (other.hasDeclarationBlock()) { + mergeDeclarationBlock(other.getDeclarationBlock()); + } + if (other.hasExportBlock()) { + mergeExportBlock(other.getExportBlock()); + } + if (other.hasInitializerBlock()) { + mergeInitializerBlock(other.getInitializerBlock()); + } + if (!other.nameBinding_.isEmpty()) { + if (nameBinding_.isEmpty()) { + nameBinding_ = other.nameBinding_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureNameBindingIsMutable(); + nameBinding_.addAll(other.nameBinding_); + } + + } + if (!other.classModel_.isEmpty()) { + if (classModel_.isEmpty()) { + classModel_ = other.classModel_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureClassModelIsMutable(); + classModel_.addAll(other.classModel_); + } + + } + if (!other.moduleExpression_.isEmpty()) { + if (moduleExpression_.isEmpty()) { + moduleExpression_ = other.moduleExpression_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureModuleExpressionIsMutable(); + moduleExpression_.addAll(other.moduleExpression_); + } + + } + if (!other.inlineModule_.isEmpty()) { + if (inlineModule_.isEmpty()) { + inlineModule_ = other.inlineModule_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureInlineModuleIsMutable(); + inlineModule_.addAll(other.inlineModule_); + } + + } + if (other.hasPackageFqn()) { + bitField0_ |= 0x00000200; + packageFqn_ = other.packageFqn_; + + } + if (other.hasTestsInvocation()) { + mergeTestsInvocation(other.getTestsInvocation()); + } + if (other.hasMainInvocation()) { + mergeMainInvocation(other.getMainInvocation()); + } + if (!other.inlinedLocalDeclarations_.isEmpty()) { + if (inlinedLocalDeclarations_.isEmpty()) { + inlinedLocalDeclarations_ = other.inlinedLocalDeclarations_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.addAll(other.inlinedLocalDeclarations_); + } + + } + if (!other.irClassModel_.isEmpty()) { + if (irClassModel_.isEmpty()) { + irClassModel_ = other.irClassModel_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureIrClassModelIsMutable(); + irClassModel_.addAll(other.irClassModel_); + } + + } + if (other.hasDts()) { + bitField0_ |= 0x00004000; + dts_ = other.dts_; + + } + if (other.hasSuiteFunction()) { + setSuiteFunction(other.getSuiteFunction()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getImportedModuleCount(); i++) { + if (!getImportedModule(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getImportEntryCount(); i++) { + if (!getImportEntry(i).isInitialized()) { + + return false; + } + } + if (hasDeclarationBlock()) { + if (!getDeclarationBlock().isInitialized()) { + + return false; + } + } + if (hasExportBlock()) { + if (!getExportBlock().isInitialized()) { + + return false; + } + } + if (hasInitializerBlock()) { + if (!getInitializerBlock().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getNameBindingCount(); i++) { + if (!getNameBinding(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getClassModelCount(); i++) { + if (!getClassModel(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getModuleExpressionCount(); i++) { + if (!getModuleExpression(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getInlineModuleCount(); i++) { + if (!getInlineModule(i).isInitialized()) { + + return false; + } + } + if (hasTestsInvocation()) { + if (!getTestsInvocation().isInitialized()) { + + return false; + } + } + if (hasMainInvocation()) { + if (!getMainInvocation().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { + if (!getInlinedLocalDeclarations(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getIrClassModelCount(); i++) { + if (!getIrClassModel(i).isInitialized()) { + + return false; + } + } + return true; + } + + private void ensureIrClassModelIsMutable() { + if (!((bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = new java.util.ArrayList(irClassModel_); + bitField0_ |= 0x00002000; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List getIrClassModelList() { + return java.util.Collections.unmodifiableList(irClassModel_); + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public int getIrClassModelCount() { + return irClassModel_.size(); + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { + return irClassModel_.get(index); + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder setIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.set(index, value); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder setIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.set(index, builderForValue.build()); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.add(value); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.add(index, value); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.add(builderForValue.build()); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.add(index, builderForValue.build()); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addAllIrClassModel( + java.lang.Iterable values) { + ensureIrClassModelIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, irClassModel_); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder clearIrClassModel() { + irClassModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + + return this; + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder removeIrClassModel(int index) { + ensureIrClassModelIsMutable(); + irClassModel_.remove(index); + + return this; + } + + /** + * optional string dts = 15; + */ + public boolean hasDts() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + + /** + * optional string dts = 15; + */ + public java.lang.String getDts() { + java.lang.Object ref = dts_; + if (!(ref instanceof java.lang.String)) { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + dts_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string dts = 15; + */ + public Builder setDts( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dts_ = value; + + return this; + } + + /** + * optional string dts = 15; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes() { + java.lang.Object ref = dts_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dts_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + + /** + * optional string dts = 15; + */ + public Builder setDtsBytes( + org.jetbrains.kotlin.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dts_ = value; + + return this; + } + + /** + * optional string dts = 15; + */ + public Builder clearDts() { + bitField0_ = (bitField0_ & ~0x00004000); + dts_ = getDefaultInstance().getDts(); + + return this; + } + + /** + * optional int32 suite_function = 16; + */ + public boolean hasSuiteFunction() { + return ((bitField0_ & 0x00008000) == 0x00008000); + } + /** + * optional int32 suite_function = 16; + */ + public int getSuiteFunction() { + return suiteFunction_; + } + /** + * optional int32 suite_function = 16; + */ + public Builder setSuiteFunction(int value) { + bitField0_ |= 0x00008000; + suiteFunction_ = value; + + return this; + } + /** + * optional int32 suite_function = 16; + */ + public Builder clearSuiteFunction() { + bitField0_ = (bitField0_ & ~0x00008000); + suiteFunction_ = 0; + + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + } + + static { + defaultInstance = new Fragment(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.IrClassModel} + */ + public static final class IrClassModel extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + IrClassModelOrBuilder { + public static final int NAME_ID_FIELD_NUMBER = 1; + public static final int SUPER_CLASSES_FIELD_NUMBER = 2; + public static final int PRE_DECLARATION_BLOCK_FIELD_NUMBER = 3; + public static final int POST_DECLARATION_BLOCK_FIELD_NUMBER = 4; + private static final IrClassModel defaultInstance; + private static final long serialVersionUID = 0L; + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public IrClassModel parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new IrClassModel(input, extensionRegistry); + } + }; + + static { + defaultInstance = new IrClassModel(true); + defaultInstance.initFields(); + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private int bitField0_; + private int nameId_; + private java.util.List superClasses_; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock postDeclarationBlock_; + private byte memoizedIsInitialized = -1; + private int memoizedSerializedSize = -1; + // Use IrClassModel.newBuilder() to construct. + private IrClassModel(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private IrClassModel(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + private IrClassModel( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + nameId_ = input.readInt32(); + break; + } + case 16: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + superClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + superClasses_.add(input.readInt32()); + break; + } + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) { + superClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + superClasses_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 26: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = preDeclarationBlock_.toBuilder(); + } + preDeclarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(preDeclarationBlock_); + preDeclarationBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 34: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = postDeclarationBlock_.toBuilder(); + } + postDeclarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(postDeclarationBlock_); + postDeclarationBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + superClasses_ = java.util.Collections.unmodifiableList(superClasses_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + + public static IrClassModel getDefaultInstance() { + return defaultInstance; + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel prototype) { + return newBuilder().mergeFrom(prototype); + } + + public IrClassModel getDefaultInstanceForType() { + return defaultInstance; + } + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * required int32 name_id = 1; + */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * required int32 name_id = 1; + */ + public int getNameId() { + return nameId_; + } + + /** + * repeated int32 super_classes = 2; + */ + public java.util.List + getSuperClassesList() { + return superClasses_; + } + + /** + * repeated int32 super_classes = 2; + */ + public int getSuperClassesCount() { + return superClasses_.size(); + } + + /** + * repeated int32 super_classes = 2; + */ + public int getSuperClasses(int index) { + return superClasses_.get(index); + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public boolean hasPreDeclarationBlock() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock() { + return preDeclarationBlock_; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public boolean hasPostDeclarationBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPostDeclarationBlock() { + return postDeclarationBlock_; + } + + private void initFields() { + nameId_ = 0; + superClasses_ = java.util.Collections.emptyList(); + preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasNameId()) { + memoizedIsInitialized = 0; + return false; + } + if (hasPreDeclarationBlock()) { + if (!getPreDeclarationBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasPostDeclarationBlock()) { + if (!getPostDeclarationBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, nameId_); + } + for (int i = 0; i < superClasses_.size(); i++) { + output.writeInt32(2, superClasses_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(3, preDeclarationBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(4, postDeclarationBlock_); + } + output.writeRawBytes(unknownFields); + } + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32Size(1, nameId_); + } + { + int dataSize = 0; + for (int i = 0; i < superClasses_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(superClasses_.get(i)); + } + size += dataSize; + size += 1 * getSuperClassesList().size(); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(3, preDeclarationBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(4, postDeclarationBlock_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public Builder newBuilderForType() { return newBuilder(); } + + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.IrClassModel} + */ + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModelOrBuilder { + private int bitField0_; + private int nameId_ ; + private java.util.List superClasses_ = java.util.Collections.emptyList(); + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private static Builder create() { + return new Builder(); + } + + private void maybeForceBuilderInitialization() { + } + + public Builder clear() { + super.clear(); + nameId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + superClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.nameId_ = nameId_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + superClasses_ = java.util.Collections.unmodifiableList(superClasses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.superClasses_ = superClasses_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.preDeclarationBlock_ = preDeclarationBlock_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.postDeclarationBlock_ = postDeclarationBlock_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.getDefaultInstance()) return this; + if (other.hasNameId()) { + setNameId(other.getNameId()); + } + if (!other.superClasses_.isEmpty()) { + if (superClasses_.isEmpty()) { + superClasses_ = other.superClasses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSuperClassesIsMutable(); + superClasses_.addAll(other.superClasses_); + } + + } + if (other.hasPreDeclarationBlock()) { + mergePreDeclarationBlock(other.getPreDeclarationBlock()); + } + if (other.hasPostDeclarationBlock()) { + mergePostDeclarationBlock(other.getPostDeclarationBlock()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasNameId()) { + + return false; + } + if (hasPreDeclarationBlock()) { + if (!getPreDeclarationBlock().isInitialized()) { + + return false; + } + } + if (hasPostDeclarationBlock()) { + if (!getPostDeclarationBlock().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + /** + * required int32 name_id = 1; + */ + public boolean hasNameId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * required int32 name_id = 1; + */ + public int getNameId() { + return nameId_; + } + + /** + * required int32 name_id = 1; + */ + public Builder setNameId(int value) { + bitField0_ |= 0x00000001; + nameId_ = value; + + return this; + } + + /** + * required int32 name_id = 1; + */ + public Builder clearNameId() { + bitField0_ = (bitField0_ & ~0x00000001); + nameId_ = 0; + + return this; + } + + private void ensureSuperClassesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + superClasses_ = new java.util.ArrayList(superClasses_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated int32 super_classes = 2; + */ + public java.util.List + getSuperClassesList() { + return java.util.Collections.unmodifiableList(superClasses_); + } + + /** + * repeated int32 super_classes = 2; + */ + public int getSuperClassesCount() { + return superClasses_.size(); + } + + /** + * repeated int32 super_classes = 2; + */ + public int getSuperClasses(int index) { + return superClasses_.get(index); + } + + /** + * repeated int32 super_classes = 2; + */ + public Builder setSuperClasses( + int index, int value) { + ensureSuperClassesIsMutable(); + superClasses_.set(index, value); + + return this; + } + + /** + * repeated int32 super_classes = 2; + */ + public Builder addSuperClasses(int value) { + ensureSuperClassesIsMutable(); + superClasses_.add(value); + + return this; + } + + /** + * repeated int32 super_classes = 2; + */ + public Builder addAllSuperClasses( + java.lang.Iterable values) { + ensureSuperClassesIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, superClasses_); + + return this; + } + + /** + * repeated int32 super_classes = 2; + */ + public Builder clearSuperClasses() { + superClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public boolean hasPreDeclarationBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock() { + return preDeclarationBlock_; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public Builder setPreDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + preDeclarationBlock_ = value; + + bitField0_ |= 0x00000004; + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public Builder setPreDeclarationBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + preDeclarationBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public Builder mergePreDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + preDeclarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + preDeclarationBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(preDeclarationBlock_).mergeFrom(value).buildPartial(); + } else { + preDeclarationBlock_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + public Builder clearPreDeclarationBlock() { + preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public boolean hasPostDeclarationBlock() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPostDeclarationBlock() { + return postDeclarationBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public Builder setPostDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + postDeclarationBlock_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public Builder setPostDeclarationBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + postDeclarationBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public Builder mergePostDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + postDeclarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + postDeclarationBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(postDeclarationBlock_).mergeFrom(value).buildPartial(); + } else { + postDeclarationBlock_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; + */ + public Builder clearPostDeclarationBlock() { + postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + } + public interface InlineModuleOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.InlineModule) org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializer.kt b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializer.kt index d69d45254b3..10dee0b7d03 100644 --- a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializer.kt +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializer.kt @@ -30,14 +30,10 @@ import java.io.File import java.io.OutputStream import java.util.* -class JsAstSerializer(private val jsAstValidator: ((JsProgramFragment, Set) -> Unit)?, - private val pathResolver: (File) -> String) { - private val nameTableBuilder = NameTable.newBuilder() - private val stringTableBuilder = StringTable.newBuilder() - private val nameMap = mutableMapOf() - private val stringMap = mutableMapOf() - private val fileStack: Deque = ArrayDeque() - private val importedNames = mutableSetOf() +class JsAstSerializer( + private val jsAstValidator: ((JsProgramFragment, Set) -> Unit)?, + private val pathResolver: (File) -> String +) : JsAstSerializerBase() { fun serialize(fragment: JsProgramFragment, output: OutputStream) { val namesBySignature = fragment.nameBindings.associateTo(mutableMapOf()) { it.key to it.name } @@ -53,8 +49,7 @@ class JsAstSerializer(private val jsAstValidator: ((JsProgramFragment, Set forBuilder.variables = serialize(x.initVars) - x.initExpression != null -> forBuilder.expression = serialize(x.initExpression) - else -> forBuilder.empty = EmptyInit.newBuilder().build() - } - x.condition?.let { forBuilder.condition = serialize(it) } - x.incrementExpression?.let { forBuilder.increment = serialize(it) } - forBuilder.body = serialize(x.body ?: JsEmpty) - builder.forStatement = forBuilder.build() - } - - override fun visitForIn(x: JsForIn) { - val forInBuilder = ForIn.newBuilder() - when { - x.iterVarName != null -> forInBuilder.nameId = serialize(x.iterVarName) - x.iterExpression != null -> forInBuilder.expression = serialize(x.iterExpression) - } - forInBuilder.iterable = serialize(x.objectExpression) - forInBuilder.body = serialize(x.body) - builder.forInStatement = forInBuilder.build() - } - - override fun visitTry(x: JsTry) { - val tryBuilder = Try.newBuilder() - tryBuilder.tryBlock = serialize(x.tryBlock) - x.catches.firstOrNull()?.let { c -> - val catchBuilder = Catch.newBuilder() - catchBuilder.parameter = serializeParameter(c.parameter) - catchBuilder.body = serialize(c.body) - tryBuilder.catchBlock = catchBuilder.build() - } - x.finallyBlock?.let { tryBuilder.finallyBlock = serialize(it) } - builder.tryStatement = tryBuilder.build() - } - - override fun visitEmpty(x: JsEmpty) { - builder.empty = Empty.newBuilder().build() - } - } - - withLocation(statement, { visitor.builder.fileId = it }, { visitor.builder.location = it }) { - statement.accept(visitor) - } - - if (statement is HasMetadata && statement.synthetic) { - visitor.builder.synthetic = true - } - - return visitor.builder.build() - } - - private fun serialize(expression: JsExpression): Expression { - val visitor = object : JsVisitor() { - val builder = Expression.newBuilder() - - override fun visitThis(x: JsThisRef) { - builder.thisLiteral = ThisLiteral.newBuilder().build() - } - - override fun visitNull(x: JsNullLiteral) { - builder.nullLiteral = NullLiteral.newBuilder().build() - } - - override fun visitBoolean(x: JsBooleanLiteral) { - if (x.value) { - builder.trueLiteral = TrueLiteral.newBuilder().build() - } - else { - builder.falseLiteral = FalseLiteral.newBuilder().build() - } - } - - override fun visitString(x: JsStringLiteral) { - builder.stringLiteral = serialize(x.value) - } - - override fun visitRegExp(x: JsRegExp) { - val regExpBuilder = RegExpLiteral.newBuilder() - regExpBuilder.patternStringId = serialize(x.pattern) - x.flags?.let { regExpBuilder.flagsStringId = serialize(it) } - builder.regExpLiteral = regExpBuilder.build() - } - - override fun visitInt(x: JsIntLiteral) { - builder.intLiteral = x.value - } - - override fun visitDouble(x: JsDoubleLiteral) { - builder.doubleLiteral = x.value - } - - override fun visitArray(x: JsArrayLiteral) { - val arrayBuilder = ArrayLiteral.newBuilder() - x.expressions.forEach { arrayBuilder.addElement(serialize(it)) } - builder.arrayLiteral = arrayBuilder.build() - } - - override fun visitObjectLiteral(x: JsObjectLiteral) { - val objectBuilder = ObjectLiteral.newBuilder() - for (initializer in x.propertyInitializers) { - val entryBuilder = ObjectLiteralEntry.newBuilder() - entryBuilder.key = serialize(initializer.labelExpr) - entryBuilder.value = serialize(initializer.valueExpr) - objectBuilder.addEntry(entryBuilder) - } - objectBuilder.multiline = x.isMultiline - builder.objectLiteral = objectBuilder.build() - } - - override fun visitFunction(x: JsFunction) { - val functionBuilder = JsAstProtoBuf.Function.newBuilder() - x.parameters.forEach { functionBuilder.addParameter(serializeParameter(it)) } - x.name?.let { functionBuilder.nameId = serialize(it) } - functionBuilder.body = serialize(x.body) - if (x.isLocal) { - functionBuilder.local = true - } - builder.function = functionBuilder.build() - } - - override fun visitDocComment(comment: JsDocComment) { - val commentBuilder = DocComment.newBuilder() - for ((name, value) in comment.tags) { - val tagBuilder = DocCommentTag.newBuilder() - tagBuilder.nameId = serialize(name) - when (value) { - is JsNameRef -> tagBuilder.expression = serialize(value) - is String -> tagBuilder.valueStringId = serialize(value) - } - commentBuilder.addTag(tagBuilder) - } - builder.docComment = commentBuilder.build() - } - - override fun visitBinaryExpression(x: JsBinaryOperation) { - val binaryBuilder = BinaryOperation.newBuilder() - binaryBuilder.left = serialize(x.arg1) - binaryBuilder.right = serialize(x.arg2) - binaryBuilder.type = map(x.operator) - builder.binary = binaryBuilder.build() - } - - override fun visitPrefixOperation(x: JsPrefixOperation) { - builder.unary = serializeUnary(x, postfix = false) - } - - override fun visitPostfixOperation(x: JsPostfixOperation) { - builder.unary = serializeUnary(x, postfix = true) - } - - override fun visitConditional(x: JsConditional) { - val conditionalBuilder = Conditional.newBuilder() - conditionalBuilder.testExpression = serialize(x.testExpression) - conditionalBuilder.thenExpression = serialize(x.thenExpression) - conditionalBuilder.elseExpression = serialize(x.elseExpression) - builder.conditional = conditionalBuilder.build() - } - - override fun visitArrayAccess(x: JsArrayAccess) { - val arrayAccessBuilder = ArrayAccess.newBuilder() - arrayAccessBuilder.array = serialize(x.arrayExpression) - arrayAccessBuilder.index = serialize(x.indexExpression) - builder.arrayAccess = arrayAccessBuilder.build() - } - - override fun visitNameRef(nameRef: JsNameRef) { - val name = nameRef.name - val qualifier = nameRef.qualifier - if (name != null) { - if (qualifier != null || nameRef.isInline == true) { - val nameRefBuilder = NameReference.newBuilder() - nameRefBuilder.nameId = serialize(name) - if (qualifier != null) { - nameRefBuilder.qualifier = serialize(qualifier) - } - nameRef.isInline?.let { - nameRefBuilder.inlineStrategy = if (it) InlineStrategy.IN_PLACE else InlineStrategy.NOT_INLINE - } - builder.nameReference = nameRefBuilder.build() - } - else { - builder.simpleNameReference = serialize(name) - } - } - else { - val propertyRefBuilder = PropertyReference.newBuilder() - propertyRefBuilder.stringId = serialize(nameRef.ident) - qualifier?.let { propertyRefBuilder.qualifier = serialize(it) } - nameRef.isInline?.let { - propertyRefBuilder.inlineStrategy = if (it) InlineStrategy.IN_PLACE else InlineStrategy.NOT_INLINE - } - builder.propertyReference = propertyRefBuilder.build() - } - } - - override fun visitInvocation(invocation: JsInvocation) { - val invocationBuilder = Invocation.newBuilder() - invocationBuilder.qualifier = serialize(invocation.qualifier) - invocation.arguments.forEach { invocationBuilder.addArgument(serialize(it)) } - if (invocation.isInline == true) { - invocationBuilder.inlineStrategy = InlineStrategy.IN_PLACE - } - builder.invocation = invocationBuilder.build() - } - - override fun visitNew(x: JsNew) { - val instantiationBuilder = Instantiation.newBuilder() - instantiationBuilder.qualifier = serialize(x.constructorExpression) - x.arguments.forEach { instantiationBuilder.addArgument(serialize(it)) } - builder.instantiation = instantiationBuilder.build() - } - } - - withLocation(expression, { visitor.builder.fileId = it }, {visitor.builder.location = it }) { - expression.accept(visitor) - } - - with (visitor.builder) { - synthetic = expression.synthetic - sideEffects = map(expression.sideEffects) - expression.localAlias?.let { localAlias = serialize(it) } - } - - return visitor.builder.build() - } - - private fun serialize(module: JsImportedModule): JsAstProtoBuf.JsImportedModule { - val moduleBuilder = JsAstProtoBuf.JsImportedModule.newBuilder() - moduleBuilder.externalName = serialize(module.externalName) - moduleBuilder.internalName = serialize(module.internalName) - module.plainReference?.let { - moduleBuilder.plainReference = serialize(it) - } - return moduleBuilder.build() - } - - private fun serializeParameter(parameter: JsParameter): Parameter { - val parameterBuilder = Parameter.newBuilder() - parameterBuilder.nameId = serialize(parameter.name) - if (parameter.hasDefaultValue) { - parameterBuilder.hasDefaultValue = true - } - return parameterBuilder.build() - } - - private fun serializeBlock(block: JsGlobalBlock): GlobalBlock { - val blockBuilder = GlobalBlock.newBuilder() - for (part in block.statements) { - blockBuilder.addStatement(serialize(part)) - } - return blockBuilder.build() - } - - private fun serializeVars(vars: JsVars): Vars { - val varsBuilder = Vars.newBuilder() - for (varDecl in vars.vars) { - val declBuilder = VarDeclaration.newBuilder() - withLocation(varDecl, { declBuilder.fileId = it }, { declBuilder.location = it }) { - declBuilder.nameId = serialize(varDecl.name) - varDecl.initExpression?.let { declBuilder.initialValue = serialize(it) } - } - varsBuilder.addDeclaration(declBuilder) - } - - if (vars.isMultiline) { - varsBuilder.multiline = true - } - vars.exportedPackage?.let { varsBuilder.exportedPackageId = serialize(it) } - - return varsBuilder.build() - } - - private fun serializeUnary(x: JsUnaryOperation, postfix: Boolean): UnaryOperation { - val unaryBuilder = UnaryOperation.newBuilder() - unaryBuilder.operand = serialize(x.arg) - unaryBuilder.type = map(x.operator) - unaryBuilder.postfix = postfix - return unaryBuilder.build() - } - - private fun map(op: JsBinaryOperator) = when (op) { - JsBinaryOperator.MUL -> MUL - JsBinaryOperator.DIV -> DIV - JsBinaryOperator.MOD -> MOD - JsBinaryOperator.ADD -> ADD - JsBinaryOperator.SUB -> SUB - JsBinaryOperator.SHL -> SHL - JsBinaryOperator.SHR -> SHR - JsBinaryOperator.SHRU -> SHRU - JsBinaryOperator.LT -> LT - JsBinaryOperator.LTE -> LTE - JsBinaryOperator.GT -> GT - JsBinaryOperator.GTE -> GTE - JsBinaryOperator.INSTANCEOF -> INSTANCEOF - JsBinaryOperator.INOP -> IN - JsBinaryOperator.EQ -> EQ - JsBinaryOperator.NEQ -> NEQ - JsBinaryOperator.REF_EQ -> REF_EQ - JsBinaryOperator.REF_NEQ -> REF_NEQ - JsBinaryOperator.BIT_AND -> BIT_AND - JsBinaryOperator.BIT_XOR -> BIT_XOR - JsBinaryOperator.BIT_OR -> BIT_OR - JsBinaryOperator.AND -> AND - JsBinaryOperator.OR -> OR - JsBinaryOperator.ASG -> ASG - JsBinaryOperator.ASG_ADD -> ASG_ADD - JsBinaryOperator.ASG_SUB -> ASG_SUB - JsBinaryOperator.ASG_MUL -> ASG_MUL - JsBinaryOperator.ASG_DIV -> ASG_DIV - JsBinaryOperator.ASG_MOD -> ASG_MOD - JsBinaryOperator.ASG_SHL -> ASG_SHL - JsBinaryOperator.ASG_SHR -> ASG_SHR - JsBinaryOperator.ASG_SHRU -> ASG_SHRU - JsBinaryOperator.ASG_BIT_AND -> ASG_BIT_AND - JsBinaryOperator.ASG_BIT_OR -> ASG_BIT_OR - JsBinaryOperator.ASG_BIT_XOR -> ASG_BIT_XOR - JsBinaryOperator.COMMA -> COMMA - } - - private fun map(op: JsUnaryOperator) = when (op) { - JsUnaryOperator.BIT_NOT -> BIT_NOT - JsUnaryOperator.DEC -> DEC - JsUnaryOperator.DELETE -> DELETE - JsUnaryOperator.INC -> INC - JsUnaryOperator.NEG -> NEG - JsUnaryOperator.POS -> POS - JsUnaryOperator.NOT -> NOT - JsUnaryOperator.TYPEOF -> TYPEOF - JsUnaryOperator.VOID -> VOID - } - - private fun map(sideEffects: SideEffectKind) = when (sideEffects) { - SideEffectKind.AFFECTS_STATE -> SideEffects.AFFECTS_STATE - SideEffectKind.DEPENDS_ON_STATE -> SideEffects.DEPENDS_ON_STATE - SideEffectKind.PURE -> SideEffects.PURE - } - - private fun map(specialFunction: SpecialFunction) = when (specialFunction) { - SpecialFunction.DEFINE_INLINE_FUNCTION -> JsAstProtoBuf.SpecialFunction.DEFINE_INLINE_FUNCTION - SpecialFunction.WRAP_FUNCTION -> JsAstProtoBuf.SpecialFunction.WRAP_FUNCTION - SpecialFunction.TO_BOXED_CHAR -> JsAstProtoBuf.SpecialFunction.TO_BOXED_CHAR - SpecialFunction.UNBOX_CHAR -> JsAstProtoBuf.SpecialFunction.UNBOX_CHAR - SpecialFunction.SUSPEND_CALL -> JsAstProtoBuf.SpecialFunction.SUSPEND_CALL - SpecialFunction.COROUTINE_RESULT -> JsAstProtoBuf.SpecialFunction.COROUTINE_RESULT - SpecialFunction.COROUTINE_CONTROLLER -> JsAstProtoBuf.SpecialFunction.COROUTINE_CONTROLLER - SpecialFunction.COROUTINE_RECEIVER -> JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER - SpecialFunction.SET_COROUTINE_RESULT -> JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT - SpecialFunction.GET_KCLASS -> JsAstProtoBuf.SpecialFunction.GET_KCLASS - SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE - } - - private fun serialize(name: JsName): Int = nameMap.getOrPut(name) { - val builder = Name.newBuilder() - builder.identifier = serialize(name.ident) - builder.temporary = name.isTemporary - name.localAlias?.let { - builder.localNameId = serialize(it) - } - - if (name.imported && name !in importedNames) { - builder.imported = true - } - - name.specialFunction?.let { - builder.specialFunction = map(it) - } - - val result = nameTableBuilder.entryCount - nameTableBuilder.addEntry(builder) - result - } - - private fun serialize(alias: LocalAlias): JsAstProtoBuf.LocalAlias { - val builder = JsAstProtoBuf.LocalAlias.newBuilder() - builder.localNameId = serialize(alias.name) - alias.tag?.let { - builder.tag = serialize(it) - } - return builder.build() - } - - private fun serialize(string: String) = stringMap.getOrPut(string) { - val result = stringTableBuilder.entryCount - stringTableBuilder.addEntry(string) - result - } - - private inline fun withLocation(node: JsNode, fileConsumer: (Int) -> Unit, locationConsumer: (Location) -> Unit, inner: () -> Unit) { - val location = extractLocation(node) - var fileChanged = false - if (location != null) { - val lastFile = fileStack.peek() - val newFile = location.file - fileChanged = lastFile != newFile - if (fileChanged) { - fileConsumer(serialize(newFile)) - fileStack.push(location.file) - } - val locationBuilder = Location.newBuilder() - locationBuilder.startLine = location.startLine - locationBuilder.startChar = location.startChar - locationConsumer(locationBuilder.build()) - } - - inner() - - if (fileChanged) { - fileStack.pop() - } - } - - private fun extractLocation(node: JsNode): JsLocation? { + override fun extractLocation(node: JsNode): JsLocation? { val source = node.source return when (source) { is JsLocationWithSource -> source.asSimpleLocation() diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializerBase.kt b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializerBase.kt new file mode 100644 index 00000000000..7755f9ccd01 --- /dev/null +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstSerializerBase.kt @@ -0,0 +1,546 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.serialization.js.ast + +import org.jetbrains.kotlin.js.backend.ast.* +import org.jetbrains.kotlin.js.backend.ast.metadata.* +import java.io.File +import java.util.* + +abstract class JsAstSerializerBase { + + protected val nameTableBuilder = JsAstProtoBuf.NameTable.newBuilder() + protected val stringTableBuilder = JsAstProtoBuf.StringTable.newBuilder() + protected val nameMap = mutableMapOf() + protected val stringMap = mutableMapOf() + protected val fileStack: Deque = ArrayDeque() + protected val importedNames = mutableSetOf() + + protected fun serialize(statement: JsStatement): JsAstProtoBuf.Statement { + val visitor = object : JsVisitor() { + val builder = JsAstProtoBuf.Statement.newBuilder() + + override fun visitReturn(x: JsReturn) { + val returnBuilder = JsAstProtoBuf.Return.newBuilder() + x.expression?.let { returnBuilder.value = serialize(it) } + builder.returnStatement = returnBuilder.build() + } + + override fun visitThrow(x: JsThrow) { + val throwBuilder = JsAstProtoBuf.Throw.newBuilder() + throwBuilder.exception = serialize(x.expression) + builder.throwStatement = throwBuilder.build() + } + + override fun visitBreak(x: JsBreak) { + val breakBuilder = JsAstProtoBuf.Break.newBuilder() + x.label?.let { breakBuilder.labelId = serialize(it.name!!) } + builder.breakStatement = breakBuilder.build() + } + + override fun visitContinue(x: JsContinue) { + val continueBuilder = JsAstProtoBuf.Continue.newBuilder() + x.label?.let { continueBuilder.labelId = serialize(it.name!!) } + builder.continueStatement = continueBuilder.build() + } + + override fun visitDebugger(x: JsDebugger) { + builder.debugger = JsAstProtoBuf.Debugger.newBuilder().build() + } + + override fun visitExpressionStatement(x: JsExpressionStatement) { + val statementBuilder = JsAstProtoBuf.ExpressionStatement.newBuilder() + statementBuilder.expression = serialize(x.expression) + val tag = x.exportedTag + if (tag != null) { + statementBuilder.exportedTagId = serialize(tag) + } + + builder.expression = statementBuilder.build() + } + + override fun visitVars(x: JsVars) { + builder.vars = serializeVars(x) + } + + override fun visitBlock(x: JsBlock) { + if (x is JsGlobalBlock) { + builder.globalBlock = serializeBlock(x) + } else { + val blockBuilder = JsAstProtoBuf.Block.newBuilder() + for (part in x.statements) { + blockBuilder.addStatement(serialize(part)) + } + builder.block = blockBuilder.build() + } + } + + override fun visitLabel(x: JsLabel) { + val labelBuilder = JsAstProtoBuf.Label.newBuilder() + labelBuilder.nameId = serialize(x.name) + labelBuilder.innerStatement = serialize(x.statement) + builder.label = labelBuilder.build() + } + + override fun visitIf(x: JsIf) { + val ifBuilder = JsAstProtoBuf.If.newBuilder() + ifBuilder.condition = serialize(x.ifExpression) + ifBuilder.thenStatement = serialize(x.thenStatement) + x.elseStatement?.let { ifBuilder.elseStatement = serialize(it) } + builder.ifStatement = ifBuilder.build() + } + + override fun visit(x: JsSwitch) { + val switchBuilder = JsAstProtoBuf.Switch.newBuilder() + switchBuilder.expression = serialize(x.expression) + for (case in x.cases) { + val entryBuilder = JsAstProtoBuf.SwitchEntry.newBuilder() + withLocation(case, { entryBuilder.fileId = it }, { entryBuilder.location = it }) {} + if (case is JsCase) { + entryBuilder.label = serialize(case.caseExpression) + } + for (part in case.statements) { + entryBuilder.addStatement(serialize(part)) + } + switchBuilder.addEntry(entryBuilder) + } + builder.switchStatement = switchBuilder.build() + } + + override fun visitWhile(x: JsWhile) { + val whileBuilder = JsAstProtoBuf.While.newBuilder() + whileBuilder.condition = serialize(x.condition) + whileBuilder.body = serialize(x.body) + builder.whileStatement = whileBuilder.build() + } + + override fun visitDoWhile(x: JsDoWhile) { + val doWhileBuilder = JsAstProtoBuf.DoWhile.newBuilder() + doWhileBuilder.condition = serialize(x.condition) + doWhileBuilder.body = serialize(x.body) + builder.doWhileStatement = doWhileBuilder.build() + } + + override fun visitFor(x: JsFor) { + val forBuilder = JsAstProtoBuf.For.newBuilder() + when { + x.initVars != null -> forBuilder.variables = serialize(x.initVars) + x.initExpression != null -> forBuilder.expression = serialize(x.initExpression) + else -> forBuilder.empty = JsAstProtoBuf.EmptyInit.newBuilder().build() + } + x.condition?.let { forBuilder.condition = serialize(it) } + x.incrementExpression?.let { forBuilder.increment = serialize(it) } + forBuilder.body = serialize(x.body ?: JsEmpty) + builder.forStatement = forBuilder.build() + } + + override fun visitForIn(x: JsForIn) { + val forInBuilder = JsAstProtoBuf.ForIn.newBuilder() + when { + x.iterVarName != null -> forInBuilder.nameId = serialize(x.iterVarName) + x.iterExpression != null -> forInBuilder.expression = serialize(x.iterExpression) + } + forInBuilder.iterable = serialize(x.objectExpression) + forInBuilder.body = serialize(x.body) + builder.forInStatement = forInBuilder.build() + } + + override fun visitTry(x: JsTry) { + val tryBuilder = JsAstProtoBuf.Try.newBuilder() + tryBuilder.tryBlock = serialize(x.tryBlock) + x.catches.firstOrNull()?.let { c -> + val catchBuilder = JsAstProtoBuf.Catch.newBuilder() + catchBuilder.parameter = serializeParameter(c.parameter) + catchBuilder.body = serialize(c.body) + tryBuilder.catchBlock = catchBuilder.build() + } + x.finallyBlock?.let { tryBuilder.finallyBlock = serialize(it) } + builder.tryStatement = tryBuilder.build() + } + + override fun visitEmpty(x: JsEmpty) { + builder.empty = JsAstProtoBuf.Empty.newBuilder().build() + } + + override fun visitSingleLineComment(comment: JsSingleLineComment) { + builder.singleLineComment = JsAstProtoBuf.SingleLineComment.newBuilder().setMessage(comment.text).build() + } + } + + withLocation(statement, { visitor.builder.fileId = it }, { visitor.builder.location = it }) { + statement.accept(visitor) + } + + if (statement is HasMetadata && statement.synthetic) { + visitor.builder.synthetic = true + } + + if (visitor.builder.statementCase == JsAstProtoBuf.Statement.StatementCase.STATEMENT_NOT_SET) { + error("Unknown statement type: ${statement::class.qualifiedName}") + } + + return visitor.builder.build() + } + + protected fun serialize(expression: JsExpression): JsAstProtoBuf.Expression { + val visitor = object : JsVisitor() { + val builder = JsAstProtoBuf.Expression.newBuilder() + + override fun visitThis(x: JsThisRef) { + builder.thisLiteral = JsAstProtoBuf.ThisLiteral.newBuilder().build() + } + + override fun visitNull(x: JsNullLiteral) { + builder.nullLiteral = JsAstProtoBuf.NullLiteral.newBuilder().build() + } + + override fun visitBoolean(x: JsBooleanLiteral) { + if (x.value) { + builder.trueLiteral = JsAstProtoBuf.TrueLiteral.newBuilder().build() + } else { + builder.falseLiteral = JsAstProtoBuf.FalseLiteral.newBuilder().build() + } + } + + override fun visitString(x: JsStringLiteral) { + builder.stringLiteral = serialize(x.value) + } + + override fun visitRegExp(x: JsRegExp) { + val regExpBuilder = JsAstProtoBuf.RegExpLiteral.newBuilder() + regExpBuilder.patternStringId = serialize(x.pattern) + x.flags?.let { regExpBuilder.flagsStringId = serialize(it) } + builder.regExpLiteral = regExpBuilder.build() + } + + override fun visitInt(x: JsIntLiteral) { + builder.intLiteral = x.value + } + + override fun visitDouble(x: JsDoubleLiteral) { + builder.doubleLiteral = x.value + } + + override fun visitArray(x: JsArrayLiteral) { + val arrayBuilder = JsAstProtoBuf.ArrayLiteral.newBuilder() + x.expressions.forEach { arrayBuilder.addElement(serialize(it)) } + builder.arrayLiteral = arrayBuilder.build() + } + + override fun visitObjectLiteral(x: JsObjectLiteral) { + val objectBuilder = JsAstProtoBuf.ObjectLiteral.newBuilder() + for (initializer in x.propertyInitializers) { + val entryBuilder = JsAstProtoBuf.ObjectLiteralEntry.newBuilder() + entryBuilder.key = serialize(initializer.labelExpr) + entryBuilder.value = serialize(initializer.valueExpr) + objectBuilder.addEntry(entryBuilder) + } + objectBuilder.multiline = x.isMultiline + builder.objectLiteral = objectBuilder.build() + } + + override fun visitFunction(x: JsFunction) { + val functionBuilder = JsAstProtoBuf.Function.newBuilder() + x.parameters.forEach { functionBuilder.addParameter(serializeParameter(it)) } + x.name?.let { functionBuilder.nameId = serialize(it) } + functionBuilder.body = serialize(x.body) + if (x.isLocal) { + functionBuilder.local = true + } + builder.function = functionBuilder.build() + } + + override fun visitDocComment(comment: JsDocComment) { + val commentBuilder = JsAstProtoBuf.DocComment.newBuilder() + for ((name, value) in comment.tags) { + val tagBuilder = JsAstProtoBuf.DocCommentTag.newBuilder() + tagBuilder.nameId = serialize(name) + when (value) { + is JsNameRef -> tagBuilder.expression = serialize(value) + is String -> tagBuilder.valueStringId = serialize(value) + } + commentBuilder.addTag(tagBuilder) + } + builder.docComment = commentBuilder.build() + } + + override fun visitBinaryExpression(x: JsBinaryOperation) { + val binaryBuilder = JsAstProtoBuf.BinaryOperation.newBuilder() + binaryBuilder.left = serialize(x.arg1) + binaryBuilder.right = serialize(x.arg2) + binaryBuilder.type = map(x.operator) + builder.binary = binaryBuilder.build() + } + + override fun visitPrefixOperation(x: JsPrefixOperation) { + builder.unary = serializeUnary(x, postfix = false) + } + + override fun visitPostfixOperation(x: JsPostfixOperation) { + builder.unary = serializeUnary(x, postfix = true) + } + + override fun visitConditional(x: JsConditional) { + val conditionalBuilder = JsAstProtoBuf.Conditional.newBuilder() + conditionalBuilder.testExpression = serialize(x.testExpression) + conditionalBuilder.thenExpression = serialize(x.thenExpression) + conditionalBuilder.elseExpression = serialize(x.elseExpression) + builder.conditional = conditionalBuilder.build() + } + + override fun visitArrayAccess(x: JsArrayAccess) { + val arrayAccessBuilder = JsAstProtoBuf.ArrayAccess.newBuilder() + arrayAccessBuilder.array = serialize(x.arrayExpression) + arrayAccessBuilder.index = serialize(x.indexExpression) + builder.arrayAccess = arrayAccessBuilder.build() + } + + override fun visitNameRef(nameRef: JsNameRef) { + val name = nameRef.name + val qualifier = nameRef.qualifier + if (name != null) { + if (qualifier != null || nameRef.isInline == true) { + val nameRefBuilder = JsAstProtoBuf.NameReference.newBuilder() + nameRefBuilder.nameId = serialize(name) + if (qualifier != null) { + nameRefBuilder.qualifier = serialize(qualifier) + } + nameRef.isInline?.let { + nameRefBuilder.inlineStrategy = if (it) JsAstProtoBuf.InlineStrategy.IN_PLACE else JsAstProtoBuf.InlineStrategy.NOT_INLINE + } + builder.nameReference = nameRefBuilder.build() + } else { + builder.simpleNameReference = serialize(name) + } + } else { + val propertyRefBuilder = JsAstProtoBuf.PropertyReference.newBuilder() + propertyRefBuilder.stringId = serialize(nameRef.ident) + qualifier?.let { propertyRefBuilder.qualifier = serialize(it) } + nameRef.isInline?.let { + propertyRefBuilder.inlineStrategy = if (it) JsAstProtoBuf.InlineStrategy.IN_PLACE else JsAstProtoBuf.InlineStrategy.NOT_INLINE + } + builder.propertyReference = propertyRefBuilder.build() + } + } + + override fun visitInvocation(invocation: JsInvocation) { + val invocationBuilder = JsAstProtoBuf.Invocation.newBuilder() + invocationBuilder.qualifier = serialize(invocation.qualifier) + invocation.arguments.forEach { invocationBuilder.addArgument(serialize(it)) } + if (invocation.isInline == true) { + invocationBuilder.inlineStrategy = JsAstProtoBuf.InlineStrategy.IN_PLACE + } + builder.invocation = invocationBuilder.build() + } + + override fun visitNew(x: JsNew) { + val instantiationBuilder = JsAstProtoBuf.Instantiation.newBuilder() + instantiationBuilder.qualifier = serialize(x.constructorExpression) + x.arguments.forEach { instantiationBuilder.addArgument(serialize(it)) } + builder.instantiation = instantiationBuilder.build() + } + } + + withLocation(expression, { visitor.builder.fileId = it }, { visitor.builder.location = it }) { + expression.accept(visitor) + } + + with(visitor.builder) { + synthetic = expression.synthetic + sideEffects = map(expression.sideEffects) + expression.localAlias?.let { localAlias = serialize(it) } + } + + return visitor.builder.build() + } + + protected fun serialize(module: JsImportedModule): JsAstProtoBuf.JsImportedModule { + val moduleBuilder = JsAstProtoBuf.JsImportedModule.newBuilder() + moduleBuilder.externalName = serialize(module.externalName) + moduleBuilder.internalName = serialize(module.internalName) + module.plainReference?.let { + moduleBuilder.plainReference = serialize(it) + } + return moduleBuilder.build() + } + + protected fun serializeParameter(parameter: JsParameter): JsAstProtoBuf.Parameter { + val parameterBuilder = JsAstProtoBuf.Parameter.newBuilder() + parameterBuilder.nameId = serialize(parameter.name) + if (parameter.hasDefaultValue) { + parameterBuilder.hasDefaultValue = true + } + return parameterBuilder.build() + } + + protected fun serializeBlock(block: JsGlobalBlock): JsAstProtoBuf.GlobalBlock { + val blockBuilder = JsAstProtoBuf.GlobalBlock.newBuilder() + for (part in block.statements) { + blockBuilder.addStatement(serialize(part)) + } + return blockBuilder.build() + } + + protected fun serializeVars(vars: JsVars): JsAstProtoBuf.Vars { + val varsBuilder = JsAstProtoBuf.Vars.newBuilder() + for (varDecl in vars.vars) { + val declBuilder = JsAstProtoBuf.VarDeclaration.newBuilder() + withLocation(varDecl, { declBuilder.fileId = it }, { declBuilder.location = it }) { + declBuilder.nameId = serialize(varDecl.name) + varDecl.initExpression?.let { declBuilder.initialValue = serialize(it) } + } + varsBuilder.addDeclaration(declBuilder) + } + + if (vars.isMultiline) { + varsBuilder.multiline = true + } + vars.exportedPackage?.let { varsBuilder.exportedPackageId = serialize(it) } + + return varsBuilder.build() + } + + protected fun serializeUnary(x: JsUnaryOperation, postfix: Boolean): JsAstProtoBuf.UnaryOperation { + val unaryBuilder = JsAstProtoBuf.UnaryOperation.newBuilder() + unaryBuilder.operand = serialize(x.arg) + unaryBuilder.type = map(x.operator) + unaryBuilder.postfix = postfix + return unaryBuilder.build() + } + + protected fun map(op: JsBinaryOperator) = when (op) { + JsBinaryOperator.MUL -> JsAstProtoBuf.BinaryOperation.Type.MUL + JsBinaryOperator.DIV -> JsAstProtoBuf.BinaryOperation.Type.DIV + JsBinaryOperator.MOD -> JsAstProtoBuf.BinaryOperation.Type.MOD + JsBinaryOperator.ADD -> JsAstProtoBuf.BinaryOperation.Type.ADD + JsBinaryOperator.SUB -> JsAstProtoBuf.BinaryOperation.Type.SUB + JsBinaryOperator.SHL -> JsAstProtoBuf.BinaryOperation.Type.SHL + JsBinaryOperator.SHR -> JsAstProtoBuf.BinaryOperation.Type.SHR + JsBinaryOperator.SHRU -> JsAstProtoBuf.BinaryOperation.Type.SHRU + JsBinaryOperator.LT -> JsAstProtoBuf.BinaryOperation.Type.LT + JsBinaryOperator.LTE -> JsAstProtoBuf.BinaryOperation.Type.LTE + JsBinaryOperator.GT -> JsAstProtoBuf.BinaryOperation.Type.GT + JsBinaryOperator.GTE -> JsAstProtoBuf.BinaryOperation.Type.GTE + JsBinaryOperator.INSTANCEOF -> JsAstProtoBuf.BinaryOperation.Type.INSTANCEOF + JsBinaryOperator.INOP -> JsAstProtoBuf.BinaryOperation.Type.IN + JsBinaryOperator.EQ -> JsAstProtoBuf.BinaryOperation.Type.EQ + JsBinaryOperator.NEQ -> JsAstProtoBuf.BinaryOperation.Type.NEQ + JsBinaryOperator.REF_EQ -> JsAstProtoBuf.BinaryOperation.Type.REF_EQ + JsBinaryOperator.REF_NEQ -> JsAstProtoBuf.BinaryOperation.Type.REF_NEQ + JsBinaryOperator.BIT_AND -> JsAstProtoBuf.BinaryOperation.Type.BIT_AND + JsBinaryOperator.BIT_XOR -> JsAstProtoBuf.BinaryOperation.Type.BIT_XOR + JsBinaryOperator.BIT_OR -> JsAstProtoBuf.BinaryOperation.Type.BIT_OR + JsBinaryOperator.AND -> JsAstProtoBuf.BinaryOperation.Type.AND + JsBinaryOperator.OR -> JsAstProtoBuf.BinaryOperation.Type.OR + JsBinaryOperator.ASG -> JsAstProtoBuf.BinaryOperation.Type.ASG + JsBinaryOperator.ASG_ADD -> JsAstProtoBuf.BinaryOperation.Type.ASG_ADD + JsBinaryOperator.ASG_SUB -> JsAstProtoBuf.BinaryOperation.Type.ASG_SUB + JsBinaryOperator.ASG_MUL -> JsAstProtoBuf.BinaryOperation.Type.ASG_MUL + JsBinaryOperator.ASG_DIV -> JsAstProtoBuf.BinaryOperation.Type.ASG_DIV + JsBinaryOperator.ASG_MOD -> JsAstProtoBuf.BinaryOperation.Type.ASG_MOD + JsBinaryOperator.ASG_SHL -> JsAstProtoBuf.BinaryOperation.Type.ASG_SHL + JsBinaryOperator.ASG_SHR -> JsAstProtoBuf.BinaryOperation.Type.ASG_SHR + JsBinaryOperator.ASG_SHRU -> JsAstProtoBuf.BinaryOperation.Type.ASG_SHRU + JsBinaryOperator.ASG_BIT_AND -> JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_AND + JsBinaryOperator.ASG_BIT_OR -> JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_OR + JsBinaryOperator.ASG_BIT_XOR -> JsAstProtoBuf.BinaryOperation.Type.ASG_BIT_XOR + JsBinaryOperator.COMMA -> JsAstProtoBuf.BinaryOperation.Type.COMMA + } + + protected fun map(op: JsUnaryOperator) = when (op) { + JsUnaryOperator.BIT_NOT -> JsAstProtoBuf.UnaryOperation.Type.BIT_NOT + JsUnaryOperator.DEC -> JsAstProtoBuf.UnaryOperation.Type.DEC + JsUnaryOperator.DELETE -> JsAstProtoBuf.UnaryOperation.Type.DELETE + JsUnaryOperator.INC -> JsAstProtoBuf.UnaryOperation.Type.INC + JsUnaryOperator.NEG -> JsAstProtoBuf.UnaryOperation.Type.NEG + JsUnaryOperator.POS -> JsAstProtoBuf.UnaryOperation.Type.POS + JsUnaryOperator.NOT -> JsAstProtoBuf.UnaryOperation.Type.NOT + JsUnaryOperator.TYPEOF -> JsAstProtoBuf.UnaryOperation.Type.TYPEOF + JsUnaryOperator.VOID -> JsAstProtoBuf.UnaryOperation.Type.VOID + } + + protected fun map(sideEffects: SideEffectKind) = when (sideEffects) { + SideEffectKind.AFFECTS_STATE -> JsAstProtoBuf.SideEffects.AFFECTS_STATE + SideEffectKind.DEPENDS_ON_STATE -> JsAstProtoBuf.SideEffects.DEPENDS_ON_STATE + SideEffectKind.PURE -> JsAstProtoBuf.SideEffects.PURE + } + + protected fun map(specialFunction: SpecialFunction) = when (specialFunction) { + SpecialFunction.DEFINE_INLINE_FUNCTION -> JsAstProtoBuf.SpecialFunction.DEFINE_INLINE_FUNCTION + SpecialFunction.WRAP_FUNCTION -> JsAstProtoBuf.SpecialFunction.WRAP_FUNCTION + SpecialFunction.TO_BOXED_CHAR -> JsAstProtoBuf.SpecialFunction.TO_BOXED_CHAR + SpecialFunction.UNBOX_CHAR -> JsAstProtoBuf.SpecialFunction.UNBOX_CHAR + SpecialFunction.SUSPEND_CALL -> JsAstProtoBuf.SpecialFunction.SUSPEND_CALL + SpecialFunction.COROUTINE_RESULT -> JsAstProtoBuf.SpecialFunction.COROUTINE_RESULT + SpecialFunction.COROUTINE_CONTROLLER -> JsAstProtoBuf.SpecialFunction.COROUTINE_CONTROLLER + SpecialFunction.COROUTINE_RECEIVER -> JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER + SpecialFunction.SET_COROUTINE_RESULT -> JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT + SpecialFunction.GET_KCLASS -> JsAstProtoBuf.SpecialFunction.GET_KCLASS + SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE + } + + protected fun serialize(name: JsName): Int = nameMap.getOrPut(name) { + val builder = JsAstProtoBuf.Name.newBuilder() + builder.identifier = serialize(name.ident) + builder.temporary = name.isTemporary + name.localAlias?.let { + builder.localNameId = serialize(it) + } + + if (name.imported && name !in importedNames) { + builder.imported = true + } + + name.specialFunction?.let { + builder.specialFunction = map(it) + } + + val result = nameTableBuilder.entryCount + nameTableBuilder.addEntry(builder) + result + } + + protected fun serialize(alias: LocalAlias): JsAstProtoBuf.LocalAlias { + val builder = JsAstProtoBuf.LocalAlias.newBuilder() + builder.localNameId = serialize(alias.name) + alias.tag?.let { + builder.tag = serialize(it) + } + return builder.build() + } + + protected fun serialize(string: String) = stringMap.getOrPut(string) { + val result = stringTableBuilder.entryCount + stringTableBuilder.addEntry(string) + result + } + + private inline fun withLocation(node: JsNode, fileConsumer: (Int) -> Unit, locationConsumer: (JsAstProtoBuf.Location) -> Unit, inner: () -> Unit) { + val location = extractLocation(node) + var fileChanged = false + if (location != null) { + val lastFile = fileStack.peek() + val newFile = location.file + fileChanged = lastFile != newFile + if (fileChanged) { + fileConsumer(serialize(newFile)) + fileStack.push(location.file) + } + val locationBuilder = JsAstProtoBuf.Location.newBuilder() + locationBuilder.startLine = location.startLine + locationBuilder.startChar = location.startChar + locationConsumer(locationBuilder.build()) + } + + inner() + + if (fileChanged) { + fileStack.pop() + } + } + + abstract fun extractLocation(node: JsNode): JsLocation? +} \ No newline at end of file