~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2011-02-26 22:20:15 UTC
  • mto: This revision was merged to the branch mainline in revision 2204.
  • Revision ID: brian@tangent.org-20110226222015-69p537r7dj4rlu4l
Fix white space in lexer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1061
1061
      lip->yyUnget();                   // Safety against eof
1062
1062
      state = MY_LEX_START;             // Try again
1063
1063
      break;
 
1064
 
1064
1065
    case MY_LEX_LONG_COMMENT:           /* Long C comment? */
1065
1066
      if (lip->yyPeek() != '*')
1066
1067
      {
1158
1159
      lip->in_comment= NO_COMMENT;
1159
1160
      lip->set_echo(true);
1160
1161
      break;
 
1162
 
1161
1163
    case MY_LEX_END_LONG_COMMENT:
1162
1164
      if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/')
1163
1165
      {
1174
1176
      else
1175
1177
        state=MY_LEX_CHAR;              // Return '*'
1176
1178
      break;
 
1179
 
1177
1180
    case MY_LEX_SET_VAR:                // Check if ':='
1178
1181
      if (lip->yyPeek() != '=')
1179
1182
      {
1182
1185
      }
1183
1186
      lip->yySkip();
1184
1187
      return (SET_VAR);
 
1188
 
1185
1189
    case MY_LEX_SEMICOLON:                      // optional line terminator
1186
1190
      if (lip->yyPeek())
1187
1191
      {
1190
1194
      }
1191
1195
      lip->next_state=MY_LEX_END;       // Mark for next loop
1192
1196
      return(END_OF_INPUT);
 
1197
 
1193
1198
    case MY_LEX_EOL:
1194
1199
      if (lip->eof())
1195
1200
      {
1205
1210
      }
1206
1211
      state=MY_LEX_CHAR;
1207
1212
      break;
 
1213
 
1208
1214
    case MY_LEX_END:
1209
1215
      lip->next_state=MY_LEX_END;
1210
1216
      return false;                     // We found end of input last time
1211
1217
 
1212
1218
      /* Actually real shouldn't start with . but allow them anyhow */
 
1219
 
1213
1220
    case MY_LEX_REAL_OR_POINT:
1214
1221
      if (my_isdigit(cs,lip->yyPeek()))
1215
1222
        state= MY_LEX_REAL;             // Real
1219
1226
        lip->yyUnget();                 // Put back '.'
1220
1227
      }
1221
1228
      break;
 
1229
 
1222
1230
    case MY_LEX_USER_END:               // end '@' of user@hostname
1223
1231
      switch (state_map[(uint8_t)lip->yyPeek()]) {
1224
1232
      case MY_LEX_STRING:
1235
1243
      yylval->lex_str.str=(char*) lip->get_ptr();
1236
1244
      yylval->lex_str.length=1;
1237
1245
      return((int) '@');
 
1246
 
1238
1247
    case MY_LEX_HOSTNAME:               // end '@' of user@hostname
1239
1248
      for (c=lip->yyGet() ;
1240
1249
           my_isalnum(cs,c) || c == '.' || c == '_' ||  c == '$';
1241
1250
           c= lip->yyGet()) ;
1242
1251
      yylval->lex_str=get_token(lip, 0, lip->yyLength());
1243
1252
      return(LEX_HOSTNAME);
 
1253
 
1244
1254
    case MY_LEX_SYSTEM_VAR:
1245
1255
      yylval->lex_str.str=(char*) lip->get_ptr();
1246
1256
      yylval->lex_str.length=1;
1250
1260
                        MY_LEX_OPERATOR_OR_IDENT :
1251
1261
                        MY_LEX_IDENT_OR_KEYWORD);
1252
1262
      return((int) '@');
 
1263
 
1253
1264
    case MY_LEX_IDENT_OR_KEYWORD:
1254
1265
      /*
1255
1266
        We come here when we have found two '@' in a row.
1263
1274
 
1264
1275
      if (c == '.')
1265
1276
        lip->next_state=MY_LEX_IDENT_SEP;
 
1277
 
1266
1278
      length= lip->yyLength();
1267
1279
      if (length == 0)
1268
1280
        return(ABORT_SYM);              // Names must be nonempty.
 
1281
 
1269
1282
      if ((tokval= find_keyword(lip, length,0)))
1270
1283
      {
1271
1284
        lip->yyUnget();                         // Put back 'c'