summaryrefslogtreecommitdiff
path: root/src/parser.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2014-12-13 16:12:54 -0500
committerAdrian Thurston <thurston@complang.org>2014-12-13 16:13:10 -0500
commitb8bd364697e7a148359c7fbedf689f17a1e6f171 (patch)
treef47c8e31f1294f6909647c851e372fa60f3e41c7 /src/parser.cc
parentf251e1d169b8f578448974fa47f5512651d6ea11 (diff)
downloadcolm-b8bd364697e7a148359c7fbedf689f17a1e6f171.tar.gz
specify the type of the ObjectField when it is created
When creating an ObjectField, specify the internal type for use later on.
Diffstat (limited to 'src/parser.cc')
-rw-r--r--src/parser.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/parser.cc b/src/parser.cc
index fa7efccf..37766315 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -483,7 +483,8 @@ LexFactorAug *BaseParser::lexFactorLabel( const InputLoc &loc,
{
/* Create the object field. */
TypeRef *typeRef = TypeRef::cons( loc, pd->uniqueTypeStr );
- ObjectField *objField = ObjectField::cons( loc, typeRef, data );
+ ObjectField *objField = ObjectField::cons( loc,
+ ObjectField::LexSubstrType, typeRef, data );
/* Create the enter and leaving actions that will mark the substring. */
Action *enter = Action::cons( MarkMark, pd->nextMatchEndNum++ );
@@ -596,7 +597,8 @@ PatternItemList *BaseParser::consPatternEl( LangVarRef *varRef, PatternItemList
}
TypeRef *typeRef = list->head->prodEl->typeRef;
- ObjectField *objField = ObjectField::cons( InputLoc(), typeRef, varRef->name );
+ ObjectField *objField = ObjectField::cons( InputLoc(),
+ ObjectField::UserLocalType, typeRef, varRef->name );
/* Insert it into the field map. */
curScope->insertField( varRef->name, objField );
@@ -660,7 +662,8 @@ LangStmt *BaseParser::forScope( const InputLoc &loc, const String &data,
/* Note that we pass in a null type reference. This type is dependent on
* the result of the iter_call lookup since it must contain a reference to
* the iterator that is called. This lookup is done at compile time. */
- ObjectField *iterField = ObjectField::cons( loc, (TypeRef*)0, data );
+ ObjectField *iterField = ObjectField::cons( loc,
+ ObjectField::UserLocalType, (TypeRef*)0, data );
curScope->insertField( data, iterField );
LangStmt *stmt = LangStmt::cons( loc, LangStmt::ForIterType,
@@ -894,10 +897,10 @@ ParameterList *BaseParser::appendParam( ParameterList *paramList, ObjectField *o
return paramList;
}
-ObjectField *BaseParser::addParam( const InputLoc &loc, TypeRef *typeRef,
- const String &name )
+ObjectField *BaseParser::addParam( const InputLoc &loc,
+ ObjectField::Type type, TypeRef *typeRef, const String &name )
{
- ObjectField *objField = ObjectField::cons( loc, typeRef, name );
+ ObjectField *objField = ObjectField::cons( loc, type, typeRef, name );
objField->isParam = true;
return objField;
}