~singpolyma/dhall-ruby

5d49b504946f6ec1541b87e5091e9535e0754b99 — Stephen Paul Weber 3 years ago 7f98d0a
Allow tabs and blank lines in multiline strings
1 files changed, 3 insertions(+), 3 deletions(-)

M lib/dhall/parser.rb
M lib/dhall/parser.rb => lib/dhall/parser.rb +3 -3
@@ 276,9 276,9 @@ module Dhall
		module SingleQuoteLiteral
			def value
				chunks = capture(:single_quote_continue).value
				indent = chunks.join.split(/\n/, -1).map { |line|
					line.match(/^( *|\t*)/).to_s.length
				}.min
				raw = chunks.join + "\n"
				indent = raw.scan(/^[ \t]*(?=[^ \t\r\n])/).map(&:length).min
				indent = 0 if raw.end_with?("\n\n")

				TextLiteral.for(
					*chunks