From 84f764672525cd475114b76b104fc1bc0e6ce5b2 Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Sat, 1 Oct 2016 09:34:21 -0700 Subject: auto-trim in print, send and construct, disable with @ Now automatically trimming when building trees and printing. This is consistent with the $ operator. Rationale is to standardize on the most commonly desired behaviour and provide options for the less-needed. Also much less likely to result in surprising output. There are many cases where test inputs won't have any surrounding ignores, making it easy to forget a trim is required. Then the occasional tree with surrounding ignores will give an undesired result. Better to standardize on trim, making the default behaviour more consistent. The trim can be turned off with the @ operator in front of an expression. --- src/consinit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/consinit.cc') diff --git a/src/consinit.cc b/src/consinit.cc index 61b84f8b..397b8ecd 100644 --- a/src/consinit.cc +++ b/src/consinit.cc @@ -792,7 +792,7 @@ void ConsInit::parseInput( StmtList *stmtList ) LangExpr *open = LangExpr::cons( LangTerm::cons( InputLoc(), openRef, openArgs ) ); /* Construct a list containing the open stream. */ - ConsItem *consItem = ConsItem::cons( internal, ConsItem::ExprType, open ); + ConsItem *consItem = ConsItem::cons( internal, ConsItem::ExprType, open, false ); ConsItemList *list = ConsItemList::cons( consItem ); /* Will capture the parser to "P" */ -- cgit v1.2.1