diff options
author | Adrian Thurston <thurston@complang.org> | 2014-12-14 15:43:42 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2014-12-14 15:43:42 -0500 |
commit | c158d3cb4772a37b1ebb6e77d92341658b76ff44 (patch) | |
tree | 565895e63636421e64ce09be259e44c8ab0a4752 /src/parser.cc | |
parent | b4c15bb4bd7e4f84d449987987f38c7c17d68697 (diff) | |
download | colm-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.cc | 5 |
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++ ); } |