From c9ff691c82b565224be74bc89767cf9e61c0a960 Mon Sep 17 00:00:00 2001 From: Adrian Thurston Date: Sun, 28 Jun 2020 11:31:56 +0300 Subject: replced bare send syntax whith << and <- forms Elimintates associated ambiguity between extending statements and starting a new one. Bare send was a nice idea, but it is too much for the language to bear. --- src/colm.lm | 7 ++++++- src/loadfinal.cc | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/colm.lm b/src/colm.lm index 16a9eeb5..9deb3d90 100644 --- a/src/colm.lm +++ b/src/colm.lm @@ -126,6 +126,8 @@ lex token AMP_AMP /'&&'/ token BAR_BAR /'||'/ token DOT_DOT_DOT /'...'/ + token LT_LT /'<<'/ + token LARROW /'<-'/ ignore / ( '\n' | '\t' | ' ' )+ / ignore / '#' . ( ^'\n' )* . '\n' / @@ -540,6 +542,9 @@ def case_clause_list # to the clauses, which is is a better commit strategy anyways. Gives more # regular commits. +def bare_tok + [LT_LT] | [LARROW] + def statement [print_stmt] :Print commit | [var_def opt_def_init] :VarDef commit @@ -555,7 +560,7 @@ def statement | [REJECT] :Reject commit | [var_ref POPEN call_arg_list PCLOSE] :Call | [stmt_or_factor] :StmtOrFactor -| [accumulate opt_eos] :BareSend +| [bare_tok accumulate opt_eos] :BareSend def elsif_list [elsif_clause elsif_list] :Clause diff --git a/src/loadfinal.cc b/src/loadfinal.cc index d478a446..52481bed 100644 --- a/src/loadfinal.cc +++ b/src/loadfinal.cc @@ -111,9 +111,9 @@ struct LoadColm /* Checking if we are outdented. Indents and are ok. So is * outdenting back to the first. */ if ( loc->column < firstColumn ) { - warning( loc ) << type << " literal outdented beyond first at " << - firstLine << ":" << firstColumn << - ", possible unintended concatenation" << std::endl; + // warning( loc ) << type << " literal outdented beyond first at " << + // firstLine << ":" << firstColumn << + // ", possible unintended concatenation" << std::endl; } lastLine = loc->line; -- cgit v1.2.1