summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-03-30 17:28:18 -0400
committerAdrian Thurston <thurston@colm.net>2018-03-30 17:30:07 -0400
commit25e33dd5a8d412fd4f60950ee52fbee892ef97f2 (patch)
treee005d1f4d12ef3a3a599500b51c8c8cde0439524
parenta431f21841b71a843bcd8eafa5a38d9f7dfbe44b (diff)
downloadcolm-25e33dd5a8d412fd4f60950ee52fbee892ef97f2.tar.gz
removed string concatenation from pattern, constructor and string
Only the send accumulator supports string concatenation. Taking this approach avoids ambiguity between a concatenation and a bare send.
-rw-r--r--src/colm.lm9
-rw-r--r--src/loadcolm.cc32
2 files changed, 6 insertions, 35 deletions
diff --git a/src/colm.lm b/src/colm.lm
index 8eb015f0..99112316 100644
--- a/src/colm.lm
+++ b/src/colm.lm
@@ -723,8 +723,7 @@ def pattern_top_el
| [SQOPEN PatternElList: pattern_el* SQCLOSE] :SubList
def pattern_list
- [pattern_list pattern_top_el] :List
-| [pattern_top_el] :Base
+ [pattern_top_el] :Base
def pattern
[pattern_list]
@@ -760,8 +759,7 @@ def cons_top_el
| [SQOPEN ConsElList: cons_el* SQCLOSE] :SubList
def cons_list
- [cons_top_el cons_list] :List
-| [cons_top_el] :Base
+ [cons_top_el] :Base
def constructor
[cons_list]
@@ -814,8 +812,7 @@ def string_top_el
| [SQOPEN StringElList: string_el* SQCLOSE] :SubList
def string_list
- [string_top_el string_list] :List
-| [string_top_el] :Base
+ [string_top_el] :Base
def string
[string_list]
diff --git a/src/loadcolm.cc b/src/loadcolm.cc
index 06acf477..d5a57385 100644
--- a/src/loadcolm.cc
+++ b/src/loadcolm.cc
@@ -638,17 +638,6 @@ struct LoadColm
{
PatternItemList *list = 0;
switch ( patternList.prodName() ) {
- case pattern_list::List: {
-
- PatternItemList *left = walkPatternList(
- patternList._pattern_list(), patternVarRef );
-
- PatternItemList *right = walkPattternTopEl(
- patternList.pattern_top_el(), patternVarRef );
-
- list = patListConcat( left, right );
- break;
- }
case pattern_list::Base: {
list = walkPattternTopEl( patternList.pattern_top_el(), patternVarRef );
break;
@@ -1484,20 +1473,12 @@ struct LoadColm
ConsItemList *walkConsList( cons_list consList, TypeRef *consTypeRef )
{
- ConsItemList *list = walkConsTopEl( consList.cons_top_el(), consTypeRef );
-
- if ( consList._cons_list() != 0 ) {
- ConsItemList *extension = walkConsList( consList._cons_list(), consTypeRef );
- consListConcat( list, extension );
- }
-
- return list;
+ return walkConsTopEl( consList.cons_top_el(), consTypeRef );
}
ConsItemList *walkConstructor( constructor Constructor, TypeRef *consTypeRef )
{
- ConsItemList *list = walkConsList( Constructor.cons_list(), consTypeRef );
- return list;
+ return walkConsList( Constructor.cons_list(), consTypeRef );
}
/*
@@ -1616,14 +1597,7 @@ struct LoadColm
ConsItemList *walkStringList( string_list stringList )
{
- ConsItemList *list = walkStringTopEl( stringList.string_top_el() );
-
- if ( stringList._string_list() != 0 ) {
- ConsItemList *extension = walkStringList( stringList._string_list() );
- consListConcat( list, extension );
- }
-
- return list;
+ return walkStringTopEl( stringList.string_top_el() );
}
ConsItemList *walkString( string String )