Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mango.y warning "stray `@'" #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions MangoFix/Compiler/lex_yacc/mango.y
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
%{
#define YYDEBUG 1
#define YYERROR_VERBOSE
#define AT @
#import <Foundation/Foundation.h>
#import "create.h"
#import "mf_ast.h"
Expand Down Expand Up @@ -534,7 +535,7 @@ method_name_2: method_name_item
method_name_item: IDENTIFIER COLON LP type_specifier RP IDENTIFIER
{
NSString *name = (__bridge_transfer NSString *)$1;
name = [NSString stringWithFormat:@"%@:",name];
name = [NSString stringWithFormat:AT"%@:",name];
MFTypeSpecifier *typeSpecifier = (__bridge_transfer MFTypeSpecifier *)$4;
NSString *paramName = (__bridge_transfer NSString *)$6;
MFMethodNameItem *item = mf_create_method_name_item(name, typeSpecifier, paramName);
Expand Down Expand Up @@ -573,14 +574,14 @@ selector_1: IDENTIFIER
selector_2: selector_1 COLON
{
NSString *name = (__bridge_transfer NSString *)$1;
NSString *selector = [NSString stringWithFormat:@"%@:",name];
NSString *selector = [NSString stringWithFormat:AT"%@:",name];
$$ = (__bridge_retained void *)selector;
}
| selector_2 selector_1 COLON
{
NSString *name1 = (__bridge_transfer NSString *)$1;
NSString *name2 = (__bridge_transfer NSString *)$2;
NSString *selector = [NSString stringWithFormat:@"%@%@:", name1, name2];
NSString *selector = [NSString stringWithFormat:AT"%@%@:", name1, name2];
$$ = (__bridge_retained void *)selector;
}
;
Expand Down Expand Up @@ -881,15 +882,15 @@ c_type_identier: key_work_identifier
| IDENTIFIER
| VOID ASTERISK
{
$$ = (__bridge_retained void *)@"void *";
$$ = (__bridge_retained void *)AT"void *";
}
| CHAR ASTERISK
{
$$ = (__bridge_retained void *)@"char *";
$$ = (__bridge_retained void *)AT"char *";
}
| STRUCT IDENTIFIER
{
$$ = (__bridge_retained void *)[NSString stringWithFormat:@"struct %@",(__bridge_transfer NSString *)$2];
$$ = (__bridge_retained void *)[NSString stringWithFormat:AT"struct %@",(__bridge_transfer NSString *)$2];
}
;

Expand All @@ -911,43 +912,43 @@ c_type_identier_list:c_type_identier

key_work_identifier: ID
{
$$ = (__bridge_retained void *)@"id";
$$ = (__bridge_retained void *)AT"id";
}
| CLASS
{
$$ = (__bridge_retained void *)@"class";
$$ = (__bridge_retained void *)AT"class";
}
| CLASS_
{
$$ = (__bridge_retained void *)@"Class";
$$ = (__bridge_retained void *)AT"Class";
}
| COPY
{
$$ = (__bridge_retained void *)@"copy";
$$ = (__bridge_retained void *)AT"copy";
}
| BOOL_
{
$$ = (__bridge_retained void *)@"BOOL";
$$ = (__bridge_retained void *)AT"BOOL";
}
| INT
{
$$ = (__bridge_retained void *)@"int";
$$ = (__bridge_retained void *)AT"int";
}
| U_INT
{
$$ = (__bridge_retained void *)@"uint";
$$ = (__bridge_retained void *)AT"uint";
}
| DOUBLE
{
$$ = (__bridge_retained void *)@"double";
$$ = (__bridge_retained void *)AT"double";
}
| SEL_
{
$$ = (__bridge_retained void *)@"SEL";
$$ = (__bridge_retained void *)AT"SEL";
}
| VOID
{
$$ = (__bridge_retained void *)@"void";
$$ = (__bridge_retained void *)AT"void";
}
;

Expand Down