diff options
author | Jérémy Faivre <contact@jeremyfa.com> | 2017-02-12 00:39:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 00:39:06 +0100 |
commit | 5e74781976ad23645970eb192f2d83a324e7c95f (patch) | |
tree | a8860fc3255992224b5567190bc3a8043b7d2121 /src/Inline.coffee | |
parent | 0ce1c7eb73474a1c0ad5edeec112427b095b154f (diff) | |
parent | 1e8d6dd845e0f59dd88c28615ad8702e4a59c0d9 (diff) | |
download | yamljs-5e74781976ad23645970eb192f2d83a324e7c95f.tar.gz |
Merge pull request #80 from ar-shao/multiline
Multiline compact sequence/mapping/string
Diffstat (limited to 'src/Inline.coffee')
-rw-r--r-- | src/Inline.coffee | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Inline.coffee b/src/Inline.coffee index a0f8434..4620e3f 100644 --- a/src/Inline.coffee +++ b/src/Inline.coffee @@ -4,6 +4,7 @@ Unescaper = require './Unescaper' Escaper = require './Escaper' Utils = require './Utils' ParseException = require './Exception/ParseException' +ParseMore = require './Exception/ParseMore' DumpException = require './Exception/DumpException' # Inline YAML parsing and dumping @@ -211,13 +212,13 @@ class Inline # # @return [String] A YAML string # - # @throw [ParseException] When malformed inline YAML string is parsed + # @throw [ParseMore] When malformed inline YAML string is parsed # @parseQuotedScalar: (scalar, context) -> {i} = context unless match = @PATTERN_QUOTED_SCALAR.exec scalar[i..] - throw new ParseException 'Malformed inline YAML string ('+scalar[i..]+').' + throw new ParseMore 'Malformed inline YAML string ('+scalar[i..]+').' output = match[0].substr(1, match[0].length - 2) @@ -239,7 +240,7 @@ class Inline # # @return [String] A YAML string # - # @throw [ParseException] When malformed inline YAML string is parsed + # @throw [ParseMore] When malformed inline YAML string is parsed # @parseSequence: (sequence, context) -> output = [] @@ -282,7 +283,7 @@ class Inline ++i - throw new ParseException 'Malformed inline YAML string '+sequence + throw new ParseMore 'Malformed inline YAML string '+sequence # Parses a mapping to a YAML string. @@ -292,7 +293,7 @@ class Inline # # @return [String] A YAML string # - # @throw [ParseException] When malformed inline YAML string is parsed + # @throw [ParseMore] When malformed inline YAML string is parsed # @parseMapping: (mapping, context) -> output = {} @@ -364,7 +365,7 @@ class Inline if done break - throw new ParseException 'Malformed inline YAML string '+mapping + throw new ParseMore 'Malformed inline YAML string '+mapping # Evaluates scalars and replaces magic values. |