Permalink
Browse files

Steven's patch fixing space issues.

  • Loading branch information...
andyv
andyv committed Apr 6, 2002
1 parent afcfdeb commit b9e4e35b659e4863ff1c04dbe2125bfb6478b95f
Showing with 14 additions and 6 deletions.
  1. +2 −1 decl.c
  2. +12 −5 interface.c
View
3 decl.c
@@ -1773,7 +1773,8 @@ g95_symbol *sym;
int operator;
match m;
- g95_match(" ::");
+ if (g95_match(" ::") == MATCH_NO && g95_match_space() == MATCH_NO)
+ goto done;
for(;;) {
m = g95_match_generic_spec(&type, name, &operator);
View
@@ -120,19 +120,19 @@ char buffer[G95_MAX_SYMBOL_LEN+1];
match m;
int i;
- if (g95_match("% assignment ( = )") == MATCH_YES) {
+ if (g95_match(" assignment ( = )") == MATCH_YES) {
*type = INTERFACE_INTRINSIC_OP;
*operator = INTRINSIC_ASSIGN;
return MATCH_YES;
}
- if (g95_match("% operator ( %o )", &i) == MATCH_YES) { /* Operator i/f */
+ if (g95_match(" operator ( %o )", &i) == MATCH_YES) { /* Operator i/f */
*type = INTERFACE_INTRINSIC_OP;
*operator = fold_unary(i);
return MATCH_YES;
}
- if (g95_match("% operator ( ") == MATCH_YES) {
+ if (g95_match(" operator ( ") == MATCH_YES) {
m = g95_match_defined_op_name(buffer, 1);
if (m == MATCH_NO) goto syntax;
if (m != MATCH_YES) return MATCH_ERROR;
@@ -169,11 +169,15 @@ char name[G95_MAX_SYMBOL_LEN+1];
interface_type type;
g95_symbol *sym;
int operator;
+match m;
+
+ m = g95_match_space();
if (g95_match_generic_spec(&type, name, &operator) == MATCH_ERROR)
return MATCH_ERROR;
- if (g95_match_eos() != MATCH_YES) {
+ if (g95_match_eos() != MATCH_YES ||
+ (type != INTERFACE_NAMELESS && m != MATCH_YES)) {
g95_syntax_error(ST_INTERFACE);
return MATCH_ERROR;
}
@@ -215,10 +219,13 @@ interface_type type;
int operator;
match m;
+ m = g95_match_space();
+
if (g95_match_generic_spec(&type, name, &operator) == MATCH_ERROR)
return MATCH_ERROR;
- if (g95_match_eos() != MATCH_YES) {
+ if (g95_match_eos() != MATCH_YES ||
+ (type != INTERFACE_NAMELESS && m != MATCH_YES)) {
g95_syntax_error(ST_END_INTERFACE);
return MATCH_ERROR;
}

0 comments on commit b9e4e35

Please sign in to comment.