summaryrefslogtreecommitdiff
path: root/src/Inline.coffee
diff options
context:
space:
mode:
authorJérémy Faivre <contact@jeremyfa.com>2017-02-12 00:39:06 +0100
committerGitHub <noreply@github.com>2017-02-12 00:39:06 +0100
commit5e74781976ad23645970eb192f2d83a324e7c95f (patch)
treea8860fc3255992224b5567190bc3a8043b7d2121 /src/Inline.coffee
parent0ce1c7eb73474a1c0ad5edeec112427b095b154f (diff)
parent1e8d6dd845e0f59dd88c28615ad8702e4a59c0d9 (diff)
downloadyamljs-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.coffee13
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.