Implemented main conversion module.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5587 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-03-10 13:50:53 +00:00
parent 1aaff0ce2f
commit 7563f4096c
5 changed files with 67 additions and 16 deletions

View File

@@ -156,16 +156,16 @@ const Attr* GetAttr (const Collection* C, const char* Name)
const Attr* NeedAttr (const Collection* C, const char* Name, const char* Context)
const Attr* NeedAttr (const Collection* C, const char* Name, const char* Op)
/* Search for an attribute with the given name and return it. If the attribute
* is not found, the function terminates with an error using Context as
* additional context in the error message.
* is not found, the function terminates with an error using Op as additional
* context in the error message.
*/
{
/* Search for the attribute and return it */
unsigned Index;
if (!FindAttr (C, Name, &Index)) {
Error ("Found no attribute named `%s' in %s", Name, Context);
Error ("Found no attribute named `%s' for operation %s", Name, Op);
}
return CollConstAt (C, Index);
}
@@ -183,13 +183,13 @@ const char* GetAttrVal (const Collection* C, const char* Name)
const char* NeedAttrVal (const Collection* C, const char* Name, const char* Context)
const char* NeedAttrVal (const Collection* C, const char* Name, const char* Op)
/* Search for an attribute with the given name and return its value. If the
* attribute wasn't not found, the function terminates with an error using
* Context as additional context in the error message.
* Op as additional context in the error message.
*/
{
const Attr* A = NeedAttr (C, Name, Context);
const Attr* A = NeedAttr (C, Name, Op);
return (A == 0)? 0 : A->Value;
}