diff --git a/src/loader.ts b/src/loader.ts index fe4b7dd..777b4f4 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -374,8 +374,8 @@ function mergeMappings(state:State, destination, source) { } } -function storeMappingPair(state:State, _result:ast.YamlMap, keyTag, keyNode:ast.YAMLNode, - valueNode:ast.YAMLNode):ast.YamlMap { +function storeMappingPair(state:State, _result:ast.YAMLMap, keyTag, keyNode:ast.YAMLNode, + valueNode:ast.YAMLNode):ast.YAMLMap { var index, quantity; if (keyNode==null){ return; @@ -885,7 +885,7 @@ function readFlowCollection(state:State, nodeIndent) { } if (isMapping) { - storeMappingPair(state, (_result), keyTag, keyNode, valueNode); + storeMappingPair(state, (_result), keyTag, keyNode, valueNode); } else if (isPair) { var mp=storeMappingPair(state, null, keyTag, keyNode, valueNode); mp.parent=_result; diff --git a/src/yamlAST.ts b/src/yamlAST.ts index d82bc63..246feb2 100644 --- a/src/yamlAST.ts +++ b/src/yamlAST.ts @@ -60,9 +60,10 @@ export interface YAMLMapping extends YAMLNode{ export interface YAMLSequence extends YAMLNode{ items:YAMLNode[] } -export interface YamlMap extends YAMLNode{ +export interface YAMLMap extends YAMLNode{ mappings:YAMLMapping[] } +export type YamlMap = YAMLMap; // keep it for backward compatibility export function newMapping(key:YAMLScalar,value:YAMLNode):YAMLMapping{ var end = (value ? value.endPosition : key.endPosition + 1); //FIXME.workaround, end should be defied by position of ':' //console.log('key: ' + key.value + ' ' + key.startPosition + '..' + key.endPosition + ' ' + value + ' end: ' + end); @@ -117,7 +118,7 @@ export function newItems():YAMLSequence{ export function newSeq():YAMLSequence{ return newItems(); } -export function newMap(mappings?: YAMLMapping[]):YamlMap{ +export function newMap(mappings?: YAMLMapping[]):YAMLMap { return { errors:[], startPosition:-1,