second stage lexer */
| 3944 | |
| 3945 | /* second stage lexer */ |
| 3946 | int yylex(void) |
| 3947 | { |
| 3948 | int token; |
| 3949 | |
| 3950 | repeat: |
| 3951 | token = yylex1(); |
| 3952 | |
| 3953 | if (prev_token == T_EOL || prev_token == T_HELPTEXT) { |
| 3954 | if (token == T_EOL) { |
| 3955 | /* Do not pass unneeded T_EOL to the parser. */ |
| 3956 | goto repeat; |
| 3957 | } else { |
| 3958 | /* |
| 3959 | * For the parser, update file/lineno at the first token |
| 3960 | * of each statement. Generally, \n is a statement |
| 3961 | * terminator in Kconfig, but it is not always true |
| 3962 | * because \n could be escaped by a backslash. |
| 3963 | */ |
| 3964 | current_pos.file = current_file; |
| 3965 | current_pos.lineno = yylineno; |
| 3966 | } |
| 3967 | } |
| 3968 | |
| 3969 | if (prev_prev_token == T_EOL && prev_token == T_WORD && |
| 3970 | (token == T_EQUAL || token == T_COLON_EQUAL || token == T_PLUS_EQUAL)) |
| 3971 | BEGIN(ASSIGN_VAL); |
| 3972 | |
| 3973 | prev_prev_token = prev_token; |
| 3974 | prev_token = token; |
| 3975 | |
| 3976 | return token; |
| 3977 | } |
| 3978 | |
| 3979 | static char *expand_token(const char *in, size_t n) |
| 3980 | { |