@nfdi4plants/arctrl 3.2.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -64
- package/dist/ts/index.d.ts +44 -7
- package/dist/ts/index.d.ts.map +1 -1
- package/dist/ts/index.js +45 -8
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Array.js +195 -92
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Async.js +251 -30
- package/dist/ts/node_modules/@fable-org/fable-library-ts/AsyncBuilder.js +61 -11
- package/dist/ts/node_modules/@fable-org/fable-library-ts/BigInt.js +15 -5
- package/dist/ts/node_modules/@fable-org/fable-library-ts/BitConverter.js +139 -0
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Date.js +1 -1
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Decimal.js +68 -12
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Double.js +24 -10
- package/dist/ts/node_modules/@fable-org/fable-library-ts/FSharp.Core.js +8 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Global.js +1 -1
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Int32.js +11 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/List.js +220 -155
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Long.js +7 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Map.js +46 -39
- package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableMap.js +75 -92
- package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableSet.js +56 -76
- package/dist/ts/node_modules/@fable-org/fable-library-ts/NumberStyles.js +54 -0
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Numeric.js +10 -5
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Random.js +3 -4
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Range.js +4 -3
- package/dist/ts/node_modules/@fable-org/fable-library-ts/RegExp.js +2 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq.js +128 -64
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq2.js +4 -8
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Set.js +64 -57
- package/dist/ts/node_modules/@fable-org/fable-library-ts/String.js +68 -21
- package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Collections.Generic.js +3 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Text.js +2 -2
- package/dist/ts/node_modules/@fable-org/fable-library-ts/System.js +5 -5
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Types.js +23 -12
- package/dist/ts/node_modules/@fable-org/fable-library-ts/Util.js +88 -49
- package/dist/ts/node_modules/@fable-org/fable-library-ts/lib/big.js +121 -74
- package/dist/ts/ts/ARC.d.ts +22 -5
- package/dist/ts/ts/ARC.d.ts.map +1 -1
- package/dist/ts/ts/ARC.js +282 -185
- package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts +0 -2
- package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts.map +1 -1
- package/dist/ts/ts/CWL/CWLKnownFieldNames.js +1 -7
- package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts +46 -27
- package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts.map +1 -1
- package/dist/ts/ts/CWL/CWLProcessingUnit.js +312 -123
- package/dist/ts/ts/CWL/CWLTypes.d.ts +481 -148
- package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
- package/dist/ts/ts/CWL/CWLTypes.js +887 -201
- package/dist/ts/ts/CWL/Decode.d.ts +480 -211
- package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
- package/dist/ts/ts/CWL/Decode.js +3614 -2462
- package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +9 -0
- package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -1
- package/dist/ts/ts/CWL/DynamicObjHelpers.js +55 -5
- package/dist/ts/ts/CWL/Encode.d.ts +225 -85
- package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
- package/dist/ts/ts/CWL/Encode.js +1858 -970
- package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +42 -28
- package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
- package/dist/ts/ts/CWL/ExpressionToolDescription.js +34 -13
- package/dist/ts/ts/CWL/HashHelpers.d.ts +38 -0
- package/dist/ts/ts/CWL/HashHelpers.d.ts.map +1 -1
- package/dist/ts/ts/CWL/HashHelpers.js +255 -6
- package/dist/ts/ts/CWL/Inputs.d.ts +127 -56
- package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
- package/dist/ts/ts/CWL/Inputs.js +107 -16
- package/dist/ts/ts/CWL/OperationDescription.d.ts +41 -21
- package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
- package/dist/ts/ts/CWL/OperationDescription.js +35 -9
- package/dist/ts/ts/CWL/Outputs.d.ts +93 -42
- package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
- package/dist/ts/ts/CWL/Outputs.js +101 -19
- package/dist/ts/ts/CWL/ParameterReference.d.ts +11 -8
- package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
- package/dist/ts/ts/CWL/ParameterReference.js +18 -25
- package/dist/ts/ts/CWL/ParameterValue.d.ts +15 -1
- package/dist/ts/ts/CWL/ParameterValue.d.ts.map +1 -1
- package/dist/ts/ts/CWL/ParameterValue.js +59 -35
- package/dist/ts/ts/CWL/Requirements.d.ts +240 -98
- package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
- package/dist/ts/ts/CWL/Requirements.js +462 -89
- package/dist/ts/ts/CWL/ScalarQuoting.d.ts +51 -0
- package/dist/ts/ts/CWL/ScalarQuoting.d.ts.map +1 -0
- package/dist/ts/ts/CWL/ScalarQuoting.js +250 -0
- package/dist/ts/ts/CWL/ToolDescription.d.ts +63 -50
- package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
- package/dist/ts/ts/CWL/ToolDescription.js +34 -13
- package/dist/ts/ts/CWL/WorkflowDescription.d.ts +45 -26
- package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
- package/dist/ts/ts/CWL/WorkflowDescription.js +38 -11
- package/dist/ts/ts/CWL/WorkflowSteps.d.ts +248 -65
- package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
- package/dist/ts/ts/CWL/WorkflowSteps.js +413 -43
- package/dist/ts/ts/CWLRunResolver.d.ts +30 -12
- package/dist/ts/ts/CWLRunResolver.d.ts.map +1 -1
- package/dist/ts/ts/CWLRunResolver.js +221 -86
- package/dist/ts/ts/Contract/ARC.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ARC.js +13 -14
- package/dist/ts/ts/Contract/ArcAssay.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ArcAssay.js +4 -4
- package/dist/ts/ts/Contract/ArcInvestigation.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ArcInvestigation.js +3 -4
- package/dist/ts/ts/Contract/ArcRun.d.ts +12 -2
- package/dist/ts/ts/Contract/ArcRun.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ArcRun.js +47 -20
- package/dist/ts/ts/Contract/ArcStudy.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ArcStudy.js +4 -4
- package/dist/ts/ts/Contract/ArcWorkflow.d.ts +18 -4
- package/dist/ts/ts/Contract/ArcWorkflow.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ArcWorkflow.js +55 -17
- package/dist/ts/ts/Contract/Datamap.d.ts.map +1 -1
- package/dist/ts/ts/Contract/Datamap.js +16 -17
- package/dist/ts/ts/Contract/Git.js +1 -1
- package/dist/ts/ts/Contract/ValidationPackagesConfig.d.ts.map +1 -1
- package/dist/ts/ts/Contract/ValidationPackagesConfig.js +4 -5
- package/dist/ts/ts/ContractIO/ContractIO.d.ts +7 -0
- package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
- package/dist/ts/ts/ContractIO/ContractIO.js +95 -18
- package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts +1 -0
- package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts.map +1 -1
- package/dist/ts/ts/ContractIO/FileSystemHelper.js +12 -5
- package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Assay.js +26 -18
- package/dist/ts/ts/Conversion/Basic.d.ts +4 -0
- package/dist/ts/ts/Conversion/Basic.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Basic.js +55 -31
- package/dist/ts/ts/Conversion/ColumnIndex.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/ColumnIndex.js +2 -4
- package/dist/ts/ts/Conversion/DateTime.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/DateTime.js +1 -2
- package/dist/ts/ts/Conversion/Investigation.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Investigation.js +15 -14
- package/dist/ts/ts/Conversion/Person.js +11 -11
- package/dist/ts/ts/Conversion/Process.d.ts +4 -2
- package/dist/ts/ts/Conversion/Process.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Process.js +134 -97
- package/dist/ts/ts/Conversion/Run.d.ts +36 -6
- package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Run.js +320 -136
- package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/ScholarlyArticle.js +75 -9
- package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Study.js +23 -12
- package/dist/ts/ts/Conversion/Table.d.ts +3 -2
- package/dist/ts/ts/Conversion/Table.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Table.js +8 -8
- package/dist/ts/ts/Conversion/Workflow.d.ts +48 -9
- package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
- package/dist/ts/ts/Conversion/Workflow.js +655 -163
- package/dist/ts/ts/Conversion.js +6 -6
- package/dist/ts/ts/Core/ArcTypes.d.ts +73 -28
- package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
- package/dist/ts/ts/Core/ArcTypes.js +219 -129
- package/dist/ts/ts/Core/Comment.d.ts.map +1 -1
- package/dist/ts/ts/Core/Comment.js +2 -2
- package/dist/ts/ts/Core/CommentList.js +7 -7
- package/dist/ts/ts/Core/Conversion.d.ts.map +1 -1
- package/dist/ts/ts/Core/Conversion.js +68 -59
- package/dist/ts/ts/Core/Data.d.ts +6 -0
- package/dist/ts/ts/Core/Data.d.ts.map +1 -1
- package/dist/ts/ts/Core/Data.js +32 -12
- package/dist/ts/ts/Core/DataContext.d.ts +1 -1
- package/dist/ts/ts/Core/DataContext.d.ts.map +1 -1
- package/dist/ts/ts/Core/DataContext.js +4 -4
- package/dist/ts/ts/Core/DataFile.d.ts +11 -8
- package/dist/ts/ts/Core/DataFile.d.ts.map +1 -1
- package/dist/ts/ts/Core/DataFile.js +55 -61
- package/dist/ts/ts/Core/Datamap.d.ts.map +1 -1
- package/dist/ts/ts/Core/Datamap.js +2 -3
- package/dist/ts/ts/Core/Helper/Collections.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/Collections.js +2 -4
- package/dist/ts/ts/Core/Helper/Identifier.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/Identifier.js +12 -15
- package/dist/ts/ts/Core/Helper/ORCID.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/ORCID.js +2 -3
- package/dist/ts/ts/Core/Helper/Regex.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/Regex.js +52 -53
- package/dist/ts/ts/Core/Helper/SemVer.d.ts +13 -3
- package/dist/ts/ts/Core/Helper/SemVer.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/SemVer.js +96 -6
- package/dist/ts/ts/Core/Helper/Url.d.ts.map +1 -1
- package/dist/ts/ts/Core/Helper/Url.js +1 -1
- package/dist/ts/ts/Core/OntologyAnnotation.js +22 -22
- package/dist/ts/ts/Core/Person.d.ts.map +1 -1
- package/dist/ts/ts/Core/Person.js +2 -2
- package/dist/ts/ts/Core/Process/ColumnIndex.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/ColumnIndex.js +10 -12
- package/dist/ts/ts/Core/Process/Component.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/Component.js +22 -22
- package/dist/ts/ts/Core/Process/Factor.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/Factor.js +7 -7
- package/dist/ts/ts/Core/Process/FactorValue.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/FactorValue.js +15 -15
- package/dist/ts/ts/Core/Process/Material.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/Material.js +2 -2
- package/dist/ts/ts/Core/Process/MaterialAttribute.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/MaterialAttribute.js +6 -6
- package/dist/ts/ts/Core/Process/MaterialAttributeValue.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +16 -16
- package/dist/ts/ts/Core/Process/Process.js +21 -21
- package/dist/ts/ts/Core/Process/ProcessInput.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/ProcessInput.js +2 -2
- package/dist/ts/ts/Core/Process/ProcessOutput.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/ProcessOutput.js +2 -2
- package/dist/ts/ts/Core/Process/ProcessParameterValue.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/ProcessParameterValue.js +17 -17
- package/dist/ts/ts/Core/Process/ProcessSequence.js +4 -4
- package/dist/ts/ts/Core/Process/Protocol.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/Protocol.js +9 -9
- package/dist/ts/ts/Core/Process/ProtocolParameter.d.ts.map +1 -1
- package/dist/ts/ts/Core/Process/ProtocolParameter.js +6 -6
- package/dist/ts/ts/Core/Publication.d.ts.map +1 -1
- package/dist/ts/ts/Core/Publication.js +3 -3
- package/dist/ts/ts/Core/ScalarValue.d.ts.map +1 -1
- package/dist/ts/ts/Core/ScalarValue.js +9 -13
- package/dist/ts/ts/Core/Table/ArcTable.d.ts.map +1 -1
- package/dist/ts/ts/Core/Table/ArcTable.js +18 -18
- package/dist/ts/ts/Core/Table/ArcTableAux.d.ts +1 -1
- package/dist/ts/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
- package/dist/ts/ts/Core/Table/ArcTableAux.js +59 -70
- package/dist/ts/ts/Core/Table/ArcTables.js +16 -16
- package/dist/ts/ts/Core/Table/CompositeCell.d.ts +4 -0
- package/dist/ts/ts/Core/Table/CompositeCell.d.ts.map +1 -1
- package/dist/ts/ts/Core/Table/CompositeCell.js +39 -2
- package/dist/ts/ts/Core/Table/CompositeHeader.d.ts.map +1 -1
- package/dist/ts/ts/Core/Table/CompositeHeader.js +5 -6
- package/dist/ts/ts/Core/Templates.d.ts.map +1 -1
- package/dist/ts/ts/Core/Templates.js +2 -2
- package/dist/ts/ts/FileSystem/Path.d.ts +13 -2
- package/dist/ts/ts/FileSystem/Path.d.ts.map +1 -1
- package/dist/ts/ts/FileSystem/Path.js +37 -19
- package/dist/ts/ts/Json/Assay.js +22 -22
- package/dist/ts/ts/Json/Comment.js +9 -9
- package/dist/ts/ts/Json/Data.d.ts.map +1 -1
- package/dist/ts/ts/Json/Data.js +11 -11
- package/dist/ts/ts/Json/Datamap/DataContext.js +2 -2
- package/dist/ts/ts/Json/Decode.d.ts.map +1 -1
- package/dist/ts/ts/Json/Decode.js +3 -5
- package/dist/ts/ts/Json/Encode.js +2 -2
- package/dist/ts/ts/Json/Investigation.d.ts.map +1 -1
- package/dist/ts/ts/Json/Investigation.js +20 -20
- package/dist/ts/ts/Json/OntologyAnnotation.d.ts.map +1 -1
- package/dist/ts/ts/Json/OntologyAnnotation.js +18 -18
- package/dist/ts/ts/Json/OntologySourceReference.d.ts.map +1 -1
- package/dist/ts/ts/Json/OntologySourceReference.js +9 -9
- package/dist/ts/ts/Json/Person.d.ts.map +1 -1
- package/dist/ts/ts/Json/Person.js +20 -20
- package/dist/ts/ts/Json/Process/AssayMaterials.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/AssayMaterials.js +1 -2
- package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Component.js +5 -6
- package/dist/ts/ts/Json/Process/Factor.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Factor.js +7 -7
- package/dist/ts/ts/Json/Process/FactorValue.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/FactorValue.js +2 -3
- package/dist/ts/ts/Json/Process/Material.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Material.js +9 -10
- package/dist/ts/ts/Json/Process/MaterialAttribute.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/MaterialAttribute.js +5 -6
- package/dist/ts/ts/Json/Process/MaterialAttributeValue.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +2 -3
- package/dist/ts/ts/Json/Process/Process.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Process.js +8 -9
- package/dist/ts/ts/Json/Process/ProcessParameterValue.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/ProcessParameterValue.js +1 -2
- package/dist/ts/ts/Json/Process/Protocol.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Protocol.js +17 -17
- package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/ProtocolParameter.js +6 -6
- package/dist/ts/ts/Json/Process/Sample.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Sample.js +9 -9
- package/dist/ts/ts/Json/Process/Source.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/Source.js +10 -11
- package/dist/ts/ts/Json/Process/StudyMaterials.d.ts.map +1 -1
- package/dist/ts/ts/Json/Process/StudyMaterials.js +1 -2
- package/dist/ts/ts/Json/PropertyValue.d.ts.map +1 -1
- package/dist/ts/ts/Json/PropertyValue.js +24 -24
- package/dist/ts/ts/Json/Publication.d.ts.map +1 -1
- package/dist/ts/ts/Json/Publication.js +10 -10
- package/dist/ts/ts/Json/ROCrate/LDContext.js +1 -2
- package/dist/ts/ts/Json/ROCrate/LDGraph.js +2 -2
- package/dist/ts/ts/Json/ROCrate/LDNode.js +5 -5
- package/dist/ts/ts/Json/Run.js +9 -9
- package/dist/ts/ts/Json/StringTable.d.ts.map +1 -1
- package/dist/ts/ts/Json/StringTable.js +4 -7
- package/dist/ts/ts/Json/Study.js +20 -20
- package/dist/ts/ts/Json/Table/CellTable.js +1 -2
- package/dist/ts/ts/Json/Table/OATable.js +1 -2
- package/dist/ts/ts/Json/Workflow.js +9 -9
- package/dist/ts/ts/Json.d.ts +121 -1
- package/dist/ts/ts/Json.d.ts.map +1 -1
- package/dist/ts/ts/Json.js +310 -2
- package/dist/ts/ts/JsonIO/Comment.d.ts +15 -0
- package/dist/ts/ts/JsonIO/Comment.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Comment.js +67 -0
- package/dist/ts/ts/JsonIO/Data.d.ts +9 -0
- package/dist/ts/ts/JsonIO/Data.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Data.js +49 -0
- package/dist/ts/ts/JsonIO/DataFile.d.ts +9 -0
- package/dist/ts/ts/JsonIO/DataFile.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/DataFile.js +48 -0
- package/dist/ts/ts/JsonIO/LDObject.d.ts +6 -0
- package/dist/ts/ts/JsonIO/LDObject.d.ts.map +1 -1
- package/dist/ts/ts/JsonIO/LDObject.js +173 -17
- package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts +15 -0
- package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/OntologySourceReference.js +67 -0
- package/dist/ts/ts/JsonIO/Publication.d.ts +15 -0
- package/dist/ts/ts/JsonIO/Publication.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Publication.js +68 -0
- package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts +9 -0
- package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Table/ArcTable.js +74 -0
- package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts +6 -0
- package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Table/CompositeCell.js +29 -0
- package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts +6 -0
- package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Table/CompositeHeader.js +29 -0
- package/dist/ts/ts/JsonIO/Table/IOType.d.ts +6 -0
- package/dist/ts/ts/JsonIO/Table/IOType.d.ts.map +1 -0
- package/dist/ts/ts/JsonIO/Table/IOType.js +29 -0
- package/dist/ts/ts/License.d.ts.map +1 -1
- package/dist/ts/ts/License.js +6 -6
- package/dist/ts/ts/ROCrate/LDContext.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/LDContext.js +31 -39
- package/dist/ts/ts/ROCrate/LDObject.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/LDObject.js +56 -49
- package/dist/ts/ts/ROCrate/LDTypes/Comment.js +2 -2
- package/dist/ts/ts/ROCrate/LDTypes/ComputationalWorkflow.js +3 -3
- package/dist/ts/ts/ROCrate/LDTypes/ComputerLanguage.js +2 -2
- package/dist/ts/ts/ROCrate/LDTypes/CreateAction.js +5 -5
- package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts +1 -0
- package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.js +3 -0
- package/dist/ts/ts/ROCrate/LDTypes/Dataset.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/LDTypes/Dataset.js +22 -17
- package/dist/ts/ts/ROCrate/LDTypes/DefinedTerm.js +2 -2
- package/dist/ts/ts/ROCrate/LDTypes/File.js +5 -5
- package/dist/ts/ts/ROCrate/LDTypes/FormalParameter.js +2 -2
- package/dist/ts/ts/ROCrate/LDTypes/LabProcess.js +9 -9
- package/dist/ts/ts/ROCrate/LDTypes/LabProtocol.js +4 -4
- package/dist/ts/ts/ROCrate/LDTypes/Organization.js +1 -1
- package/dist/ts/ts/ROCrate/LDTypes/Person.js +7 -7
- package/dist/ts/ts/ROCrate/LDTypes/PostalAddress.js +1 -1
- package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.d.ts.map +1 -1
- package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.js +45 -48
- package/dist/ts/ts/ROCrate/LDTypes/Sample.js +3 -3
- package/dist/ts/ts/ROCrate/LDTypes/ScholarlyArticle.js +4 -4
- package/dist/ts/ts/ROCrate/LDTypes/SoftwareSourceCode.js +3 -3
- package/dist/ts/ts/ROCrate/LDTypes/WorkflowInvocation.js +3 -3
- package/dist/ts/ts/ROCrate/LDTypes/WorkflowProtocol.js +2 -2
- package/dist/ts/ts/ROCrateIO.d.ts +18 -4
- package/dist/ts/ts/ROCrateIO.d.ts.map +1 -1
- package/dist/ts/ts/ROCrateIO.js +49 -38
- package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +9 -10
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +7 -7
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +6 -8
- package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +20 -20
- package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/ArcAssay.js +7 -7
- package/dist/ts/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +10 -12
- package/dist/ts/ts/Spreadsheet/ArcRun.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/ArcRun.js +5 -6
- package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/ArcStudy.js +3 -3
- package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +5 -6
- package/dist/ts/ts/Spreadsheet/CollectionAux.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/CollectionAux.js +10 -14
- package/dist/ts/ts/Spreadsheet/Datamap.js +1 -2
- package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapColumn.js +3 -3
- package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapHeader.js +10 -10
- package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.js +9 -10
- package/dist/ts/ts/Spreadsheet/Metadata/Assays.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +8 -10
- package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts +8 -0
- package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +18 -7
- package/dist/ts/ts/Spreadsheet/Metadata/Contacts.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +4 -6
- package/dist/ts/ts/Spreadsheet/Metadata/Factors.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +6 -8
- package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +5 -7
- package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.js +2 -4
- package/dist/ts/ts/Spreadsheet/Metadata/Protocols.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +7 -9
- package/dist/ts/ts/Spreadsheet/Metadata/Publication.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +6 -8
- package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Run.js +9 -11
- package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +17 -17
- package/dist/ts/ts/Spreadsheet/Metadata/Study.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Study.js +10 -12
- package/dist/ts/ts/Spreadsheet/Metadata/Workflow.d.ts.map +1 -1
- package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +7 -9
- package/dist/ts/ts/WorkflowGraph/Adapters.d.ts +1 -1
- package/dist/ts/ts/WorkflowGraph/Adapters.d.ts.map +1 -1
- package/dist/ts/ts/WorkflowGraph/Adapters.js +5 -6
- package/dist/ts/ts/WorkflowGraph/Builder.d.ts +25 -6
- package/dist/ts/ts/WorkflowGraph/Builder.d.ts.map +1 -1
- package/dist/ts/ts/WorkflowGraph/Builder.js +264 -138
- package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts +6 -0
- package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts.map +1 -1
- package/dist/ts/ts/WorkflowGraph/GraphTypes.js +4 -1
- package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts +8 -5
- package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
- package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +27 -10
- package/dist/ts/ts/Xlsx.js +3 -3
- package/dist/ts/ts/Yaml/ValidationPackage.d.ts +3 -3
- package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
- package/dist/ts/ts/Yaml/ValidationPackage.js +11 -23
- package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +3 -3
- package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
- package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +11 -23
- package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js +16 -20
- package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/FableJS.fs.js +1 -1
- package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/ReflectionUtils.fs.js +8 -8
- package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +1 -2
- package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.6.0/Http.fs.js +4 -4
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCell.fs.js +8 -8
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCellsCollection.fs.js +18 -18
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsAddress.fs.js +3 -3
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorkbook.fs.js +1 -1
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorksheet.fs.js +7 -7
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Value.fs.js +3 -5
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Worksheet.fs.js +7 -7
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Ranges/FsRangeBase.fs.js +1 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Tables/FsTable.fs.js +7 -7
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Cell.fs.js +2 -2
- package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Table.fs.js +1 -2
- package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Decode.fs.js +49 -71
- package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Encode.fs.js +1 -1
- package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +1 -2
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Compare.fs.js +857 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/CoreSchema.fs.js +725 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Decode.fs.js +1175 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Encode.fs.js +123 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Layout.fs.js +282 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexeme.fs.js +203 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexer.fs.js +1502 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Model.fs.js +564 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Node.fs.js +453 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Parser.fs.js +2622 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Reader.fs.js +108 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Source.fs.js +649 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Tag.fs.js +32 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Validate.fs.js +1084 -0
- package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Writer.fs.js +2927 -0
- package/package.json +5 -4
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Decode.fs.js +0 -1669
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Encode.fs.js +0 -57
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Escapes.fs.js +0 -320
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Interop/JsInterop.fs.js +0 -10
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Persil.fs.js +0 -414
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Preprocessing.fs.js +0 -319
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Reader.fs.js +0 -1884
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Regex.fs.js +0 -23
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/RegexActivePatterns.fs.js +0 -313
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Syntax.fs.js +0 -840
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Writer.fs.js +0 -689
- package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/YAMLiciousTypes.fs.js +0 -359
|
@@ -0,0 +1,1502 @@
|
|
|
1
|
+
import { getCharAtIndex, toText, printf } from '../../../node_modules/@fable-org/fable-library-ts/String.js';
|
|
2
|
+
import { TagToken_Verbatim, TagToken_Shorthand, Lexeme, GrammarContext, Lexeme_Scalar, Lexeme_Directive, Lexeme_Tag, Lexeme_Alias, Lexeme_Anchor, Lexeme_Comment$, Lexeme_LineStart } from './Lexeme.fs.js';
|
|
3
|
+
import { Cursor__get_Origin, Cursor__get_Text, LexFailure, YamlError, Cursor__SpanOf_Z37302880, Cursor__MarkAt_Z524259A4, YamlErrorCode, Cursor__set_Index_Z524259A4, Cursor__set_LineBegin_Z1FBCCD16, Located$1, Cursor__get_FirstOnLine, Cursor__get_LeadingTab, Cursor__get_AfterIndicator, Cursor__get_JsonLike, Cursor__set_JsonLikeEnd_Z524259A4, Cursor__get_InPrelude, Cursor__get_JsonLikeEnd, Cursor__get_Index, Cursor__set_SeparationHadTab_Z1FBCCD16, Cursor__set_LeadingTab_Z1FBCCD16, Cursor__get_Started, Cursor__set_Started_Z1FBCCD16, Cursor__get_LineBegin, Cursor__get_Length, Cursor__set_JsonLike_Z1FBCCD16, Cursor__set_FirstOnLine_Z1FBCCD16, Cursor__set_AfterIndicator_Z1FBCCD16, Cursor__set_InPrelude_Z1FBCCD16 } from './Source.fs.js';
|
|
4
|
+
import { StringBuilder_$ctor, StringBuilder__Append_244C7CD6 } from '../../../node_modules/@fable-org/fable-library-ts/System.Text.js';
|
|
5
|
+
import { toString } from '../../../node_modules/@fable-org/fable-library-ts/Types.js';
|
|
6
|
+
import { defaultOf, equals } from '../../../node_modules/@fable-org/fable-library-ts/Util.js';
|
|
7
|
+
import { LayoutBoundary, ScalarLayout, SourceSpan, SourceMark, DirectiveKind_ReservedDirective, DirectiveKind_TagDirective, DirectiveKind_YamlVersion, LayoutKind_Fold, LayoutKind_EscapedBreak, ChompingMode, YamlComment, BlockScalarStyle, YamlScalar, ScalarStyle_Block, ScalarStyle } from './Model.fs.js';
|
|
8
|
+
import { class_type } from '../../../node_modules/@fable-org/fable-library-ts/Reflection.js';
|
|
9
|
+
import { ofSeq, empty, singleton } from '../../../node_modules/@fable-org/fable-library-ts/List.js';
|
|
10
|
+
import { value } from '../../../node_modules/@fable-org/fable-library-ts/Option.js';
|
|
11
|
+
import { min, max } from '../../../node_modules/@fable-org/fable-library-ts/Double.js';
|
|
12
|
+
import { item } from '../../../node_modules/@fable-org/fable-library-ts/Array.js';
|
|
13
|
+
import { FSharpResult$2_Ok, FSharpResult$2_Error$ } from '../../../node_modules/@fable-org/fable-library-ts/Result.js';
|
|
14
|
+
|
|
15
|
+
function isBlank(c) {
|
|
16
|
+
if (c === " ") {
|
|
17
|
+
return true;
|
|
18
|
+
} else {
|
|
19
|
+
return c === " ";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function isBreak(c) {
|
|
23
|
+
if (c === "\n") {
|
|
24
|
+
return true;
|
|
25
|
+
} else {
|
|
26
|
+
return c === "\r";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function pairedSurrogate(text, k) {
|
|
30
|
+
if (~~getCharAtIndex(text, k).charCodeAt(0) < 56320) {
|
|
31
|
+
if (k + 1 < text.length && ~~getCharAtIndex(text, k + 1).charCodeAt(0) >= 56320) {
|
|
32
|
+
return ~~getCharAtIndex(text, k + 1).charCodeAt(0) < 57344;
|
|
33
|
+
} else {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
} else if (k > 0 && ~~getCharAtIndex(text, k - 1).charCodeAt(0) >= 55296) {
|
|
37
|
+
return ~~getCharAtIndex(text, k - 1).charCodeAt(0) < 56320;
|
|
38
|
+
} else {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function isNbChar(text, k) {
|
|
43
|
+
const c = getCharAtIndex(text, k);
|
|
44
|
+
if (c >= " " && c <= "~") {
|
|
45
|
+
return true;
|
|
46
|
+
} else if (c === " ") {
|
|
47
|
+
return true;
|
|
48
|
+
} else {
|
|
49
|
+
const code = ~~c.charCodeAt(0) | 0;
|
|
50
|
+
if (code < 160) {
|
|
51
|
+
return code === 133;
|
|
52
|
+
} else if (code < 55296) {
|
|
53
|
+
return true;
|
|
54
|
+
} else if (code < 57344) {
|
|
55
|
+
return pairedSurrogate(text, k);
|
|
56
|
+
} else if (code !== 65279) {
|
|
57
|
+
if (code < 65534) {
|
|
58
|
+
return true;
|
|
59
|
+
} else {
|
|
60
|
+
return code > 65535;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function isJsonChar(text, k) {
|
|
68
|
+
const c = getCharAtIndex(text, k);
|
|
69
|
+
if (c >= " " && c <= "~") {
|
|
70
|
+
return true;
|
|
71
|
+
} else if (c === " ") {
|
|
72
|
+
return true;
|
|
73
|
+
} else {
|
|
74
|
+
const code = ~~c.charCodeAt(0) | 0;
|
|
75
|
+
if (code < 32) {
|
|
76
|
+
return false;
|
|
77
|
+
} else if (code >= 55296 && code < 57344) {
|
|
78
|
+
return pairedSurrogate(text, k);
|
|
79
|
+
} else {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function isFlowIndicator(c) {
|
|
85
|
+
if (((c === "," ? true : c === "[") ? true : c === "]") ? true : c === "{") {
|
|
86
|
+
return true;
|
|
87
|
+
} else {
|
|
88
|
+
return c === "}";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function isFlowGrammar(grammar) {
|
|
92
|
+
switch (grammar.tag) {
|
|
93
|
+
case /* FlowIn */
|
|
94
|
+
2:
|
|
95
|
+
return true;
|
|
96
|
+
case /* FlowKey */
|
|
97
|
+
5:
|
|
98
|
+
return true;
|
|
99
|
+
default:
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function isKeyGrammar(grammar) {
|
|
104
|
+
switch (grammar.tag) {
|
|
105
|
+
case /* BlockKey */
|
|
106
|
+
4:
|
|
107
|
+
return true;
|
|
108
|
+
case /* FlowKey */
|
|
109
|
+
5:
|
|
110
|
+
return true;
|
|
111
|
+
default:
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function skipBlanks(text, from) {
|
|
116
|
+
let p = from;
|
|
117
|
+
while (p < text.length && isBlank(getCharAtIndex(text, p))) {
|
|
118
|
+
p = p + 1 | 0;
|
|
119
|
+
}
|
|
120
|
+
return p | 0;
|
|
121
|
+
}
|
|
122
|
+
function afterBreak(text, k) {
|
|
123
|
+
if (getCharAtIndex(text, k) === "\r" && k + 1 < text.length && getCharAtIndex(text, k + 1) === "\n") {
|
|
124
|
+
return k + 2 | 0;
|
|
125
|
+
} else {
|
|
126
|
+
return k + 1 | 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function blankOrEnd(text, k) {
|
|
130
|
+
if (k >= text.length ? true : isBlank(getCharAtIndex(text, k))) {
|
|
131
|
+
return true;
|
|
132
|
+
} else {
|
|
133
|
+
return isBreak(getCharAtIndex(text, k));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function lineEnd(text, from) {
|
|
137
|
+
let p = from;
|
|
138
|
+
while (p < text.length && !isBreak(getCharAtIndex(text, p))) {
|
|
139
|
+
p = p + 1 | 0;
|
|
140
|
+
}
|
|
141
|
+
return p | 0;
|
|
142
|
+
}
|
|
143
|
+
function atLineStart(cursor, k) {
|
|
144
|
+
let j = k;
|
|
145
|
+
while (j > Cursor__get_Origin(cursor) && getCharAtIndex(Cursor__get_Text(cursor), j - 1) === "\uFEFF") {
|
|
146
|
+
j = j - 1 | 0;
|
|
147
|
+
}
|
|
148
|
+
if (j <= Cursor__get_Origin(cursor)) {
|
|
149
|
+
return true;
|
|
150
|
+
} else {
|
|
151
|
+
return isBreak(getCharAtIndex(Cursor__get_Text(cursor), j - 1));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function markerAt(text, k) {
|
|
155
|
+
if (k + 2 >= text.length) {
|
|
156
|
+
return false;
|
|
157
|
+
} else {
|
|
158
|
+
const c = getCharAtIndex(text, k);
|
|
159
|
+
if ((c === "-" ? true : c === ".") && getCharAtIndex(text, k + 1) === c && getCharAtIndex(text, k + 2) === c) {
|
|
160
|
+
return blankOrEnd(text, k + 3);
|
|
161
|
+
} else {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function copyRange(text, first, finish) {
|
|
167
|
+
const sb = StringBuilder_$ctor();
|
|
168
|
+
for (let k = first; k <= finish - 1; k++) {
|
|
169
|
+
StringBuilder__Append_244C7CD6(sb, getCharAtIndex(text, k));
|
|
170
|
+
}
|
|
171
|
+
return toString(sb);
|
|
172
|
+
}
|
|
173
|
+
function appendCodePoint(sb, codePoint) {
|
|
174
|
+
if (codePoint < 65536) {
|
|
175
|
+
StringBuilder__Append_244C7CD6(sb, String.fromCharCode(~~codePoint & 65535));
|
|
176
|
+
} else {
|
|
177
|
+
const offset = codePoint - 65536 | 0;
|
|
178
|
+
StringBuilder__Append_244C7CD6(StringBuilder__Append_244C7CD6(sb, String.fromCharCode(~~(55296 + ~~(offset / 1024)) & 65535)), String.fromCharCode(~~(56320 + offset % 1024) & 65535));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function codePointUnits(codePoint) {
|
|
182
|
+
if (codePoint < 65536) {
|
|
183
|
+
return 1;
|
|
184
|
+
} else {
|
|
185
|
+
return 2;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
class Cooked {
|
|
189
|
+
constructor() {
|
|
190
|
+
this.sb = StringBuilder_$ctor();
|
|
191
|
+
this.length = 0;
|
|
192
|
+
this.marks = defaultOf();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function Cooked_$reflection() {
|
|
196
|
+
return class_type("YAMLicious.Lexer.Cooked", void 0, Cooked);
|
|
197
|
+
}
|
|
198
|
+
function Cooked_$ctor() {
|
|
199
|
+
return new Cooked();
|
|
200
|
+
}
|
|
201
|
+
function Cooked__AppendChar_244C7CD6(_, c) {
|
|
202
|
+
StringBuilder__Append_244C7CD6(_.sb, c);
|
|
203
|
+
_.length = _.length + 1 | 0;
|
|
204
|
+
}
|
|
205
|
+
function Cooked__AppendRange_487EF8FB(_, text, first, finish) {
|
|
206
|
+
for (let k = first; k <= finish - 1; k++) {
|
|
207
|
+
StringBuilder__Append_244C7CD6(_.sb, getCharAtIndex(text, k));
|
|
208
|
+
}
|
|
209
|
+
if (finish > first) {
|
|
210
|
+
_.length = _.length + (finish - first) | 0;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function Cooked__AppendLineFeeds_Z524259A4(_, count) {
|
|
214
|
+
for (let forLoopVar = 1; forLoopVar <= count; forLoopVar++) {
|
|
215
|
+
StringBuilder__Append_244C7CD6(_.sb, "\n");
|
|
216
|
+
}
|
|
217
|
+
if (count > 0) {
|
|
218
|
+
_.length = _.length + count | 0;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function Cooked__AppendCodePoint_Z524259A4(_, codePoint) {
|
|
222
|
+
appendCodePoint(_.sb, codePoint);
|
|
223
|
+
_.length = _.length + codePointUnits(codePoint) | 0;
|
|
224
|
+
}
|
|
225
|
+
function Cooked__Mark_Z20A902D6(_, kind) {
|
|
226
|
+
if (_.marks == null) {
|
|
227
|
+
_.marks = [];
|
|
228
|
+
}
|
|
229
|
+
void _.marks.push(new LayoutBoundary(_.length, kind));
|
|
230
|
+
}
|
|
231
|
+
function Cooked__get_Layout(_) {
|
|
232
|
+
if (_.marks == null) {
|
|
233
|
+
return void 0;
|
|
234
|
+
} else {
|
|
235
|
+
return new ScalarLayout(ofSeq(_.marks));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function Cooked__get_Text(_) {
|
|
239
|
+
return toString(_.sb);
|
|
240
|
+
}
|
|
241
|
+
function hexValue(c) {
|
|
242
|
+
if (c >= "0" && c <= "9") {
|
|
243
|
+
return ~~c.charCodeAt(0) - ~~"0".charCodeAt(0) | 0;
|
|
244
|
+
} else if (c >= "a" && c <= "f") {
|
|
245
|
+
return ~~c.charCodeAt(0) - ~~"a".charCodeAt(0) + 10 | 0;
|
|
246
|
+
} else if (c >= "A" && c <= "F") {
|
|
247
|
+
return ~~c.charCodeAt(0) - ~~"A".charCodeAt(0) + 10 | 0;
|
|
248
|
+
} else {
|
|
249
|
+
return -1;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function fail(cursor, code, message, first, finish, related) {
|
|
253
|
+
const text = Cursor__get_Text(cursor);
|
|
254
|
+
const limit = lineEnd(text, first) | 0;
|
|
255
|
+
const clipped = min(finish, text.length) | 0;
|
|
256
|
+
throw new LexFailure(new YamlError(code, message, Cursor__SpanOf_Z37302880(cursor, first, (clipped <= limit ? true : clipped > limit && atLineStart(cursor, first) && isBreak(getCharAtIndex(text, clipped - 1)) && !(getCharAtIndex(text, clipped - 1) === "\r" && clipped < text.length && getCharAtIndex(text, clipped) === "\n")) ? clipped : limit), related));
|
|
257
|
+
}
|
|
258
|
+
function bomSpan(cursor, position) {
|
|
259
|
+
const start = Cursor__MarkAt_Z524259A4(cursor, position);
|
|
260
|
+
return new SourceSpan(start, new SourceMark(start.Line, start.Column + 1));
|
|
261
|
+
}
|
|
262
|
+
function failBom(cursor, position) {
|
|
263
|
+
throw new LexFailure(new YamlError(YamlErrorCode.InvalidCharacter, "A byte order mark is valid inside a quoted scalar and at the start of a line outside a flow collection, and nowhere else.", bomSpan(cursor, position), empty()));
|
|
264
|
+
}
|
|
265
|
+
function hex4(code) {
|
|
266
|
+
return toString(StringBuilder__Append_244C7CD6(StringBuilder__Append_244C7CD6(StringBuilder__Append_244C7CD6(StringBuilder__Append_244C7CD6(StringBuilder_$ctor(), getCharAtIndex("0123456789ABCDEF", code >> 12 & 15)), getCharAtIndex("0123456789ABCDEF", code >> 8 & 15)), getCharAtIndex("0123456789ABCDEF", code >> 4 & 15)), getCharAtIndex("0123456789ABCDEF", code & 15)));
|
|
267
|
+
}
|
|
268
|
+
function failChar(cursor, position) {
|
|
269
|
+
let arg = void 0;
|
|
270
|
+
const code = ~~getCharAtIndex(Cursor__get_Text(cursor), position).charCodeAt(0) | 0;
|
|
271
|
+
return fail(cursor, YamlErrorCode.InvalidCharacter, code >= 55296 && code < 57344 ? "A surrogate without its partner is no character, so YAML text cannot hold it." : (arg = hex4(code), toText(printf("U+%s cannot stand in YAML text at this place. A double-quoted scalar can spell it as an escape."))(arg)), position, position + 1, empty());
|
|
272
|
+
}
|
|
273
|
+
function checkNbChars(cursor, first, finish) {
|
|
274
|
+
const text = Cursor__get_Text(cursor);
|
|
275
|
+
let k = first;
|
|
276
|
+
while (k < finish) {
|
|
277
|
+
if (!isNbChar(text, k)) {
|
|
278
|
+
if (getCharAtIndex(text, k) === "\uFEFF") {
|
|
279
|
+
failBom(cursor, k);
|
|
280
|
+
} else {
|
|
281
|
+
failChar(cursor, k);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
k = k + 1 | 0;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function commentLineEnd(cursor, from) {
|
|
288
|
+
const text = Cursor__get_Text(cursor);
|
|
289
|
+
let p = from;
|
|
290
|
+
while (p < text.length && !isBreak(getCharAtIndex(text, p))) {
|
|
291
|
+
if (!isNbChar(text, p)) {
|
|
292
|
+
if (getCharAtIndex(text, p) === "\uFEFF") {
|
|
293
|
+
failBom(cursor, p);
|
|
294
|
+
} else {
|
|
295
|
+
failChar(cursor, p);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
p = p + 1 | 0;
|
|
299
|
+
}
|
|
300
|
+
return p | 0;
|
|
301
|
+
}
|
|
302
|
+
function nameEnd(cursor, from) {
|
|
303
|
+
const text = Cursor__get_Text(cursor);
|
|
304
|
+
let p = from;
|
|
305
|
+
let scanning = true;
|
|
306
|
+
while (scanning && p < text.length) {
|
|
307
|
+
const c = getCharAtIndex(text, p);
|
|
308
|
+
if (((isBlank(c) ? true : isBreak(c)) ? true : isFlowIndicator(c)) ? true : c === "\uFEFF") {
|
|
309
|
+
scanning = false;
|
|
310
|
+
} else if (isNbChar(text, p)) {
|
|
311
|
+
p = p + 1 | 0;
|
|
312
|
+
} else {
|
|
313
|
+
failChar(cursor, p);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return p | 0;
|
|
317
|
+
}
|
|
318
|
+
function isWordChar(c) {
|
|
319
|
+
if ((c >= "0" && c <= "9" ? true : c >= "a" && c <= "z") ? true : c >= "A" && c <= "Z") {
|
|
320
|
+
return true;
|
|
321
|
+
} else {
|
|
322
|
+
return c === "-";
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function isTagPunctuation(c) {
|
|
326
|
+
if (((((((((((((((c === "#" ? true : c === ";") ? true : c === "/") ? true : c === "?") ? true : c === ":") ? true : c === "@") ? true : c === "&") ? true : c === "=") ? true : c === "+") ? true : c === "$") ? true : c === "_") ? true : c === ".") ? true : c === "~") ? true : c === "*") ? true : c === "'") ? true : c === "(") {
|
|
327
|
+
return true;
|
|
328
|
+
} else {
|
|
329
|
+
return c === ")";
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function uriCharLength(text, p) {
|
|
333
|
+
const c = getCharAtIndex(text, p);
|
|
334
|
+
if (c === "%") {
|
|
335
|
+
if (p + 2 < text.length && hexValue(getCharAtIndex(text, p + 1)) >= 0 && hexValue(getCharAtIndex(text, p + 2)) >= 0) {
|
|
336
|
+
return 3;
|
|
337
|
+
} else {
|
|
338
|
+
return 0;
|
|
339
|
+
}
|
|
340
|
+
} else if (((((isWordChar(c) ? true : isTagPunctuation(c)) ? true : c === "!") ? true : c === ",") ? true : c === "[") ? true : c === "]") {
|
|
341
|
+
return 1;
|
|
342
|
+
} else {
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function tagSuffixEnd(cursor, from) {
|
|
347
|
+
const text = Cursor__get_Text(cursor);
|
|
348
|
+
const n = text.length | 0;
|
|
349
|
+
let p = from;
|
|
350
|
+
let scanning = true;
|
|
351
|
+
while (scanning && p < n) {
|
|
352
|
+
const c = getCharAtIndex(text, p);
|
|
353
|
+
if (isWordChar(c) ? true : isTagPunctuation(c)) {
|
|
354
|
+
p = p + 1 | 0;
|
|
355
|
+
} else if (c === "%") {
|
|
356
|
+
if (p + 2 < n && hexValue(getCharAtIndex(text, p + 1)) >= 0 && hexValue(getCharAtIndex(text, p + 2)) >= 0) {
|
|
357
|
+
p = p + 3 | 0;
|
|
358
|
+
} else {
|
|
359
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A `%` in a tag has to be followed by two hexadecimal digits.", p, min(n, p + 3), empty());
|
|
360
|
+
}
|
|
361
|
+
} else {
|
|
362
|
+
scanning = false;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return p | 0;
|
|
366
|
+
}
|
|
367
|
+
function scanTag(cursor, q) {
|
|
368
|
+
const text = Cursor__get_Text(cursor);
|
|
369
|
+
const n = text.length | 0;
|
|
370
|
+
if (q + 1 < n && getCharAtIndex(text, q + 1) === "<") {
|
|
371
|
+
let p = q + 2;
|
|
372
|
+
while (p < n && getCharAtIndex(text, p) !== ">" && !isBlank(getCharAtIndex(text, p)) && !isBreak(getCharAtIndex(text, p))) {
|
|
373
|
+
const length = uriCharLength(text, p) | 0;
|
|
374
|
+
if (length === 0) {
|
|
375
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A verbatim tag holds URI characters only, and a `%` has to be followed by two hexadecimal digits.", p, getCharAtIndex(text, p) === "%" ? p + 3 : p + 1, empty());
|
|
376
|
+
}
|
|
377
|
+
p = p + length | 0;
|
|
378
|
+
}
|
|
379
|
+
if (p >= n ? true : getCharAtIndex(text, p) !== ">") {
|
|
380
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A verbatim tag needs a closing `>`.", q, p, empty());
|
|
381
|
+
}
|
|
382
|
+
if (p === q + 2) {
|
|
383
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A verbatim tag needs a name between the angle brackets.", q, p + 1, empty());
|
|
384
|
+
}
|
|
385
|
+
if (p + 1 < n && getCharAtIndex(text, p + 1) === "#") {
|
|
386
|
+
fail(cursor, YamlErrorCode.GluedComment, "A comment needs a space or a tab before the #.", p + 1, p + 2, empty());
|
|
387
|
+
}
|
|
388
|
+
return [TagToken_Verbatim(copyRange(text, q + 2, p)), p + 1];
|
|
389
|
+
} else if (q + 1 < n && getCharAtIndex(text, q + 1) === "!") {
|
|
390
|
+
const finish = tagSuffixEnd(cursor, q + 2) | 0;
|
|
391
|
+
if (finish === q + 2) {
|
|
392
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A tag needs a name behind its handle.", q, finish, empty());
|
|
393
|
+
}
|
|
394
|
+
return [TagToken_Shorthand("!!", copyRange(text, q + 2, finish)), finish];
|
|
395
|
+
} else {
|
|
396
|
+
let w = q + 1;
|
|
397
|
+
while (w < n && isWordChar(getCharAtIndex(text, w))) {
|
|
398
|
+
w = w + 1 | 0;
|
|
399
|
+
}
|
|
400
|
+
if (w > q + 1 && w < n && getCharAtIndex(text, w) === "!") {
|
|
401
|
+
const finish_1 = tagSuffixEnd(cursor, w + 1) | 0;
|
|
402
|
+
if (finish_1 === w + 1) {
|
|
403
|
+
fail(cursor, YamlErrorCode.InvalidTag, "A tag needs a name behind its handle.", q, finish_1, empty());
|
|
404
|
+
}
|
|
405
|
+
return [TagToken_Shorthand(copyRange(text, q, w + 1), copyRange(text, w + 1, finish_1)), finish_1];
|
|
406
|
+
} else {
|
|
407
|
+
const finish_2 = tagSuffixEnd(cursor, q + 1) | 0;
|
|
408
|
+
return [TagToken_Shorthand("!", copyRange(text, q + 1, finish_2)), finish_2];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function digitsValue(text, first, finish) {
|
|
413
|
+
if (finish <= first ? true : finish - first > 9) {
|
|
414
|
+
return -1;
|
|
415
|
+
} else {
|
|
416
|
+
let value = 0;
|
|
417
|
+
let valid = true;
|
|
418
|
+
for (let k = first; k <= finish - 1; k++) {
|
|
419
|
+
const c = getCharAtIndex(text, k);
|
|
420
|
+
if (c >= "0" && c <= "9") {
|
|
421
|
+
value = value * 10 + (~~c.charCodeAt(0) - ~~"0".charCodeAt(0)) | 0;
|
|
422
|
+
} else {
|
|
423
|
+
valid = false;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (valid) {
|
|
427
|
+
return value | 0;
|
|
428
|
+
} else {
|
|
429
|
+
return -1;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function scanDirective(cursor, q) {
|
|
434
|
+
const text = Cursor__get_Text(cursor);
|
|
435
|
+
const n = text.length | 0;
|
|
436
|
+
let p = q + 1;
|
|
437
|
+
let scanning = true;
|
|
438
|
+
while (scanning && p < n) {
|
|
439
|
+
const c = getCharAtIndex(text, p);
|
|
440
|
+
if (isBreak(c)) {
|
|
441
|
+
scanning = false;
|
|
442
|
+
} else if (c === "#" && isBlank(getCharAtIndex(text, p - 1))) {
|
|
443
|
+
scanning = false;
|
|
444
|
+
} else if (isNbChar(text, p)) {
|
|
445
|
+
p = p + 1 | 0;
|
|
446
|
+
} else if (c === "\uFEFF") {
|
|
447
|
+
failBom(cursor, p);
|
|
448
|
+
} else {
|
|
449
|
+
failChar(cursor, p);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
let finish = p;
|
|
453
|
+
while (finish > q + 1 && isBlank(getCharAtIndex(text, finish - 1))) {
|
|
454
|
+
finish = finish - 1 | 0;
|
|
455
|
+
}
|
|
456
|
+
const starts = [];
|
|
457
|
+
const ends = [];
|
|
458
|
+
let k = q + 1;
|
|
459
|
+
while (k < finish) {
|
|
460
|
+
const s = skipBlanks(text, k) | 0;
|
|
461
|
+
if (s >= finish) {
|
|
462
|
+
k = finish | 0;
|
|
463
|
+
} else {
|
|
464
|
+
let w = s;
|
|
465
|
+
while (w < finish && !isBlank(getCharAtIndex(text, w))) {
|
|
466
|
+
w = w + 1 | 0;
|
|
467
|
+
}
|
|
468
|
+
void starts.push(s);
|
|
469
|
+
void ends.push(w);
|
|
470
|
+
k = w | 0;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (starts.length === 0 ? true : item(0, starts) > q + 1) {
|
|
474
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "A directive needs a name right behind the `%`.", q, q + 1, empty());
|
|
475
|
+
}
|
|
476
|
+
const directiveName = copyRange(text, item(0, starts), item(0, ends));
|
|
477
|
+
const arguments$ = starts.length - 1 | 0;
|
|
478
|
+
switch (directiveName) {
|
|
479
|
+
case "YAML": {
|
|
480
|
+
if (arguments$ !== 1) {
|
|
481
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "The %YAML directive needs exactly one version.", q, finish, empty());
|
|
482
|
+
}
|
|
483
|
+
const first = item(1, starts) | 0;
|
|
484
|
+
const last = item(1, ends) | 0;
|
|
485
|
+
let dot = first;
|
|
486
|
+
while (dot < last && getCharAtIndex(text, dot) !== ".") {
|
|
487
|
+
dot = dot + 1 | 0;
|
|
488
|
+
}
|
|
489
|
+
const major = digitsValue(text, first, dot) | 0;
|
|
490
|
+
const minor = digitsValue(text, dot + 1, last) | 0;
|
|
491
|
+
if ((dot >= last ? true : major < 0) ? true : minor < 0) {
|
|
492
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "The version of the %YAML directive has the form 1.2.", first, last, empty());
|
|
493
|
+
}
|
|
494
|
+
return [DirectiveKind_YamlVersion(major, minor), finish];
|
|
495
|
+
}
|
|
496
|
+
case "TAG": {
|
|
497
|
+
if (arguments$ !== 2) {
|
|
498
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "The %TAG directive needs a handle and a prefix.", q, finish, empty());
|
|
499
|
+
}
|
|
500
|
+
const handleFirst = item(1, starts) | 0;
|
|
501
|
+
const handleLast = item(1, ends) | 0;
|
|
502
|
+
let valid = getCharAtIndex(text, handleFirst) === "!";
|
|
503
|
+
if (valid && handleLast - handleFirst > 1) {
|
|
504
|
+
valid = getCharAtIndex(text, handleLast - 1) === "!";
|
|
505
|
+
for (let j = handleFirst + 1; j <= handleLast - 2; j++) {
|
|
506
|
+
if (!isWordChar(getCharAtIndex(text, j))) {
|
|
507
|
+
valid = false;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if (!valid) {
|
|
512
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "A tag handle is `!`, `!!` or a word between two `!`.", handleFirst, handleLast, empty());
|
|
513
|
+
}
|
|
514
|
+
const prefixFirst = item(2, starts) | 0;
|
|
515
|
+
const prefixLast = item(2, ends) | 0;
|
|
516
|
+
const firstChar = getCharAtIndex(text, prefixFirst);
|
|
517
|
+
if ((firstChar === "," ? true : firstChar === "[") ? true : firstChar === "]") {
|
|
518
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "A global tag prefix cannot start with a flow indicator.", prefixFirst, prefixFirst + 1, empty());
|
|
519
|
+
}
|
|
520
|
+
let k_1 = prefixFirst;
|
|
521
|
+
while (k_1 < prefixLast) {
|
|
522
|
+
const length = uriCharLength(text, k_1) | 0;
|
|
523
|
+
if (length === 0) {
|
|
524
|
+
fail(cursor, YamlErrorCode.InvalidDirective, "A tag prefix holds URI characters only, and a `%` has to be followed by two hexadecimal digits.", k_1, getCharAtIndex(text, k_1) === "%" ? k_1 + 3 : k_1 + 1, empty());
|
|
525
|
+
}
|
|
526
|
+
k_1 = k_1 + length | 0;
|
|
527
|
+
}
|
|
528
|
+
return [DirectiveKind_TagDirective(copyRange(text, handleFirst, handleLast), copyRange(text, item(2, starts), item(2, ends))), finish];
|
|
529
|
+
}
|
|
530
|
+
default: {
|
|
531
|
+
const words = [];
|
|
532
|
+
for (let j_1 = 1; j_1 <= starts.length - 1; j_1++) {
|
|
533
|
+
void words.push(copyRange(text, item(j_1, starts), item(j_1, ends)));
|
|
534
|
+
}
|
|
535
|
+
return [DirectiveKind_ReservedDirective(directiveName, ofSeq(words)), finish];
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function plainLine(text, from, flow) {
|
|
540
|
+
const n = text.length | 0;
|
|
541
|
+
let p = from;
|
|
542
|
+
let textEnd = from;
|
|
543
|
+
let scanning = true;
|
|
544
|
+
while (scanning && p < n) {
|
|
545
|
+
const c = getCharAtIndex(text, p);
|
|
546
|
+
if (isBreak(c)) {
|
|
547
|
+
scanning = false;
|
|
548
|
+
} else if (isBlank(c)) {
|
|
549
|
+
p = p + 1 | 0;
|
|
550
|
+
} else {
|
|
551
|
+
switch (c) {
|
|
552
|
+
case ":": {
|
|
553
|
+
if (blankOrEnd(text, p + 1) ? true : flow && isFlowIndicator(getCharAtIndex(text, p + 1))) {
|
|
554
|
+
scanning = false;
|
|
555
|
+
} else {
|
|
556
|
+
p = p + 1 | 0;
|
|
557
|
+
textEnd = p | 0;
|
|
558
|
+
}
|
|
559
|
+
break;
|
|
560
|
+
}
|
|
561
|
+
case "#": {
|
|
562
|
+
if (p > from && isBlank(getCharAtIndex(text, p - 1))) {
|
|
563
|
+
scanning = false;
|
|
564
|
+
} else {
|
|
565
|
+
p = p + 1 | 0;
|
|
566
|
+
textEnd = p | 0;
|
|
567
|
+
}
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
default:
|
|
571
|
+
if (flow && isFlowIndicator(c) ? true : !isNbChar(text, p)) {
|
|
572
|
+
scanning = false;
|
|
573
|
+
} else {
|
|
574
|
+
p = p + 1 | 0;
|
|
575
|
+
textEnd = p | 0;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return [textEnd, p];
|
|
581
|
+
}
|
|
582
|
+
function tabbedEmptyLine(text, first, finish, parentIndent) {
|
|
583
|
+
let p = first;
|
|
584
|
+
while (p < finish && getCharAtIndex(text, p) === " ") {
|
|
585
|
+
p = p + 1 | 0;
|
|
586
|
+
}
|
|
587
|
+
if (p < finish) {
|
|
588
|
+
return p - first <= parentIndent;
|
|
589
|
+
} else {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function scanPlain(ctx, cursor, start) {
|
|
594
|
+
const text = Cursor__get_Text(cursor);
|
|
595
|
+
const n = text.length | 0;
|
|
596
|
+
const flow = isFlowGrammar(ctx.Grammar);
|
|
597
|
+
const singleLine = ctx.SimpleKey ? true : isKeyGrammar(ctx.Grammar);
|
|
598
|
+
const patternInput = plainLine(text, start, flow);
|
|
599
|
+
const firstEnd = patternInput[0] | 0;
|
|
600
|
+
let textEnd = firstEnd;
|
|
601
|
+
let builder = defaultOf();
|
|
602
|
+
let stop = patternInput[1];
|
|
603
|
+
let more = !singleLine && (stop >= n ? true : isBreak(getCharAtIndex(text, stop)));
|
|
604
|
+
while (more) {
|
|
605
|
+
if (stop >= n) {
|
|
606
|
+
more = false;
|
|
607
|
+
} else {
|
|
608
|
+
let r = afterBreak(text, stop);
|
|
609
|
+
let empties = 0;
|
|
610
|
+
let contentAt = -1;
|
|
611
|
+
let looking = true;
|
|
612
|
+
while (looking) {
|
|
613
|
+
const s = skipBlanks(text, r) | 0;
|
|
614
|
+
if (s >= n) {
|
|
615
|
+
looking = false;
|
|
616
|
+
} else if (isBreak(getCharAtIndex(text, s))) {
|
|
617
|
+
if (tabbedEmptyLine(text, r, s, ctx.ParentIndent)) {
|
|
618
|
+
looking = false;
|
|
619
|
+
} else {
|
|
620
|
+
empties = empties + 1 | 0;
|
|
621
|
+
r = afterBreak(text, s) | 0;
|
|
622
|
+
}
|
|
623
|
+
} else {
|
|
624
|
+
contentAt = s | 0;
|
|
625
|
+
looking = false;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (contentAt < 0) {
|
|
629
|
+
more = false;
|
|
630
|
+
} else {
|
|
631
|
+
let spaces = r;
|
|
632
|
+
while (getCharAtIndex(text, spaces) === " ") {
|
|
633
|
+
spaces = spaces + 1 | 0;
|
|
634
|
+
}
|
|
635
|
+
const c = getCharAtIndex(text, contentAt);
|
|
636
|
+
if (((((markerAt(text, r) ? true : spaces - r <= ctx.ParentIndent && (!flow ? true : contentAt > spaces)) ? true : c === "#") ? true : !isNbChar(text, contentAt)) ? true : c === ":" && (blankOrEnd(text, contentAt + 1) ? true : flow && isFlowIndicator(getCharAtIndex(text, contentAt + 1)))) ? true : flow && isFlowIndicator(c)) {
|
|
637
|
+
more = false;
|
|
638
|
+
} else {
|
|
639
|
+
const patternInput_1 = plainLine(text, contentAt, flow);
|
|
640
|
+
const lineTextEnd = patternInput_1[0] | 0;
|
|
641
|
+
if (builder == null) {
|
|
642
|
+
builder = Cooked_$ctor();
|
|
643
|
+
Cooked__AppendRange_487EF8FB(builder, text, start, firstEnd);
|
|
644
|
+
}
|
|
645
|
+
if (empties === 0) {
|
|
646
|
+
Cooked__Mark_Z20A902D6(builder, LayoutKind_Fold(0));
|
|
647
|
+
Cooked__AppendChar_244C7CD6(builder, " ");
|
|
648
|
+
} else {
|
|
649
|
+
Cooked__AppendLineFeeds_Z524259A4(builder, empties);
|
|
650
|
+
}
|
|
651
|
+
Cooked__AppendRange_487EF8FB(builder, text, contentAt, lineTextEnd);
|
|
652
|
+
textEnd = lineTextEnd | 0;
|
|
653
|
+
stop = patternInput_1[1] | 0;
|
|
654
|
+
more = stop >= n ? true : isBreak(getCharAtIndex(text, stop));
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return [builder == null ? copyRange(text, start, firstEnd) : Cooked__get_Text(builder), textEnd, builder == null ? void 0 : Cooked__get_Layout(builder)];
|
|
660
|
+
}
|
|
661
|
+
function foldBreak(cursor, opening, p) {
|
|
662
|
+
const text = Cursor__get_Text(cursor);
|
|
663
|
+
const n = text.length | 0;
|
|
664
|
+
let r = afterBreak(text, p);
|
|
665
|
+
let empties = 0;
|
|
666
|
+
let result = -1;
|
|
667
|
+
while (result < 0) {
|
|
668
|
+
if (markerAt(text, r)) {
|
|
669
|
+
fail(cursor, YamlErrorCode.MarkerInQuote, "A document marker cannot stand inside a quoted scalar.", r, r + 3, singleton(opening));
|
|
670
|
+
}
|
|
671
|
+
const s = skipBlanks(text, r) | 0;
|
|
672
|
+
if (s >= n) {
|
|
673
|
+
result = s | 0;
|
|
674
|
+
} else if (isBreak(getCharAtIndex(text, s))) {
|
|
675
|
+
empties = empties + 1 | 0;
|
|
676
|
+
r = afterBreak(text, s) | 0;
|
|
677
|
+
} else {
|
|
678
|
+
result = s | 0;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return [empties, result];
|
|
682
|
+
}
|
|
683
|
+
function readHex(text, first, count) {
|
|
684
|
+
if (first + count > text.length) {
|
|
685
|
+
return -1;
|
|
686
|
+
} else {
|
|
687
|
+
let value = 0;
|
|
688
|
+
let valid = true;
|
|
689
|
+
for (let k = first; k <= first + count - 1; k++) {
|
|
690
|
+
const digit = hexValue(getCharAtIndex(text, k)) | 0;
|
|
691
|
+
if (digit < 0) {
|
|
692
|
+
valid = false;
|
|
693
|
+
} else {
|
|
694
|
+
value = value * 16 + digit | 0;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (valid) {
|
|
698
|
+
return value | 0;
|
|
699
|
+
} else {
|
|
700
|
+
return -1;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function scanEscape(cursor, opening, sb, p, singleLine) {
|
|
705
|
+
const text = Cursor__get_Text(cursor);
|
|
706
|
+
const n = text.length | 0;
|
|
707
|
+
if (p + 1 >= n) {
|
|
708
|
+
throw new LexFailure(new YamlError(YamlErrorCode.UnclosedQuote, toText(printf("The quoted scalar that starts on line %d is not closed."))(opening.Start.Line), opening, empty()));
|
|
709
|
+
}
|
|
710
|
+
const e = getCharAtIndex(text, p + 1);
|
|
711
|
+
switch (e) {
|
|
712
|
+
case " ": {
|
|
713
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
714
|
+
return p + 2 | 0;
|
|
715
|
+
}
|
|
716
|
+
case "\n":
|
|
717
|
+
case "\r": {
|
|
718
|
+
if (singleLine) {
|
|
719
|
+
fail(cursor, YamlErrorCode.ImplicitKeyMultiline, "An implicit key has to stay on one line.", p, p + 2, empty());
|
|
720
|
+
}
|
|
721
|
+
const patternInput = foldBreak(cursor, opening, p + 1);
|
|
722
|
+
const empties = patternInput[0] | 0;
|
|
723
|
+
Cooked__Mark_Z20A902D6(sb, LayoutKind_EscapedBreak(empties));
|
|
724
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, empties);
|
|
725
|
+
return patternInput[1] | 0;
|
|
726
|
+
}
|
|
727
|
+
case " ": {
|
|
728
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
729
|
+
return p + 2 | 0;
|
|
730
|
+
}
|
|
731
|
+
case '"': {
|
|
732
|
+
Cooked__AppendChar_244C7CD6(sb, '"');
|
|
733
|
+
return p + 2 | 0;
|
|
734
|
+
}
|
|
735
|
+
case "/": {
|
|
736
|
+
Cooked__AppendChar_244C7CD6(sb, "/");
|
|
737
|
+
return p + 2 | 0;
|
|
738
|
+
}
|
|
739
|
+
case "0": {
|
|
740
|
+
Cooked__AppendChar_244C7CD6(sb, "\0");
|
|
741
|
+
return p + 2 | 0;
|
|
742
|
+
}
|
|
743
|
+
case "L": {
|
|
744
|
+
Cooked__AppendChar_244C7CD6(sb, "\u2028");
|
|
745
|
+
return p + 2 | 0;
|
|
746
|
+
}
|
|
747
|
+
case "N": {
|
|
748
|
+
Cooked__AppendChar_244C7CD6(sb, "
");
|
|
749
|
+
return p + 2 | 0;
|
|
750
|
+
}
|
|
751
|
+
case "P": {
|
|
752
|
+
Cooked__AppendChar_244C7CD6(sb, "\u2029");
|
|
753
|
+
return p + 2 | 0;
|
|
754
|
+
}
|
|
755
|
+
case "U": {
|
|
756
|
+
const value_2 = readHex(text, p + 2, 8) | 0;
|
|
757
|
+
if (value_2 < 0) {
|
|
758
|
+
fail(cursor, YamlErrorCode.InvalidEscape, "The escape \\U needs eight hexadecimal digits.", p, min(n, p + 10), singleton(opening));
|
|
759
|
+
}
|
|
760
|
+
if (value_2 > 1114111 ? true : value_2 >= 55296 && value_2 <= 57343) {
|
|
761
|
+
fail(cursor, YamlErrorCode.InvalidEscape, "The escape \\U does not name a Unicode scalar value.", p, p + 10, singleton(opening));
|
|
762
|
+
}
|
|
763
|
+
Cooked__AppendCodePoint_Z524259A4(sb, value_2);
|
|
764
|
+
return p + 10 | 0;
|
|
765
|
+
}
|
|
766
|
+
case "\\": {
|
|
767
|
+
Cooked__AppendChar_244C7CD6(sb, "\\");
|
|
768
|
+
return p + 2 | 0;
|
|
769
|
+
}
|
|
770
|
+
case "_": {
|
|
771
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
772
|
+
return p + 2 | 0;
|
|
773
|
+
}
|
|
774
|
+
case "a": {
|
|
775
|
+
Cooked__AppendChar_244C7CD6(sb, "\x07");
|
|
776
|
+
return p + 2 | 0;
|
|
777
|
+
}
|
|
778
|
+
case "b": {
|
|
779
|
+
Cooked__AppendChar_244C7CD6(sb, "\b");
|
|
780
|
+
return p + 2 | 0;
|
|
781
|
+
}
|
|
782
|
+
case "e": {
|
|
783
|
+
Cooked__AppendChar_244C7CD6(sb, "\x1B");
|
|
784
|
+
return p + 2 | 0;
|
|
785
|
+
}
|
|
786
|
+
case "f": {
|
|
787
|
+
Cooked__AppendChar_244C7CD6(sb, "\f");
|
|
788
|
+
return p + 2 | 0;
|
|
789
|
+
}
|
|
790
|
+
case "n": {
|
|
791
|
+
Cooked__AppendChar_244C7CD6(sb, "\n");
|
|
792
|
+
return p + 2 | 0;
|
|
793
|
+
}
|
|
794
|
+
case "r": {
|
|
795
|
+
Cooked__AppendChar_244C7CD6(sb, "\r");
|
|
796
|
+
return p + 2 | 0;
|
|
797
|
+
}
|
|
798
|
+
case "t": {
|
|
799
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
800
|
+
return p + 2 | 0;
|
|
801
|
+
}
|
|
802
|
+
case "u": {
|
|
803
|
+
const value_1 = readHex(text, p + 2, 4) | 0;
|
|
804
|
+
if (value_1 < 0) {
|
|
805
|
+
fail(cursor, YamlErrorCode.InvalidEscape, "The escape \\u needs four hexadecimal digits.", p, min(n, p + 6), singleton(opening));
|
|
806
|
+
}
|
|
807
|
+
const low = (value_1 >= 55296 && value_1 <= 56319 && p + 11 < n && getCharAtIndex(text, p + 6) === "\\" && getCharAtIndex(text, p + 7) === "u" ? readHex(text, p + 8, 4) : -1) | 0;
|
|
808
|
+
if (low >= 56320 && low <= 57343) {
|
|
809
|
+
Cooked__AppendCodePoint_Z524259A4(sb, 65536 + (value_1 - 55296) * 1024 + (low - 56320));
|
|
810
|
+
return p + 12 | 0;
|
|
811
|
+
} else if (value_1 >= 55296 && value_1 <= 57343) {
|
|
812
|
+
return fail(cursor, YamlErrorCode.InvalidEscape, "The escape \\u names a surrogate that no second escape completes to a character.", p, p + 6, singleton(opening)) | 0;
|
|
813
|
+
} else {
|
|
814
|
+
Cooked__AppendChar_244C7CD6(sb, String.fromCharCode(~~value_1 & 65535));
|
|
815
|
+
return p + 6 | 0;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
case "v": {
|
|
819
|
+
Cooked__AppendChar_244C7CD6(sb, "\v");
|
|
820
|
+
return p + 2 | 0;
|
|
821
|
+
}
|
|
822
|
+
case "x": {
|
|
823
|
+
const value = readHex(text, p + 2, 2) | 0;
|
|
824
|
+
if (value < 0) {
|
|
825
|
+
fail(cursor, YamlErrorCode.InvalidEscape, "The escape \\x needs two hexadecimal digits.", p, min(n, p + 4), singleton(opening));
|
|
826
|
+
}
|
|
827
|
+
Cooked__AppendChar_244C7CD6(sb, String.fromCharCode(~~value & 65535));
|
|
828
|
+
return p + 4 | 0;
|
|
829
|
+
}
|
|
830
|
+
default:
|
|
831
|
+
return fail(cursor, YamlErrorCode.InvalidEscape, "The backslash starts an escape that YAML does not define.", p, p + 2, singleton(opening)) | 0;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
function scanQuoted(ctx, cursor, q) {
|
|
835
|
+
const text = Cursor__get_Text(cursor);
|
|
836
|
+
const n = text.length | 0;
|
|
837
|
+
const quote = getCharAtIndex(text, q);
|
|
838
|
+
const isDouble = quote === '"';
|
|
839
|
+
const opening = Cursor__SpanOf_Z37302880(cursor, q, q + 1);
|
|
840
|
+
const singleLine = ctx.SimpleKey ? true : isKeyGrammar(ctx.Grammar);
|
|
841
|
+
const sb = Cooked_$ctor();
|
|
842
|
+
let p = q + 1;
|
|
843
|
+
let runStart = p;
|
|
844
|
+
let closed = false;
|
|
845
|
+
while (!closed) {
|
|
846
|
+
if (p >= n) {
|
|
847
|
+
fail(cursor, YamlErrorCode.UnclosedQuote, toText(printf("The quoted scalar that starts on line %d is not closed."))(opening.Start.Line), q, q + 1, empty());
|
|
848
|
+
}
|
|
849
|
+
const c = getCharAtIndex(text, p);
|
|
850
|
+
if (c === quote) {
|
|
851
|
+
if (!isDouble && p + 1 < n && getCharAtIndex(text, p + 1) === "'") {
|
|
852
|
+
Cooked__AppendRange_487EF8FB(sb, text, runStart, p);
|
|
853
|
+
Cooked__AppendChar_244C7CD6(sb, "'");
|
|
854
|
+
p = p + 2 | 0;
|
|
855
|
+
runStart = p | 0;
|
|
856
|
+
} else {
|
|
857
|
+
Cooked__AppendRange_487EF8FB(sb, text, runStart, p);
|
|
858
|
+
closed = true;
|
|
859
|
+
}
|
|
860
|
+
} else if (isDouble && c === "\\") {
|
|
861
|
+
Cooked__AppendRange_487EF8FB(sb, text, runStart, p);
|
|
862
|
+
p = scanEscape(cursor, opening, sb, p, singleLine) | 0;
|
|
863
|
+
runStart = p | 0;
|
|
864
|
+
} else if (isBlank(c)) {
|
|
865
|
+
const r = skipBlanks(text, p) | 0;
|
|
866
|
+
if (r < n && isBreak(getCharAtIndex(text, r))) {
|
|
867
|
+
Cooked__AppendRange_487EF8FB(sb, text, runStart, p);
|
|
868
|
+
p = r | 0;
|
|
869
|
+
runStart = r | 0;
|
|
870
|
+
} else {
|
|
871
|
+
p = r | 0;
|
|
872
|
+
}
|
|
873
|
+
} else if (isBreak(c)) {
|
|
874
|
+
if (singleLine) {
|
|
875
|
+
fail(cursor, YamlErrorCode.ImplicitKeyMultiline, "An implicit key has to stay on one line.", q, p, empty());
|
|
876
|
+
}
|
|
877
|
+
Cooked__AppendRange_487EF8FB(sb, text, runStart, p);
|
|
878
|
+
const patternInput = foldBreak(cursor, opening, p);
|
|
879
|
+
const next_1 = patternInput[1] | 0;
|
|
880
|
+
const empties = patternInput[0] | 0;
|
|
881
|
+
if (empties === 0) {
|
|
882
|
+
Cooked__Mark_Z20A902D6(sb, LayoutKind_Fold(0));
|
|
883
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
884
|
+
} else {
|
|
885
|
+
if (isDouble) {
|
|
886
|
+
Cooked__Mark_Z20A902D6(sb, LayoutKind_Fold(empties));
|
|
887
|
+
}
|
|
888
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, empties);
|
|
889
|
+
}
|
|
890
|
+
p = next_1 | 0;
|
|
891
|
+
runStart = next_1 | 0;
|
|
892
|
+
} else if (isJsonChar(text, p)) {
|
|
893
|
+
p = p + 1 | 0;
|
|
894
|
+
} else {
|
|
895
|
+
failChar(cursor, p);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
return [Cooked__get_Text(sb), p, Cooked__get_Layout(sb)];
|
|
899
|
+
}
|
|
900
|
+
function scanBlockScalar(ctx, cursor, q) {
|
|
901
|
+
let arg = void 0, arg_1 = void 0;
|
|
902
|
+
const text = Cursor__get_Text(cursor);
|
|
903
|
+
const n = text.length | 0;
|
|
904
|
+
const literal = getCharAtIndex(text, q) === "|";
|
|
905
|
+
let p = q + 1;
|
|
906
|
+
let chomping = ChompingMode.Clip;
|
|
907
|
+
let chompingSet = false;
|
|
908
|
+
let digit = 0;
|
|
909
|
+
let inHeader = true;
|
|
910
|
+
while (inHeader && p < n) {
|
|
911
|
+
const c = getCharAtIndex(text, p);
|
|
912
|
+
if (c >= "1" && c <= "9") {
|
|
913
|
+
if (digit !== 0) {
|
|
914
|
+
fail(cursor, YamlErrorCode.InvalidBlockHeader, "A block scalar header holds one indentation digit.", p, p + 1, empty());
|
|
915
|
+
}
|
|
916
|
+
digit = ~~c.charCodeAt(0) - ~~"0".charCodeAt(0) | 0;
|
|
917
|
+
p = p + 1 | 0;
|
|
918
|
+
} else if (c === "-" ? true : c === "+") {
|
|
919
|
+
if (chompingSet) {
|
|
920
|
+
fail(cursor, YamlErrorCode.InvalidBlockHeader, "A block scalar header holds one chomping sign.", p, p + 1, empty());
|
|
921
|
+
}
|
|
922
|
+
chompingSet = true;
|
|
923
|
+
chomping = c === "-" ? ChompingMode.Strip : ChompingMode.Keep;
|
|
924
|
+
p = p + 1 | 0;
|
|
925
|
+
} else {
|
|
926
|
+
inHeader = false;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
const headerEnd = p | 0;
|
|
930
|
+
const afterBlanks = skipBlanks(text, p) | 0;
|
|
931
|
+
let commentEnd = -1;
|
|
932
|
+
let headerLineEnd = afterBlanks;
|
|
933
|
+
if (afterBlanks < n && !isBreak(getCharAtIndex(text, afterBlanks))) {
|
|
934
|
+
if (getCharAtIndex(text, afterBlanks) === "#") {
|
|
935
|
+
if (afterBlanks === headerEnd) {
|
|
936
|
+
fail(cursor, YamlErrorCode.GluedComment, "A comment needs a space or a tab before the #.", afterBlanks, afterBlanks + 1, empty());
|
|
937
|
+
}
|
|
938
|
+
commentEnd = commentLineEnd(cursor, afterBlanks) | 0;
|
|
939
|
+
headerLineEnd = commentEnd | 0;
|
|
940
|
+
} else {
|
|
941
|
+
let bad = afterBlanks;
|
|
942
|
+
while (bad < n && !isBlank(getCharAtIndex(text, bad)) && !isBreak(getCharAtIndex(text, bad))) {
|
|
943
|
+
bad = bad + 1 | 0;
|
|
944
|
+
}
|
|
945
|
+
fail(cursor, YamlErrorCode.InvalidBlockHeader, "A block scalar header allows only an indentation digit and a chomping sign behind the indicator.", q, bad, empty());
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
const bodyStart = (headerLineEnd >= n ? n : afterBreak(text, headerLineEnd)) | 0;
|
|
949
|
+
const headerMark = Cursor__MarkAt_Z524259A4(cursor, headerEnd);
|
|
950
|
+
const headerComment = commentEnd < 0 ? void 0 : new YamlComment(copyRange(text, afterBlanks + 1, commentEnd), Cursor__SpanOf_Z37302880(cursor, afterBlanks, commentEnd));
|
|
951
|
+
let indent = 0;
|
|
952
|
+
if (digit > 0) {
|
|
953
|
+
indent = (ctx.ParentIndent < 0 ? 0 : ctx.ParentIndent) + digit | 0;
|
|
954
|
+
} else {
|
|
955
|
+
let r = bodyStart;
|
|
956
|
+
let longestEmpty = 0;
|
|
957
|
+
let firstSpaces = -1;
|
|
958
|
+
let seeking = true;
|
|
959
|
+
while (seeking && r < n) {
|
|
960
|
+
const le = lineEnd(text, r) | 0;
|
|
961
|
+
let spaces = r;
|
|
962
|
+
while (spaces < le && getCharAtIndex(text, spaces) === " ") {
|
|
963
|
+
spaces = spaces + 1 | 0;
|
|
964
|
+
}
|
|
965
|
+
if (spaces === le) {
|
|
966
|
+
if (le - r > longestEmpty) {
|
|
967
|
+
longestEmpty = le - r | 0;
|
|
968
|
+
}
|
|
969
|
+
r = (le >= n ? n : afterBreak(text, le)) | 0;
|
|
970
|
+
} else if ((markerAt(text, r) ? true : getCharAtIndex(text, r) === "\uFEFF") ? true : spaces - r <= ctx.ParentIndent) {
|
|
971
|
+
seeking = false;
|
|
972
|
+
} else {
|
|
973
|
+
firstSpaces = spaces - r | 0;
|
|
974
|
+
seeking = false;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
indent = max(ctx.ParentIndent + 1, firstSpaces >= 0 ? firstSpaces : longestEmpty) | 0;
|
|
978
|
+
if (firstSpaces >= 0 && longestEmpty > indent) {
|
|
979
|
+
fail(cursor, YamlErrorCode.LeadingEmptyLine, (arg = longestEmpty | 0, arg_1 = indent | 0, toText(printf("A line of spaces in front of the first content line of a block scalar has %d spaces, more than the %d spaces of the content."))(arg)(arg_1)), bodyStart, r, empty());
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
const sb = Cooked_$ctor();
|
|
983
|
+
let r_1 = bodyStart;
|
|
984
|
+
let hasContent = false;
|
|
985
|
+
let empties = 0;
|
|
986
|
+
let previousMoreIndented = false;
|
|
987
|
+
let lastContentEnd = headerEnd;
|
|
988
|
+
let afterContent = bodyStart;
|
|
989
|
+
let reading = true;
|
|
990
|
+
while (reading && r_1 < n) {
|
|
991
|
+
const le_1 = lineEnd(text, r_1) | 0;
|
|
992
|
+
let spaces_1 = r_1;
|
|
993
|
+
while (spaces_1 < le_1 && getCharAtIndex(text, spaces_1) === " ") {
|
|
994
|
+
spaces_1 = spaces_1 + 1 | 0;
|
|
995
|
+
}
|
|
996
|
+
const onlySpaces = spaces_1 === le_1;
|
|
997
|
+
if (markerAt(text, r_1) ? true : getCharAtIndex(text, r_1) === "\uFEFF") {
|
|
998
|
+
reading = false;
|
|
999
|
+
} else if (!onlySpaces && spaces_1 - r_1 < indent) {
|
|
1000
|
+
const blanksEnd = skipBlanks(text, spaces_1) | 0;
|
|
1001
|
+
const tabLine = getCharAtIndex(text, spaces_1) !== "#" && (blanksEnd >= le_1 ? true : getCharAtIndex(text, blanksEnd) === "#");
|
|
1002
|
+
if (getCharAtIndex(text, spaces_1) !== "#" && !tabLine && spaces_1 - r_1 > ctx.ParentIndent) {
|
|
1003
|
+
fail(cursor, YamlErrorCode.BlockIndent, "A line that is more indented than the node of a block scalar, but not enough to continue the scalar, is invalid.", spaces_1, spaces_1 + 1, empty());
|
|
1004
|
+
}
|
|
1005
|
+
if (tabLine && ctx.ParentIndent >= 0) {
|
|
1006
|
+
fail(cursor, YamlErrorCode.BlockIndent, "A line of blanks with a tab, with or without a comment, cannot follow a block scalar below the root.", spaces_1, spaces_1 + 1, empty());
|
|
1007
|
+
}
|
|
1008
|
+
reading = false;
|
|
1009
|
+
} else {
|
|
1010
|
+
if (onlySpaces && le_1 - r_1 <= indent) {
|
|
1011
|
+
if (le_1 < n) {
|
|
1012
|
+
empties = empties + 1 | 0;
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
const first = r_1 + indent | 0;
|
|
1016
|
+
checkNbChars(cursor, first, le_1);
|
|
1017
|
+
const moreIndented = first < le_1 && (getCharAtIndex(text, first) === " " ? true : getCharAtIndex(text, first) === " ");
|
|
1018
|
+
if (literal) {
|
|
1019
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, hasContent ? empties + 1 : empties);
|
|
1020
|
+
} else if (!hasContent) {
|
|
1021
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, empties);
|
|
1022
|
+
} else if (previousMoreIndented ? true : moreIndented) {
|
|
1023
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, empties + 1);
|
|
1024
|
+
} else if (empties === 0) {
|
|
1025
|
+
Cooked__Mark_Z20A902D6(sb, LayoutKind_Fold(0));
|
|
1026
|
+
Cooked__AppendChar_244C7CD6(sb, " ");
|
|
1027
|
+
} else {
|
|
1028
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, empties);
|
|
1029
|
+
}
|
|
1030
|
+
Cooked__AppendRange_487EF8FB(sb, text, first, le_1);
|
|
1031
|
+
hasContent = true;
|
|
1032
|
+
previousMoreIndented = moreIndented;
|
|
1033
|
+
lastContentEnd = le_1 | 0;
|
|
1034
|
+
afterContent = (le_1 >= n ? n : afterBreak(text, le_1)) | 0;
|
|
1035
|
+
empties = 0;
|
|
1036
|
+
}
|
|
1037
|
+
r_1 = (le_1 >= n ? n : afterBreak(text, le_1)) | 0;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
const lastLineBroken = lastContentEnd < n;
|
|
1041
|
+
Cooked__AppendLineFeeds_Z524259A4(sb, chomping.tag === /* Clip */
|
|
1042
|
+
1 ? hasContent && lastLineBroken ? 1 : 0 : chomping.tag === /* Keep */
|
|
1043
|
+
2 ? hasContent ? lastLineBroken ? empties + 1 : 0 : empties : 0);
|
|
1044
|
+
const finishMark = hasContent ? Cursor__MarkAt_Z524259A4(cursor, lastContentEnd) : headerMark;
|
|
1045
|
+
Cursor__set_Index_Z524259A4(cursor, equals(chomping, ChompingMode.Keep) ? r_1 : afterContent);
|
|
1046
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, true);
|
|
1047
|
+
const style = literal ? BlockScalarStyle.Literal : BlockScalarStyle.Folded;
|
|
1048
|
+
const indicator = digit > 0 ? digit : void 0;
|
|
1049
|
+
return [new YamlScalar(Cooked__get_Text(sb), ScalarStyle_Block(style, chomping, indicator), headerComment, literal ? void 0 : Cooked__get_Layout(sb)), finishMark];
|
|
1050
|
+
}
|
|
1051
|
+
function located(cursor, start, finish, lexeme) {
|
|
1052
|
+
return new Located$1(lexeme, new SourceSpan(start, Cursor__MarkAt_Z524259A4(cursor, finish)));
|
|
1053
|
+
}
|
|
1054
|
+
function single(cursor, q, start, lexeme) {
|
|
1055
|
+
Cursor__set_Index_Z524259A4(cursor, q + 1);
|
|
1056
|
+
return located(cursor, start, q + 1, lexeme);
|
|
1057
|
+
}
|
|
1058
|
+
function checkIndicatorTab(cursor, q, tab, separation) {
|
|
1059
|
+
if (Cursor__get_FirstOnLine(cursor) && Cursor__get_LeadingTab(cursor)) {
|
|
1060
|
+
let lineBegin_1 = q;
|
|
1061
|
+
while (lineBegin_1 > Cursor__get_Origin(cursor) && !isBreak(getCharAtIndex(Cursor__get_Text(cursor), lineBegin_1 - 1))) {
|
|
1062
|
+
lineBegin_1 = lineBegin_1 - 1 | 0;
|
|
1063
|
+
}
|
|
1064
|
+
fail(cursor, YamlErrorCode.TabIndentation, "A tab cannot be part of the indentation of a line.", lineBegin_1, q, empty());
|
|
1065
|
+
} else if (tab && Cursor__get_AfterIndicator(cursor)) {
|
|
1066
|
+
fail(cursor, YamlErrorCode.TabIndentation, "A tab cannot separate a block collection from the indicator in front of it.", separation, q, empty());
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
function scanToken(ctx, cursor, q, separation, tab) {
|
|
1070
|
+
const text = Cursor__get_Text(cursor);
|
|
1071
|
+
const n = text.length | 0;
|
|
1072
|
+
const c = getCharAtIndex(text, q);
|
|
1073
|
+
const flow = isFlowGrammar(ctx.Grammar);
|
|
1074
|
+
const start = Cursor__MarkAt_Z524259A4(cursor, q);
|
|
1075
|
+
if ((c === "-" ? true : c === ".") && q + 2 < n && getCharAtIndex(text, q + 1) === c && getCharAtIndex(text, q + 2) === c && blankOrEnd(text, q + 3) && atLineStart(cursor, q)) {
|
|
1076
|
+
Cursor__set_Index_Z524259A4(cursor, q + 3);
|
|
1077
|
+
return located(cursor, start, q + 3, c === "-" ? Lexeme.DocumentStart : Lexeme.DocumentEnd);
|
|
1078
|
+
} else if (c === "-" && (blankOrEnd(text, q + 1) ? true : flow && isFlowIndicator(getCharAtIndex(text, q + 1)))) {
|
|
1079
|
+
if (flow) {
|
|
1080
|
+
fail(cursor, YamlErrorCode.FlowDash, "Inside a flow collection a `-` needs a plain character behind it.", q, q + 1, empty());
|
|
1081
|
+
}
|
|
1082
|
+
checkIndicatorTab(cursor, q, tab, separation);
|
|
1083
|
+
return single(cursor, q, start, Lexeme.BlockEntry);
|
|
1084
|
+
} else if (c === "?" && blankOrEnd(text, q + 1)) {
|
|
1085
|
+
if (!flow) {
|
|
1086
|
+
checkIndicatorTab(cursor, q, tab, separation);
|
|
1087
|
+
}
|
|
1088
|
+
return single(cursor, q, start, Lexeme.ExplicitKey);
|
|
1089
|
+
} else if (c === "?" && flow && isFlowIndicator(getCharAtIndex(text, q + 1))) {
|
|
1090
|
+
return fail(cursor, YamlErrorCode.ReservedIndicator, "A `?` in front of a flow indicator starts no explicit key and no plain scalar.", q, q + 1, empty());
|
|
1091
|
+
} else if (c === ":" && (blankOrEnd(text, q + 1) ? true : flow && (isFlowIndicator(getCharAtIndex(text, q + 1)) ? true : Cursor__get_JsonLike(cursor)))) {
|
|
1092
|
+
if (!flow) {
|
|
1093
|
+
checkIndicatorTab(cursor, q, tab, separation);
|
|
1094
|
+
}
|
|
1095
|
+
return single(cursor, q, start, Lexeme.Value);
|
|
1096
|
+
} else {
|
|
1097
|
+
switch (c) {
|
|
1098
|
+
case ",": {
|
|
1099
|
+
if (!flow) {
|
|
1100
|
+
fail(cursor, YamlErrorCode.ReservedIndicator, "A plain scalar cannot start with a `,`.", q, q + 1, empty());
|
|
1101
|
+
}
|
|
1102
|
+
return single(cursor, q, start, Lexeme.FlowEntry);
|
|
1103
|
+
}
|
|
1104
|
+
case "[":
|
|
1105
|
+
return single(cursor, q, start, Lexeme.FlowSequenceStart);
|
|
1106
|
+
case "{":
|
|
1107
|
+
return single(cursor, q, start, Lexeme.FlowMappingStart);
|
|
1108
|
+
default:
|
|
1109
|
+
if (c === "]" ? true : c === "}") {
|
|
1110
|
+
if (!flow) {
|
|
1111
|
+
fail(cursor, YamlErrorCode.UnopenedFlow, toText(printf("A `%c` closes no flow collection."))(c), q, q + 1, empty());
|
|
1112
|
+
}
|
|
1113
|
+
Cursor__set_JsonLikeEnd_Z524259A4(cursor, q + 1);
|
|
1114
|
+
return single(cursor, q, start, c === "]" ? Lexeme.FlowSequenceEnd : Lexeme.FlowMappingEnd);
|
|
1115
|
+
} else {
|
|
1116
|
+
switch (c) {
|
|
1117
|
+
case "&": {
|
|
1118
|
+
const finish = nameEnd(cursor, q + 1) | 0;
|
|
1119
|
+
if (finish === q + 1) {
|
|
1120
|
+
fail(cursor, YamlErrorCode.EmptyAnchor, "An anchor needs a name behind the `&`.", q, q + 1, empty());
|
|
1121
|
+
}
|
|
1122
|
+
Cursor__set_Index_Z524259A4(cursor, finish);
|
|
1123
|
+
return located(cursor, start, finish, Lexeme_Anchor(copyRange(text, q + 1, finish)));
|
|
1124
|
+
}
|
|
1125
|
+
case "*": {
|
|
1126
|
+
const finish_1 = nameEnd(cursor, q + 1) | 0;
|
|
1127
|
+
if (finish_1 === q + 1) {
|
|
1128
|
+
fail(cursor, YamlErrorCode.EmptyAlias, "An alias needs a name behind the `*`.", q, q + 1, empty());
|
|
1129
|
+
}
|
|
1130
|
+
Cursor__set_Index_Z524259A4(cursor, finish_1);
|
|
1131
|
+
return located(cursor, start, finish_1, Lexeme_Alias(copyRange(text, q + 1, finish_1)));
|
|
1132
|
+
}
|
|
1133
|
+
case "!": {
|
|
1134
|
+
const patternInput = scanTag(cursor, q);
|
|
1135
|
+
const finish_2 = patternInput[1] | 0;
|
|
1136
|
+
Cursor__set_Index_Z524259A4(cursor, finish_2);
|
|
1137
|
+
return located(cursor, start, finish_2, Lexeme_Tag(patternInput[0]));
|
|
1138
|
+
}
|
|
1139
|
+
default:
|
|
1140
|
+
if (c === "|" ? true : c === ">") {
|
|
1141
|
+
if (flow ? true : equals(ctx.Grammar, GrammarContext.BlockKey)) {
|
|
1142
|
+
fail(cursor, YamlErrorCode.BlockScalarPosition, "A block scalar cannot start inside a flow collection or as an implicit key.", q, q + 1, empty());
|
|
1143
|
+
}
|
|
1144
|
+
const patternInput_1 = scanBlockScalar(ctx, cursor, q);
|
|
1145
|
+
return new Located$1(Lexeme_Scalar(patternInput_1[0]), new SourceSpan(start, patternInput_1[1]));
|
|
1146
|
+
} else if (c === "'" ? true : c === '"') {
|
|
1147
|
+
const patternInput_2 = scanQuoted(ctx, cursor, q);
|
|
1148
|
+
const closing = patternInput_2[1] | 0;
|
|
1149
|
+
Cursor__set_Index_Z524259A4(cursor, closing + 1);
|
|
1150
|
+
Cursor__set_JsonLikeEnd_Z524259A4(cursor, closing + 1);
|
|
1151
|
+
const finish_3 = Cursor__MarkAt_Z524259A4(cursor, closing + 1);
|
|
1152
|
+
if ((ctx.SimpleKey ? true : isKeyGrammar(ctx.Grammar)) && finish_3.Column - start.Column > 1024) {
|
|
1153
|
+
fail(cursor, YamlErrorCode.ImplicitKeyLength, "An implicit key can have at most 1024 characters.", q, closing + 1, empty());
|
|
1154
|
+
}
|
|
1155
|
+
return new Located$1(Lexeme_Scalar(new YamlScalar(patternInput_2[0], c === '"' ? ScalarStyle.DoubleQuoted : ScalarStyle.SingleQuoted, void 0, patternInput_2[2])), new SourceSpan(start, finish_3));
|
|
1156
|
+
} else if (c === "%") {
|
|
1157
|
+
if (atLineStart(cursor, q) && Cursor__get_InPrelude(cursor)) {
|
|
1158
|
+
const patternInput_3 = scanDirective(cursor, q);
|
|
1159
|
+
const finish_4 = patternInput_3[1] | 0;
|
|
1160
|
+
Cursor__set_Index_Z524259A4(cursor, finish_4);
|
|
1161
|
+
return located(cursor, start, finish_4, Lexeme_Directive(patternInput_3[0]));
|
|
1162
|
+
} else {
|
|
1163
|
+
return fail(cursor, YamlErrorCode.ReservedIndicator, "A plain scalar cannot start with a `%`.", q, q + 1, empty());
|
|
1164
|
+
}
|
|
1165
|
+
} else if (c === "@" ? true : c === "`") {
|
|
1166
|
+
return fail(cursor, YamlErrorCode.ReservedIndicator, toText(printf("A plain scalar cannot start with a `%c`."))(c), q, q + 1, empty());
|
|
1167
|
+
} else {
|
|
1168
|
+
switch (c) {
|
|
1169
|
+
case "#":
|
|
1170
|
+
if (q === Cursor__get_JsonLikeEnd(cursor)) {
|
|
1171
|
+
return fail(cursor, YamlErrorCode.GluedComment, "A comment needs a space or a tab before the #.", q, q + 1, empty());
|
|
1172
|
+
} else {
|
|
1173
|
+
return fail(cursor, YamlErrorCode.ReservedIndicator, "A plain scalar cannot start with a `#`.", q, q + 1, empty());
|
|
1174
|
+
}
|
|
1175
|
+
case "\uFEFF":
|
|
1176
|
+
return failBom(cursor, q);
|
|
1177
|
+
default:
|
|
1178
|
+
if (!isNbChar(text, q)) {
|
|
1179
|
+
return failChar(cursor, q);
|
|
1180
|
+
} else {
|
|
1181
|
+
const patternInput_4 = scanPlain(ctx, cursor, q);
|
|
1182
|
+
const finish_5 = patternInput_4[1] | 0;
|
|
1183
|
+
Cursor__set_Index_Z524259A4(cursor, finish_5);
|
|
1184
|
+
const finishMark_1 = Cursor__MarkAt_Z524259A4(cursor, finish_5);
|
|
1185
|
+
if ((ctx.SimpleKey ? true : isKeyGrammar(ctx.Grammar)) && finishMark_1.Column - start.Column > 1024) {
|
|
1186
|
+
fail(cursor, YamlErrorCode.ImplicitKeyLength, "An implicit key can have at most 1024 characters.", q, finish_5, empty());
|
|
1187
|
+
}
|
|
1188
|
+
return new Located$1(Lexeme_Scalar(new YamlScalar(patternInput_4[0], ScalarStyle.Plain, void 0, patternInput_4[2])), new SourceSpan(start, finishMark_1));
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
function lineContent(ctx, cursor) {
|
|
1198
|
+
const text = Cursor__get_Text(cursor);
|
|
1199
|
+
const n = text.length | 0;
|
|
1200
|
+
const i = Cursor__get_Index(cursor) | 0;
|
|
1201
|
+
let q = i;
|
|
1202
|
+
let tabbed = false;
|
|
1203
|
+
while (q < n && isBlank(getCharAtIndex(text, q))) {
|
|
1204
|
+
if (getCharAtIndex(text, q) === " ") {
|
|
1205
|
+
tabbed = true;
|
|
1206
|
+
}
|
|
1207
|
+
q = q + 1 | 0;
|
|
1208
|
+
}
|
|
1209
|
+
let spaces = i;
|
|
1210
|
+
while (spaces < q && getCharAtIndex(text, spaces) === " ") {
|
|
1211
|
+
spaces = spaces + 1 | 0;
|
|
1212
|
+
}
|
|
1213
|
+
const indent = spaces - i | 0;
|
|
1214
|
+
const start = Cursor__MarkAt_Z524259A4(cursor, i);
|
|
1215
|
+
if (q >= n) {
|
|
1216
|
+
Cursor__set_Index_Z524259A4(cursor, q);
|
|
1217
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, false);
|
|
1218
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, false);
|
|
1219
|
+
return located(cursor, start, q, Lexeme.BlankLine);
|
|
1220
|
+
} else if (isBreak(getCharAtIndex(text, q))) {
|
|
1221
|
+
const lexeme = located(cursor, start, q, Lexeme.BlankLine);
|
|
1222
|
+
Cursor__set_Index_Z524259A4(cursor, afterBreak(text, q));
|
|
1223
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, false);
|
|
1224
|
+
return lexeme;
|
|
1225
|
+
} else if (getCharAtIndex(text, q) === "#") {
|
|
1226
|
+
const finish = commentLineEnd(cursor, q) | 0;
|
|
1227
|
+
const span = Cursor__SpanOf_Z37302880(cursor, q, finish);
|
|
1228
|
+
Cursor__set_Index_Z524259A4(cursor, finish);
|
|
1229
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, false);
|
|
1230
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, tabbed);
|
|
1231
|
+
return new Located$1(Lexeme_Comment$(new YamlComment(copyRange(text, q + 1, finish), span), true), span);
|
|
1232
|
+
} else if (isFlowGrammar(ctx.Grammar)) {
|
|
1233
|
+
if (i === q && markerAt(text, i)) {
|
|
1234
|
+
fail(cursor, YamlErrorCode.MarkerInFlow, "A document marker cannot stand inside a flow collection.", i, i + 3, empty());
|
|
1235
|
+
}
|
|
1236
|
+
Cursor__set_Index_Z524259A4(cursor, q);
|
|
1237
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, false);
|
|
1238
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, false);
|
|
1239
|
+
return void 0;
|
|
1240
|
+
} else {
|
|
1241
|
+
Cursor__set_Index_Z524259A4(cursor, q);
|
|
1242
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, false);
|
|
1243
|
+
Cursor__set_LeadingTab_Z1FBCCD16(cursor, tabbed);
|
|
1244
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, tabbed);
|
|
1245
|
+
return located(cursor, start, q, Lexeme_LineStart(indent, tabbed));
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
function lineBegin(ctx, cursor) {
|
|
1249
|
+
const text = Cursor__get_Text(cursor);
|
|
1250
|
+
if (!isFlowGrammar(ctx.Grammar) && Cursor__get_Index(cursor) < text.length && getCharAtIndex(text, Cursor__get_Index(cursor)) === "\uFEFF") {
|
|
1251
|
+
const span = bomSpan(cursor, Cursor__get_Index(cursor));
|
|
1252
|
+
let bomEnd = Cursor__get_Index(cursor) + 1;
|
|
1253
|
+
while (bomEnd < text.length && getCharAtIndex(text, bomEnd) === "\uFEFF") {
|
|
1254
|
+
bomEnd = bomEnd + 1 | 0;
|
|
1255
|
+
}
|
|
1256
|
+
Cursor__set_Index_Z524259A4(cursor, bomEnd);
|
|
1257
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, false);
|
|
1258
|
+
return new Located$1(Lexeme.ByteOrderMark, span);
|
|
1259
|
+
} else {
|
|
1260
|
+
return lineContent(ctx, cursor);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
function inLine(ctx, cursor) {
|
|
1264
|
+
const text = Cursor__get_Text(cursor);
|
|
1265
|
+
const n = text.length | 0;
|
|
1266
|
+
const i = Cursor__get_Index(cursor) | 0;
|
|
1267
|
+
const q = skipBlanks(text, i) | 0;
|
|
1268
|
+
let tab = false;
|
|
1269
|
+
for (let k = i; k <= q - 1; k++) {
|
|
1270
|
+
if (getCharAtIndex(text, k) === " ") {
|
|
1271
|
+
tab = true;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, tab);
|
|
1275
|
+
if (q >= n) {
|
|
1276
|
+
Cursor__set_Index_Z524259A4(cursor, n);
|
|
1277
|
+
const mark = Cursor__MarkAt_Z524259A4(cursor, n);
|
|
1278
|
+
return new Located$1(Lexeme.StreamEnd, new SourceSpan(mark, mark));
|
|
1279
|
+
} else if (isBreak(getCharAtIndex(text, q))) {
|
|
1280
|
+
Cursor__set_Index_Z524259A4(cursor, afterBreak(text, q));
|
|
1281
|
+
Cursor__set_LineBegin_Z1FBCCD16(cursor, true);
|
|
1282
|
+
return void 0;
|
|
1283
|
+
} else if (getCharAtIndex(text, q) === "#" && q > i) {
|
|
1284
|
+
const finish = commentLineEnd(cursor, q) | 0;
|
|
1285
|
+
const span = Cursor__SpanOf_Z37302880(cursor, q, finish);
|
|
1286
|
+
Cursor__set_Index_Z524259A4(cursor, finish);
|
|
1287
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, tab);
|
|
1288
|
+
return new Located$1(Lexeme_Comment$(new YamlComment(copyRange(text, q + 1, finish), span), false), span);
|
|
1289
|
+
} else {
|
|
1290
|
+
Cursor__set_Index_Z524259A4(cursor, q);
|
|
1291
|
+
Cursor__set_SeparationHadTab_Z1FBCCD16(cursor, tab);
|
|
1292
|
+
return scanToken(ctx, cursor, q, i, tab);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function lexNext(ctx, cursor) {
|
|
1296
|
+
if (!Cursor__get_Started(cursor)) {
|
|
1297
|
+
Cursor__set_Started_Z1FBCCD16(cursor, true);
|
|
1298
|
+
const mark = Cursor__MarkAt_Z524259A4(cursor, Cursor__get_Origin(cursor));
|
|
1299
|
+
return new Located$1(Lexeme.StreamStart, new SourceSpan(mark, mark));
|
|
1300
|
+
} else {
|
|
1301
|
+
let result = void 0;
|
|
1302
|
+
while (result == null) {
|
|
1303
|
+
if (Cursor__get_LineBegin(cursor)) {
|
|
1304
|
+
if (Cursor__get_Index(cursor) >= Cursor__get_Length(cursor)) {
|
|
1305
|
+
const mark_1 = Cursor__MarkAt_Z524259A4(cursor, Cursor__get_Length(cursor));
|
|
1306
|
+
result = new Located$1(Lexeme.StreamEnd, new SourceSpan(mark_1, mark_1));
|
|
1307
|
+
} else {
|
|
1308
|
+
result = lineBegin(ctx, cursor);
|
|
1309
|
+
}
|
|
1310
|
+
} else {
|
|
1311
|
+
result = inLine(ctx, cursor);
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
return value(result);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
function next(ctx, cursor) {
|
|
1318
|
+
try {
|
|
1319
|
+
const lexeme = lexNext(ctx, cursor);
|
|
1320
|
+
const matchValue = lexeme.Value;
|
|
1321
|
+
switch (matchValue.tag) {
|
|
1322
|
+
case /* Comment */
|
|
1323
|
+
19: {
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
case /* BlankLine */
|
|
1327
|
+
20: {
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
case /* LineStart */
|
|
1331
|
+
6: {
|
|
1332
|
+
break;
|
|
1333
|
+
}
|
|
1334
|
+
case /* ByteOrderMark */
|
|
1335
|
+
4: {
|
|
1336
|
+
break;
|
|
1337
|
+
}
|
|
1338
|
+
case /* FlowSequenceEnd */
|
|
1339
|
+
11: {
|
|
1340
|
+
Cursor__set_JsonLike_Z1FBCCD16(cursor, true);
|
|
1341
|
+
break;
|
|
1342
|
+
}
|
|
1343
|
+
case /* FlowMappingEnd */
|
|
1344
|
+
13: {
|
|
1345
|
+
Cursor__set_JsonLike_Z1FBCCD16(cursor, true);
|
|
1346
|
+
break;
|
|
1347
|
+
}
|
|
1348
|
+
case /* Scalar */
|
|
1349
|
+
18: {
|
|
1350
|
+
const scalar = matchValue.fields[0];
|
|
1351
|
+
Cursor__set_JsonLike_Z1FBCCD16(cursor, equals(scalar.Style, ScalarStyle.SingleQuoted) ? true : equals(scalar.Style, ScalarStyle.DoubleQuoted));
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
default:
|
|
1355
|
+
Cursor__set_JsonLike_Z1FBCCD16(cursor, false);
|
|
1356
|
+
}
|
|
1357
|
+
const matchValue_1 = lexeme.Value;
|
|
1358
|
+
switch (matchValue_1.tag) {
|
|
1359
|
+
case /* LineStart */
|
|
1360
|
+
6: {
|
|
1361
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, true);
|
|
1362
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1363
|
+
break;
|
|
1364
|
+
}
|
|
1365
|
+
case /* BlockEntry */
|
|
1366
|
+
7: {
|
|
1367
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1368
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, true);
|
|
1369
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, false);
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
case /* ExplicitKey */
|
|
1373
|
+
8: {
|
|
1374
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1375
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, true);
|
|
1376
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, false);
|
|
1377
|
+
break;
|
|
1378
|
+
}
|
|
1379
|
+
case /* Value */
|
|
1380
|
+
9: {
|
|
1381
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1382
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, true);
|
|
1383
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, false);
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
case /* DocumentEnd */
|
|
1387
|
+
3: {
|
|
1388
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1389
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1390
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, true);
|
|
1391
|
+
break;
|
|
1392
|
+
}
|
|
1393
|
+
case /* Directive */
|
|
1394
|
+
5: {
|
|
1395
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1396
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
case /* Comment */
|
|
1400
|
+
19: {
|
|
1401
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1402
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1403
|
+
break;
|
|
1404
|
+
}
|
|
1405
|
+
case /* ByteOrderMark */
|
|
1406
|
+
4: {
|
|
1407
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1408
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1409
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, true);
|
|
1410
|
+
break;
|
|
1411
|
+
}
|
|
1412
|
+
case /* BlankLine */
|
|
1413
|
+
20: {
|
|
1414
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1415
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1416
|
+
break;
|
|
1417
|
+
}
|
|
1418
|
+
case /* StreamStart */
|
|
1419
|
+
0: {
|
|
1420
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1421
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1424
|
+
case /* StreamEnd */
|
|
1425
|
+
1: {
|
|
1426
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1427
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
default: {
|
|
1431
|
+
Cursor__set_FirstOnLine_Z1FBCCD16(cursor, false);
|
|
1432
|
+
Cursor__set_AfterIndicator_Z1FBCCD16(cursor, false);
|
|
1433
|
+
Cursor__set_InPrelude_Z1FBCCD16(cursor, false);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
return FSharpResult$2_Ok(lexeme);
|
|
1437
|
+
} catch (matchValue_2) {
|
|
1438
|
+
if (matchValue_2 instanceof LexFailure) {
|
|
1439
|
+
const error = matchValue_2.Data0;
|
|
1440
|
+
return FSharpResult$2_Error$(error);
|
|
1441
|
+
} else {
|
|
1442
|
+
throw matchValue_2;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
function nextIsBlockEntry(cursor) {
|
|
1447
|
+
if (Cursor__get_Index(cursor) < Cursor__get_Length(cursor) && getCharAtIndex(Cursor__get_Text(cursor), Cursor__get_Index(cursor)) === "-") {
|
|
1448
|
+
return blankOrEnd(Cursor__get_Text(cursor), Cursor__get_Index(cursor) + 1);
|
|
1449
|
+
} else {
|
|
1450
|
+
return false;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
function decodeTagEscapes(text) {
|
|
1454
|
+
if (text.indexOf("%") < 0) {
|
|
1455
|
+
return text;
|
|
1456
|
+
} else {
|
|
1457
|
+
const sb = StringBuilder_$ctor();
|
|
1458
|
+
let valid = true;
|
|
1459
|
+
let i = 0;
|
|
1460
|
+
const byteAt = (index) => hexValue(getCharAtIndex(text, index + 1)) * 16 + hexValue(getCharAtIndex(text, index + 2)) | 0;
|
|
1461
|
+
while (valid && i < text.length) {
|
|
1462
|
+
if (getCharAtIndex(text, i) !== "%") {
|
|
1463
|
+
StringBuilder__Append_244C7CD6(sb, getCharAtIndex(text, i));
|
|
1464
|
+
i = i + 1 | 0;
|
|
1465
|
+
} else {
|
|
1466
|
+
const lead = byteAt(i) | 0;
|
|
1467
|
+
const extra = (lead < 128 ? 0 : lead >= 194 && lead <= 223 ? 1 : lead >= 224 && lead <= 239 ? 2 : lead >= 240 && lead <= 244 ? 3 : -1) | 0;
|
|
1468
|
+
if (extra < 0 ? true : i + 3 * (extra + 1) > text.length) {
|
|
1469
|
+
valid = false;
|
|
1470
|
+
} else {
|
|
1471
|
+
let codePoint = extra === 0 ? lead : extra === 1 ? lead & 31 : extra === 2 ? lead & 15 : lead & 7;
|
|
1472
|
+
for (let k = 1; k <= extra; k++) {
|
|
1473
|
+
const at = i + 3 * k | 0;
|
|
1474
|
+
if (getCharAtIndex(text, at) !== "%") {
|
|
1475
|
+
valid = false;
|
|
1476
|
+
} else {
|
|
1477
|
+
const next_1 = byteAt(at) | 0;
|
|
1478
|
+
if ((next_1 & 192) !== 128) {
|
|
1479
|
+
valid = false;
|
|
1480
|
+
}
|
|
1481
|
+
codePoint = codePoint << 6 | next_1 & 63 | 0;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if (((extra === 2 && codePoint < 2048 ? true : extra === 3 && codePoint < 65536) ? true : codePoint > 1114111) ? true : codePoint >= 55296 && codePoint <= 57343) {
|
|
1485
|
+
valid = false;
|
|
1486
|
+
}
|
|
1487
|
+
if (valid) {
|
|
1488
|
+
appendCodePoint(sb, codePoint);
|
|
1489
|
+
}
|
|
1490
|
+
i = i + 3 * (extra + 1) | 0;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
if (valid) {
|
|
1495
|
+
return toString(sb);
|
|
1496
|
+
} else {
|
|
1497
|
+
return void 0;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
export { decodeTagEscapes, next, nextIsBlockEntry };
|