From b393cbaa4847ec4f63a928593f79a22b7337a838 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 18 Apr 2019 20:44:33 -0500 Subject: [PATCH] Normalize text concat as interpolation --- lib/dhall/ast.rb | 4 ---- lib/dhall/normalize.rb | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/dhall/ast.rb b/lib/dhall/ast.rb index 5b5c005..b1bb908 100644 --- a/lib/dhall/ast.rb +++ b/lib/dhall/ast.rb @@ -41,10 +41,6 @@ module Dhall end end - def <<(other) - Operator::TextConcatenate.new(lhs: self, rhs: other) - end - def concat(other) Operator::ListConcatenate.new(lhs: self, rhs: other) end diff --git a/lib/dhall/normalize.rb b/lib/dhall/normalize.rb index 272d08b..9f7ec63 100644 --- a/lib/dhall/normalize.rb +++ b/lib/dhall/normalize.rb @@ -199,14 +199,7 @@ module Dhall class TextConcatenate def normalize - normalized = super - if normalized.lhs == Text.new(value: "") - normalized.rhs - elsif normalized.rhs == Text.new(value: "") - normalized.lhs - else - normalized.lhs << normalized.rhs - end + TextLiteral.for(lhs, rhs).normalize end end -- 2.34.5