summaryrefslogtreecommitdiff
path: root/src/colm.lm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-05-24 08:26:26 -0400
committerAdrian Thurston <thurston@colm.net>2019-05-24 08:26:26 -0400
commite52169ed10b0bf0011c2471e1fa7644971d0c7ac (patch)
treedba77918021292531fe13a677e011101a408b13d /src/colm.lm
parent984e6fb6cf25eee7dafe59db2be6b31b3c7c4b26 (diff)
downloadcolm-e52169ed10b0bf0011c2471e1fa7644971d0c7ac.tar.gz
pushing the trim decision to run-time
The trim and no-trim operators are both now in the expression. In places where we want the print mechanism to decide if it trims or not, we lift the trim operator out of the expression and into the send expression, then pass it to the print and send instructions. This way the stream or input (parser) can control the trim (auto_trim feature) with the expression overriding the default.
Diffstat (limited to 'src/colm.lm')
-rw-r--r--src/colm.lm11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/colm.lm b/src/colm.lm
index a8e398cf..3875babd 100644
--- a/src/colm.lm
+++ b/src/colm.lm
@@ -616,6 +616,7 @@ def code_unary
| [DOLLAR code_factor] :Dollar
| [DOLLAR DOLLAR code_factor] :DollarDollar
| [CARET code_factor] :Caret
+| [AT code_factor] :At
| [PERCENT code_factor] :Percent
| [code_factor] :Base
@@ -732,10 +733,6 @@ def pattern
# Constructor List
#
-def opt_no_trim
- [AT] :At
-| [] :Trim
-
def E1 []
def E2 []
def E3 []
@@ -746,7 +743,7 @@ def cons_el
| [E1 DQ LitConsElList: lit_cons_el* dq_lit_term] :Dq
| [E1 SQ SqConsDataList: sq_cons_data* sq_lit_term] :Sq
| [E1 TILDE opt_tilde_data TILDE_NL] :Tilde
-| [E2 opt_no_trim code_expr] :CodeExpr
+| [E2 code_expr] :CodeExpr
def lit_cons_el
[lit_dq_data] :ConsData
@@ -772,7 +769,7 @@ def accum_el
[E1 DQ LitAccumElList: lit_accum_el* dq_lit_term] :Dq
| [E1 SQ SqConsDataList: sq_cons_data* sq_lit_term] :Sq
| [E1 TILDE opt_tilde_data TILDE_NL] :Tilde
-| [E2 opt_no_trim code_expr] :CodeExpr
+| [E2 code_expr] :CodeExpr
def lit_accum_el
[lit_dq_data] :ConsData
@@ -799,7 +796,7 @@ def string_el
[E1 DQ LitStringElList: lit_string_el* dq_lit_term] :Dq
| [E1 SQ SqConsDataList: sq_cons_data* sq_lit_term] :Sq
| [E1 TILDE opt_tilde_data TILDE_NL] :Tilde
-| [E2 opt_no_trim code_expr] :CodeExpr
+| [E2 code_expr] :CodeExpr
def lit_string_el
[lit_dq_data] :ConsData