summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2020-06-28 11:31:56 +0300
committerAdrian Thurston <thurston@colm.net>2020-07-18 10:39:35 +0300
commitc9ff691c82b565224be74bc89767cf9e61c0a960 (patch)
tree660fa0cb7c7c1f26293f2d286bf03eb2efd791fa /src
parente9d02062b2e588ca22efcd68e8bf1586c0b88a31 (diff)
downloadcolm-c9ff691c82b565224be74bc89767cf9e61c0a960.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/colm.lm7
-rw-r--r--src/loadfinal.cc6
2 files changed, 9 insertions, 4 deletions
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;