@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.
Files changed (470) hide show
  1. package/README.md +0 -64
  2. package/dist/ts/index.d.ts +44 -7
  3. package/dist/ts/index.d.ts.map +1 -1
  4. package/dist/ts/index.js +45 -8
  5. package/dist/ts/node_modules/@fable-org/fable-library-ts/Array.js +195 -92
  6. package/dist/ts/node_modules/@fable-org/fable-library-ts/Async.js +251 -30
  7. package/dist/ts/node_modules/@fable-org/fable-library-ts/AsyncBuilder.js +61 -11
  8. package/dist/ts/node_modules/@fable-org/fable-library-ts/BigInt.js +15 -5
  9. package/dist/ts/node_modules/@fable-org/fable-library-ts/BitConverter.js +139 -0
  10. package/dist/ts/node_modules/@fable-org/fable-library-ts/Date.js +1 -1
  11. package/dist/ts/node_modules/@fable-org/fable-library-ts/Decimal.js +68 -12
  12. package/dist/ts/node_modules/@fable-org/fable-library-ts/Double.js +24 -10
  13. package/dist/ts/node_modules/@fable-org/fable-library-ts/FSharp.Core.js +8 -2
  14. package/dist/ts/node_modules/@fable-org/fable-library-ts/Global.js +1 -1
  15. package/dist/ts/node_modules/@fable-org/fable-library-ts/Int32.js +11 -2
  16. package/dist/ts/node_modules/@fable-org/fable-library-ts/List.js +220 -155
  17. package/dist/ts/node_modules/@fable-org/fable-library-ts/Long.js +7 -2
  18. package/dist/ts/node_modules/@fable-org/fable-library-ts/Map.js +46 -39
  19. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableMap.js +75 -92
  20. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableSet.js +56 -76
  21. package/dist/ts/node_modules/@fable-org/fable-library-ts/NumberStyles.js +54 -0
  22. package/dist/ts/node_modules/@fable-org/fable-library-ts/Numeric.js +10 -5
  23. package/dist/ts/node_modules/@fable-org/fable-library-ts/Random.js +3 -4
  24. package/dist/ts/node_modules/@fable-org/fable-library-ts/Range.js +4 -3
  25. package/dist/ts/node_modules/@fable-org/fable-library-ts/RegExp.js +2 -2
  26. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq.js +128 -64
  27. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq2.js +4 -8
  28. package/dist/ts/node_modules/@fable-org/fable-library-ts/Set.js +64 -57
  29. package/dist/ts/node_modules/@fable-org/fable-library-ts/String.js +68 -21
  30. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Collections.Generic.js +3 -2
  31. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Text.js +2 -2
  32. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.js +5 -5
  33. package/dist/ts/node_modules/@fable-org/fable-library-ts/Types.js +23 -12
  34. package/dist/ts/node_modules/@fable-org/fable-library-ts/Util.js +88 -49
  35. package/dist/ts/node_modules/@fable-org/fable-library-ts/lib/big.js +121 -74
  36. package/dist/ts/ts/ARC.d.ts +22 -5
  37. package/dist/ts/ts/ARC.d.ts.map +1 -1
  38. package/dist/ts/ts/ARC.js +282 -185
  39. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts +0 -2
  40. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts.map +1 -1
  41. package/dist/ts/ts/CWL/CWLKnownFieldNames.js +1 -7
  42. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts +46 -27
  43. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts.map +1 -1
  44. package/dist/ts/ts/CWL/CWLProcessingUnit.js +312 -123
  45. package/dist/ts/ts/CWL/CWLTypes.d.ts +481 -148
  46. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  47. package/dist/ts/ts/CWL/CWLTypes.js +887 -201
  48. package/dist/ts/ts/CWL/Decode.d.ts +480 -211
  49. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  50. package/dist/ts/ts/CWL/Decode.js +3614 -2462
  51. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +9 -0
  52. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -1
  53. package/dist/ts/ts/CWL/DynamicObjHelpers.js +55 -5
  54. package/dist/ts/ts/CWL/Encode.d.ts +225 -85
  55. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  56. package/dist/ts/ts/CWL/Encode.js +1858 -970
  57. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +42 -28
  58. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  59. package/dist/ts/ts/CWL/ExpressionToolDescription.js +34 -13
  60. package/dist/ts/ts/CWL/HashHelpers.d.ts +38 -0
  61. package/dist/ts/ts/CWL/HashHelpers.d.ts.map +1 -1
  62. package/dist/ts/ts/CWL/HashHelpers.js +255 -6
  63. package/dist/ts/ts/CWL/Inputs.d.ts +127 -56
  64. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  65. package/dist/ts/ts/CWL/Inputs.js +107 -16
  66. package/dist/ts/ts/CWL/OperationDescription.d.ts +41 -21
  67. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  68. package/dist/ts/ts/CWL/OperationDescription.js +35 -9
  69. package/dist/ts/ts/CWL/Outputs.d.ts +93 -42
  70. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  71. package/dist/ts/ts/CWL/Outputs.js +101 -19
  72. package/dist/ts/ts/CWL/ParameterReference.d.ts +11 -8
  73. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  74. package/dist/ts/ts/CWL/ParameterReference.js +18 -25
  75. package/dist/ts/ts/CWL/ParameterValue.d.ts +15 -1
  76. package/dist/ts/ts/CWL/ParameterValue.d.ts.map +1 -1
  77. package/dist/ts/ts/CWL/ParameterValue.js +59 -35
  78. package/dist/ts/ts/CWL/Requirements.d.ts +240 -98
  79. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  80. package/dist/ts/ts/CWL/Requirements.js +462 -89
  81. package/dist/ts/ts/CWL/ScalarQuoting.d.ts +51 -0
  82. package/dist/ts/ts/CWL/ScalarQuoting.d.ts.map +1 -0
  83. package/dist/ts/ts/CWL/ScalarQuoting.js +250 -0
  84. package/dist/ts/ts/CWL/ToolDescription.d.ts +63 -50
  85. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  86. package/dist/ts/ts/CWL/ToolDescription.js +34 -13
  87. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +45 -26
  88. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  89. package/dist/ts/ts/CWL/WorkflowDescription.js +38 -11
  90. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +248 -65
  91. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  92. package/dist/ts/ts/CWL/WorkflowSteps.js +413 -43
  93. package/dist/ts/ts/CWLRunResolver.d.ts +30 -12
  94. package/dist/ts/ts/CWLRunResolver.d.ts.map +1 -1
  95. package/dist/ts/ts/CWLRunResolver.js +221 -86
  96. package/dist/ts/ts/Contract/ARC.d.ts.map +1 -1
  97. package/dist/ts/ts/Contract/ARC.js +13 -14
  98. package/dist/ts/ts/Contract/ArcAssay.d.ts.map +1 -1
  99. package/dist/ts/ts/Contract/ArcAssay.js +4 -4
  100. package/dist/ts/ts/Contract/ArcInvestigation.d.ts.map +1 -1
  101. package/dist/ts/ts/Contract/ArcInvestigation.js +3 -4
  102. package/dist/ts/ts/Contract/ArcRun.d.ts +12 -2
  103. package/dist/ts/ts/Contract/ArcRun.d.ts.map +1 -1
  104. package/dist/ts/ts/Contract/ArcRun.js +47 -20
  105. package/dist/ts/ts/Contract/ArcStudy.d.ts.map +1 -1
  106. package/dist/ts/ts/Contract/ArcStudy.js +4 -4
  107. package/dist/ts/ts/Contract/ArcWorkflow.d.ts +18 -4
  108. package/dist/ts/ts/Contract/ArcWorkflow.d.ts.map +1 -1
  109. package/dist/ts/ts/Contract/ArcWorkflow.js +55 -17
  110. package/dist/ts/ts/Contract/Datamap.d.ts.map +1 -1
  111. package/dist/ts/ts/Contract/Datamap.js +16 -17
  112. package/dist/ts/ts/Contract/Git.js +1 -1
  113. package/dist/ts/ts/Contract/ValidationPackagesConfig.d.ts.map +1 -1
  114. package/dist/ts/ts/Contract/ValidationPackagesConfig.js +4 -5
  115. package/dist/ts/ts/ContractIO/ContractIO.d.ts +7 -0
  116. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  117. package/dist/ts/ts/ContractIO/ContractIO.js +95 -18
  118. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts +1 -0
  119. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts.map +1 -1
  120. package/dist/ts/ts/ContractIO/FileSystemHelper.js +12 -5
  121. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  122. package/dist/ts/ts/Conversion/Assay.js +26 -18
  123. package/dist/ts/ts/Conversion/Basic.d.ts +4 -0
  124. package/dist/ts/ts/Conversion/Basic.d.ts.map +1 -1
  125. package/dist/ts/ts/Conversion/Basic.js +55 -31
  126. package/dist/ts/ts/Conversion/ColumnIndex.d.ts.map +1 -1
  127. package/dist/ts/ts/Conversion/ColumnIndex.js +2 -4
  128. package/dist/ts/ts/Conversion/DateTime.d.ts.map +1 -1
  129. package/dist/ts/ts/Conversion/DateTime.js +1 -2
  130. package/dist/ts/ts/Conversion/Investigation.d.ts.map +1 -1
  131. package/dist/ts/ts/Conversion/Investigation.js +15 -14
  132. package/dist/ts/ts/Conversion/Person.js +11 -11
  133. package/dist/ts/ts/Conversion/Process.d.ts +4 -2
  134. package/dist/ts/ts/Conversion/Process.d.ts.map +1 -1
  135. package/dist/ts/ts/Conversion/Process.js +134 -97
  136. package/dist/ts/ts/Conversion/Run.d.ts +36 -6
  137. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  138. package/dist/ts/ts/Conversion/Run.js +320 -136
  139. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  140. package/dist/ts/ts/Conversion/ScholarlyArticle.js +75 -9
  141. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  142. package/dist/ts/ts/Conversion/Study.js +23 -12
  143. package/dist/ts/ts/Conversion/Table.d.ts +3 -2
  144. package/dist/ts/ts/Conversion/Table.d.ts.map +1 -1
  145. package/dist/ts/ts/Conversion/Table.js +8 -8
  146. package/dist/ts/ts/Conversion/Workflow.d.ts +48 -9
  147. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  148. package/dist/ts/ts/Conversion/Workflow.js +655 -163
  149. package/dist/ts/ts/Conversion.js +6 -6
  150. package/dist/ts/ts/Core/ArcTypes.d.ts +73 -28
  151. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  152. package/dist/ts/ts/Core/ArcTypes.js +219 -129
  153. package/dist/ts/ts/Core/Comment.d.ts.map +1 -1
  154. package/dist/ts/ts/Core/Comment.js +2 -2
  155. package/dist/ts/ts/Core/CommentList.js +7 -7
  156. package/dist/ts/ts/Core/Conversion.d.ts.map +1 -1
  157. package/dist/ts/ts/Core/Conversion.js +68 -59
  158. package/dist/ts/ts/Core/Data.d.ts +6 -0
  159. package/dist/ts/ts/Core/Data.d.ts.map +1 -1
  160. package/dist/ts/ts/Core/Data.js +32 -12
  161. package/dist/ts/ts/Core/DataContext.d.ts +1 -1
  162. package/dist/ts/ts/Core/DataContext.d.ts.map +1 -1
  163. package/dist/ts/ts/Core/DataContext.js +4 -4
  164. package/dist/ts/ts/Core/DataFile.d.ts +11 -8
  165. package/dist/ts/ts/Core/DataFile.d.ts.map +1 -1
  166. package/dist/ts/ts/Core/DataFile.js +55 -61
  167. package/dist/ts/ts/Core/Datamap.d.ts.map +1 -1
  168. package/dist/ts/ts/Core/Datamap.js +2 -3
  169. package/dist/ts/ts/Core/Helper/Collections.d.ts.map +1 -1
  170. package/dist/ts/ts/Core/Helper/Collections.js +2 -4
  171. package/dist/ts/ts/Core/Helper/Identifier.d.ts.map +1 -1
  172. package/dist/ts/ts/Core/Helper/Identifier.js +12 -15
  173. package/dist/ts/ts/Core/Helper/ORCID.d.ts.map +1 -1
  174. package/dist/ts/ts/Core/Helper/ORCID.js +2 -3
  175. package/dist/ts/ts/Core/Helper/Regex.d.ts.map +1 -1
  176. package/dist/ts/ts/Core/Helper/Regex.js +52 -53
  177. package/dist/ts/ts/Core/Helper/SemVer.d.ts +13 -3
  178. package/dist/ts/ts/Core/Helper/SemVer.d.ts.map +1 -1
  179. package/dist/ts/ts/Core/Helper/SemVer.js +96 -6
  180. package/dist/ts/ts/Core/Helper/Url.d.ts.map +1 -1
  181. package/dist/ts/ts/Core/Helper/Url.js +1 -1
  182. package/dist/ts/ts/Core/OntologyAnnotation.js +22 -22
  183. package/dist/ts/ts/Core/Person.d.ts.map +1 -1
  184. package/dist/ts/ts/Core/Person.js +2 -2
  185. package/dist/ts/ts/Core/Process/ColumnIndex.d.ts.map +1 -1
  186. package/dist/ts/ts/Core/Process/ColumnIndex.js +10 -12
  187. package/dist/ts/ts/Core/Process/Component.d.ts.map +1 -1
  188. package/dist/ts/ts/Core/Process/Component.js +22 -22
  189. package/dist/ts/ts/Core/Process/Factor.d.ts.map +1 -1
  190. package/dist/ts/ts/Core/Process/Factor.js +7 -7
  191. package/dist/ts/ts/Core/Process/FactorValue.d.ts.map +1 -1
  192. package/dist/ts/ts/Core/Process/FactorValue.js +15 -15
  193. package/dist/ts/ts/Core/Process/Material.d.ts.map +1 -1
  194. package/dist/ts/ts/Core/Process/Material.js +2 -2
  195. package/dist/ts/ts/Core/Process/MaterialAttribute.d.ts.map +1 -1
  196. package/dist/ts/ts/Core/Process/MaterialAttribute.js +6 -6
  197. package/dist/ts/ts/Core/Process/MaterialAttributeValue.d.ts.map +1 -1
  198. package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +16 -16
  199. package/dist/ts/ts/Core/Process/Process.js +21 -21
  200. package/dist/ts/ts/Core/Process/ProcessInput.d.ts.map +1 -1
  201. package/dist/ts/ts/Core/Process/ProcessInput.js +2 -2
  202. package/dist/ts/ts/Core/Process/ProcessOutput.d.ts.map +1 -1
  203. package/dist/ts/ts/Core/Process/ProcessOutput.js +2 -2
  204. package/dist/ts/ts/Core/Process/ProcessParameterValue.d.ts.map +1 -1
  205. package/dist/ts/ts/Core/Process/ProcessParameterValue.js +17 -17
  206. package/dist/ts/ts/Core/Process/ProcessSequence.js +4 -4
  207. package/dist/ts/ts/Core/Process/Protocol.d.ts.map +1 -1
  208. package/dist/ts/ts/Core/Process/Protocol.js +9 -9
  209. package/dist/ts/ts/Core/Process/ProtocolParameter.d.ts.map +1 -1
  210. package/dist/ts/ts/Core/Process/ProtocolParameter.js +6 -6
  211. package/dist/ts/ts/Core/Publication.d.ts.map +1 -1
  212. package/dist/ts/ts/Core/Publication.js +3 -3
  213. package/dist/ts/ts/Core/ScalarValue.d.ts.map +1 -1
  214. package/dist/ts/ts/Core/ScalarValue.js +9 -13
  215. package/dist/ts/ts/Core/Table/ArcTable.d.ts.map +1 -1
  216. package/dist/ts/ts/Core/Table/ArcTable.js +18 -18
  217. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts +1 -1
  218. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
  219. package/dist/ts/ts/Core/Table/ArcTableAux.js +59 -70
  220. package/dist/ts/ts/Core/Table/ArcTables.js +16 -16
  221. package/dist/ts/ts/Core/Table/CompositeCell.d.ts +4 -0
  222. package/dist/ts/ts/Core/Table/CompositeCell.d.ts.map +1 -1
  223. package/dist/ts/ts/Core/Table/CompositeCell.js +39 -2
  224. package/dist/ts/ts/Core/Table/CompositeHeader.d.ts.map +1 -1
  225. package/dist/ts/ts/Core/Table/CompositeHeader.js +5 -6
  226. package/dist/ts/ts/Core/Templates.d.ts.map +1 -1
  227. package/dist/ts/ts/Core/Templates.js +2 -2
  228. package/dist/ts/ts/FileSystem/Path.d.ts +13 -2
  229. package/dist/ts/ts/FileSystem/Path.d.ts.map +1 -1
  230. package/dist/ts/ts/FileSystem/Path.js +37 -19
  231. package/dist/ts/ts/Json/Assay.js +22 -22
  232. package/dist/ts/ts/Json/Comment.js +9 -9
  233. package/dist/ts/ts/Json/Data.d.ts.map +1 -1
  234. package/dist/ts/ts/Json/Data.js +11 -11
  235. package/dist/ts/ts/Json/Datamap/DataContext.js +2 -2
  236. package/dist/ts/ts/Json/Decode.d.ts.map +1 -1
  237. package/dist/ts/ts/Json/Decode.js +3 -5
  238. package/dist/ts/ts/Json/Encode.js +2 -2
  239. package/dist/ts/ts/Json/Investigation.d.ts.map +1 -1
  240. package/dist/ts/ts/Json/Investigation.js +20 -20
  241. package/dist/ts/ts/Json/OntologyAnnotation.d.ts.map +1 -1
  242. package/dist/ts/ts/Json/OntologyAnnotation.js +18 -18
  243. package/dist/ts/ts/Json/OntologySourceReference.d.ts.map +1 -1
  244. package/dist/ts/ts/Json/OntologySourceReference.js +9 -9
  245. package/dist/ts/ts/Json/Person.d.ts.map +1 -1
  246. package/dist/ts/ts/Json/Person.js +20 -20
  247. package/dist/ts/ts/Json/Process/AssayMaterials.d.ts.map +1 -1
  248. package/dist/ts/ts/Json/Process/AssayMaterials.js +1 -2
  249. package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
  250. package/dist/ts/ts/Json/Process/Component.js +5 -6
  251. package/dist/ts/ts/Json/Process/Factor.d.ts.map +1 -1
  252. package/dist/ts/ts/Json/Process/Factor.js +7 -7
  253. package/dist/ts/ts/Json/Process/FactorValue.d.ts.map +1 -1
  254. package/dist/ts/ts/Json/Process/FactorValue.js +2 -3
  255. package/dist/ts/ts/Json/Process/Material.d.ts.map +1 -1
  256. package/dist/ts/ts/Json/Process/Material.js +9 -10
  257. package/dist/ts/ts/Json/Process/MaterialAttribute.d.ts.map +1 -1
  258. package/dist/ts/ts/Json/Process/MaterialAttribute.js +5 -6
  259. package/dist/ts/ts/Json/Process/MaterialAttributeValue.d.ts.map +1 -1
  260. package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +2 -3
  261. package/dist/ts/ts/Json/Process/Process.d.ts.map +1 -1
  262. package/dist/ts/ts/Json/Process/Process.js +8 -9
  263. package/dist/ts/ts/Json/Process/ProcessParameterValue.d.ts.map +1 -1
  264. package/dist/ts/ts/Json/Process/ProcessParameterValue.js +1 -2
  265. package/dist/ts/ts/Json/Process/Protocol.d.ts.map +1 -1
  266. package/dist/ts/ts/Json/Process/Protocol.js +17 -17
  267. package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
  268. package/dist/ts/ts/Json/Process/ProtocolParameter.js +6 -6
  269. package/dist/ts/ts/Json/Process/Sample.d.ts.map +1 -1
  270. package/dist/ts/ts/Json/Process/Sample.js +9 -9
  271. package/dist/ts/ts/Json/Process/Source.d.ts.map +1 -1
  272. package/dist/ts/ts/Json/Process/Source.js +10 -11
  273. package/dist/ts/ts/Json/Process/StudyMaterials.d.ts.map +1 -1
  274. package/dist/ts/ts/Json/Process/StudyMaterials.js +1 -2
  275. package/dist/ts/ts/Json/PropertyValue.d.ts.map +1 -1
  276. package/dist/ts/ts/Json/PropertyValue.js +24 -24
  277. package/dist/ts/ts/Json/Publication.d.ts.map +1 -1
  278. package/dist/ts/ts/Json/Publication.js +10 -10
  279. package/dist/ts/ts/Json/ROCrate/LDContext.js +1 -2
  280. package/dist/ts/ts/Json/ROCrate/LDGraph.js +2 -2
  281. package/dist/ts/ts/Json/ROCrate/LDNode.js +5 -5
  282. package/dist/ts/ts/Json/Run.js +9 -9
  283. package/dist/ts/ts/Json/StringTable.d.ts.map +1 -1
  284. package/dist/ts/ts/Json/StringTable.js +4 -7
  285. package/dist/ts/ts/Json/Study.js +20 -20
  286. package/dist/ts/ts/Json/Table/CellTable.js +1 -2
  287. package/dist/ts/ts/Json/Table/OATable.js +1 -2
  288. package/dist/ts/ts/Json/Workflow.js +9 -9
  289. package/dist/ts/ts/Json.d.ts +121 -1
  290. package/dist/ts/ts/Json.d.ts.map +1 -1
  291. package/dist/ts/ts/Json.js +310 -2
  292. package/dist/ts/ts/JsonIO/Comment.d.ts +15 -0
  293. package/dist/ts/ts/JsonIO/Comment.d.ts.map +1 -0
  294. package/dist/ts/ts/JsonIO/Comment.js +67 -0
  295. package/dist/ts/ts/JsonIO/Data.d.ts +9 -0
  296. package/dist/ts/ts/JsonIO/Data.d.ts.map +1 -0
  297. package/dist/ts/ts/JsonIO/Data.js +49 -0
  298. package/dist/ts/ts/JsonIO/DataFile.d.ts +9 -0
  299. package/dist/ts/ts/JsonIO/DataFile.d.ts.map +1 -0
  300. package/dist/ts/ts/JsonIO/DataFile.js +48 -0
  301. package/dist/ts/ts/JsonIO/LDObject.d.ts +6 -0
  302. package/dist/ts/ts/JsonIO/LDObject.d.ts.map +1 -1
  303. package/dist/ts/ts/JsonIO/LDObject.js +173 -17
  304. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts +15 -0
  305. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts.map +1 -0
  306. package/dist/ts/ts/JsonIO/OntologySourceReference.js +67 -0
  307. package/dist/ts/ts/JsonIO/Publication.d.ts +15 -0
  308. package/dist/ts/ts/JsonIO/Publication.d.ts.map +1 -0
  309. package/dist/ts/ts/JsonIO/Publication.js +68 -0
  310. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts +9 -0
  311. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts.map +1 -0
  312. package/dist/ts/ts/JsonIO/Table/ArcTable.js +74 -0
  313. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts +6 -0
  314. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts.map +1 -0
  315. package/dist/ts/ts/JsonIO/Table/CompositeCell.js +29 -0
  316. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts +6 -0
  317. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts.map +1 -0
  318. package/dist/ts/ts/JsonIO/Table/CompositeHeader.js +29 -0
  319. package/dist/ts/ts/JsonIO/Table/IOType.d.ts +6 -0
  320. package/dist/ts/ts/JsonIO/Table/IOType.d.ts.map +1 -0
  321. package/dist/ts/ts/JsonIO/Table/IOType.js +29 -0
  322. package/dist/ts/ts/License.d.ts.map +1 -1
  323. package/dist/ts/ts/License.js +6 -6
  324. package/dist/ts/ts/ROCrate/LDContext.d.ts.map +1 -1
  325. package/dist/ts/ts/ROCrate/LDContext.js +31 -39
  326. package/dist/ts/ts/ROCrate/LDObject.d.ts.map +1 -1
  327. package/dist/ts/ts/ROCrate/LDObject.js +56 -49
  328. package/dist/ts/ts/ROCrate/LDTypes/Comment.js +2 -2
  329. package/dist/ts/ts/ROCrate/LDTypes/ComputationalWorkflow.js +3 -3
  330. package/dist/ts/ts/ROCrate/LDTypes/ComputerLanguage.js +2 -2
  331. package/dist/ts/ts/ROCrate/LDTypes/CreateAction.js +5 -5
  332. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts +1 -0
  333. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts.map +1 -1
  334. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.js +3 -0
  335. package/dist/ts/ts/ROCrate/LDTypes/Dataset.d.ts.map +1 -1
  336. package/dist/ts/ts/ROCrate/LDTypes/Dataset.js +22 -17
  337. package/dist/ts/ts/ROCrate/LDTypes/DefinedTerm.js +2 -2
  338. package/dist/ts/ts/ROCrate/LDTypes/File.js +5 -5
  339. package/dist/ts/ts/ROCrate/LDTypes/FormalParameter.js +2 -2
  340. package/dist/ts/ts/ROCrate/LDTypes/LabProcess.js +9 -9
  341. package/dist/ts/ts/ROCrate/LDTypes/LabProtocol.js +4 -4
  342. package/dist/ts/ts/ROCrate/LDTypes/Organization.js +1 -1
  343. package/dist/ts/ts/ROCrate/LDTypes/Person.js +7 -7
  344. package/dist/ts/ts/ROCrate/LDTypes/PostalAddress.js +1 -1
  345. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.d.ts.map +1 -1
  346. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.js +45 -48
  347. package/dist/ts/ts/ROCrate/LDTypes/Sample.js +3 -3
  348. package/dist/ts/ts/ROCrate/LDTypes/ScholarlyArticle.js +4 -4
  349. package/dist/ts/ts/ROCrate/LDTypes/SoftwareSourceCode.js +3 -3
  350. package/dist/ts/ts/ROCrate/LDTypes/WorkflowInvocation.js +3 -3
  351. package/dist/ts/ts/ROCrate/LDTypes/WorkflowProtocol.js +2 -2
  352. package/dist/ts/ts/ROCrateIO.d.ts +18 -4
  353. package/dist/ts/ts/ROCrateIO.d.ts.map +1 -1
  354. package/dist/ts/ts/ROCrateIO.js +49 -38
  355. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
  356. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +9 -10
  357. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.d.ts.map +1 -1
  358. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +7 -7
  359. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
  360. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +6 -8
  361. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +20 -20
  362. package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts.map +1 -1
  363. package/dist/ts/ts/Spreadsheet/ArcAssay.js +7 -7
  364. package/dist/ts/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
  365. package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +10 -12
  366. package/dist/ts/ts/Spreadsheet/ArcRun.d.ts.map +1 -1
  367. package/dist/ts/ts/Spreadsheet/ArcRun.js +5 -6
  368. package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts.map +1 -1
  369. package/dist/ts/ts/Spreadsheet/ArcStudy.js +3 -3
  370. package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts.map +1 -1
  371. package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +5 -6
  372. package/dist/ts/ts/Spreadsheet/CollectionAux.d.ts.map +1 -1
  373. package/dist/ts/ts/Spreadsheet/CollectionAux.js +10 -14
  374. package/dist/ts/ts/Spreadsheet/Datamap.js +1 -2
  375. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapColumn.js +3 -3
  376. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapHeader.js +10 -10
  377. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.d.ts.map +1 -1
  378. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.js +9 -10
  379. package/dist/ts/ts/Spreadsheet/Metadata/Assays.d.ts.map +1 -1
  380. package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +8 -10
  381. package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts +8 -0
  382. package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts.map +1 -1
  383. package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +18 -7
  384. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.d.ts.map +1 -1
  385. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +4 -6
  386. package/dist/ts/ts/Spreadsheet/Metadata/Factors.d.ts.map +1 -1
  387. package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +6 -8
  388. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.d.ts.map +1 -1
  389. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +5 -7
  390. package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.d.ts.map +1 -1
  391. package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.js +2 -4
  392. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.d.ts.map +1 -1
  393. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +7 -9
  394. package/dist/ts/ts/Spreadsheet/Metadata/Publication.d.ts.map +1 -1
  395. package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +6 -8
  396. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts +1 -1
  397. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts.map +1 -1
  398. package/dist/ts/ts/Spreadsheet/Metadata/Run.js +9 -11
  399. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
  400. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +17 -17
  401. package/dist/ts/ts/Spreadsheet/Metadata/Study.d.ts.map +1 -1
  402. package/dist/ts/ts/Spreadsheet/Metadata/Study.js +10 -12
  403. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.d.ts.map +1 -1
  404. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +7 -9
  405. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts +1 -1
  406. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts.map +1 -1
  407. package/dist/ts/ts/WorkflowGraph/Adapters.js +5 -6
  408. package/dist/ts/ts/WorkflowGraph/Builder.d.ts +25 -6
  409. package/dist/ts/ts/WorkflowGraph/Builder.d.ts.map +1 -1
  410. package/dist/ts/ts/WorkflowGraph/Builder.js +264 -138
  411. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts +6 -0
  412. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts.map +1 -1
  413. package/dist/ts/ts/WorkflowGraph/GraphTypes.js +4 -1
  414. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts +8 -5
  415. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  416. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +27 -10
  417. package/dist/ts/ts/Xlsx.js +3 -3
  418. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +3 -3
  419. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  420. package/dist/ts/ts/Yaml/ValidationPackage.js +11 -23
  421. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +3 -3
  422. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  423. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +11 -23
  424. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js +16 -20
  425. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/FableJS.fs.js +1 -1
  426. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/ReflectionUtils.fs.js +8 -8
  427. package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +1 -2
  428. package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.6.0/Http.fs.js +4 -4
  429. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCell.fs.js +8 -8
  430. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCellsCollection.fs.js +18 -18
  431. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsAddress.fs.js +3 -3
  432. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorkbook.fs.js +1 -1
  433. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorksheet.fs.js +7 -7
  434. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Value.fs.js +3 -5
  435. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Worksheet.fs.js +7 -7
  436. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Ranges/FsRangeBase.fs.js +1 -2
  437. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Tables/FsTable.fs.js +7 -7
  438. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Cell.fs.js +2 -2
  439. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Table.fs.js +1 -2
  440. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Decode.fs.js +49 -71
  441. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Encode.fs.js +1 -1
  442. package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +1 -2
  443. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Compare.fs.js +857 -0
  444. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/CoreSchema.fs.js +725 -0
  445. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Decode.fs.js +1175 -0
  446. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Encode.fs.js +123 -0
  447. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Layout.fs.js +282 -0
  448. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexeme.fs.js +203 -0
  449. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexer.fs.js +1502 -0
  450. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Model.fs.js +564 -0
  451. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Node.fs.js +453 -0
  452. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Parser.fs.js +2622 -0
  453. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Reader.fs.js +108 -0
  454. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Source.fs.js +649 -0
  455. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Tag.fs.js +32 -0
  456. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Validate.fs.js +1084 -0
  457. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Writer.fs.js +2927 -0
  458. package/package.json +5 -4
  459. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Decode.fs.js +0 -1669
  460. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Encode.fs.js +0 -57
  461. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Escapes.fs.js +0 -320
  462. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Interop/JsInterop.fs.js +0 -10
  463. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Persil.fs.js +0 -414
  464. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Preprocessing.fs.js +0 -319
  465. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Reader.fs.js +0 -1884
  466. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Regex.fs.js +0 -23
  467. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/RegexActivePatterns.fs.js +0 -313
  468. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Syntax.fs.js +0 -840
  469. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Writer.fs.js +0 -689
  470. 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 };