summaryrefslogtreecommitdiff
path: root/src/parser.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2014-12-14 15:43:42 -0500
committerAdrian Thurston <thurston@complang.org>2014-12-14 15:43:42 -0500
commitc158d3cb4772a37b1ebb6e77d92341658b76ff44 (patch)
tree565895e63636421e64ce09be259e44c8ab0a4752 /src/parser.cc
parentb4c15bb4bd7e4f84d449987987f38c7c17d68697 (diff)
downloadcolm-c158d3cb4772a37b1ebb6e77d92341658b76ff44.tar.gz
added struct, struct field and corresponding instructions
Can new and set/get the fields of a struct. Still using underlying tree object to implement.
Diffstat (limited to 'src/parser.cc')
-rw-r--r--src/parser.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser.cc b/src/parser.cc
index 78f8df95..264508cd 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -869,7 +869,8 @@ void BaseParser::contextVarDef( const InputLoc &loc, ObjectField *objField )
object->rootScope->insertField( objField->name, objField );
}
-void BaseParser::contextHead( const InputLoc &loc, const String &data )
+void BaseParser::contextHead( const InputLoc &loc, const String &data,
+ ObjectDef::Type objectType )
{
/* Make the new namespace. */
Namespace *nspace = createNamespace( loc, data );
@@ -880,7 +881,7 @@ void BaseParser::contextHead( const InputLoc &loc, const String &data )
ContextDef *contextDef = new ContextDef( data, context, nspace );
nspace->contextDefList.append( contextDef );
- context->objectDef = ObjectDef::cons( ObjectDef::UserType,
+ context->objectDef = ObjectDef::cons( objectType,
data, pd->nextObjectId++ );
}