| 1003 | // |
| 1004 | |
| 1005 | tok* CPR_eol_token() |
| 1006 | { |
| 1007 | if (gpreGlob.sw_language != lang_fortran) |
| 1008 | return CPR_token(); |
| 1009 | |
| 1010 | // Save the information from the previous token |
| 1011 | |
| 1012 | gpreGlob.prior_token = gpreGlob.token_global; |
| 1013 | gpreGlob.prior_token.tok_position = last_position; |
| 1014 | |
| 1015 | last_position = gpreGlob.token_global.tok_position + gpreGlob.token_global.tok_length + |
| 1016 | gpreGlob.token_global.tok_white_space - 1; |
| 1017 | TEXT* p = gpreGlob.token_global.tok_string; |
| 1018 | SSHORT num_chars = 0; |
| 1019 | |
| 1020 | // skip spaces |
| 1021 | |
| 1022 | SSHORT c; |
| 1023 | for (c = nextchar(); c == ' '; c = nextchar()) |
| 1024 | { |
| 1025 | num_chars++; |
| 1026 | *p++ = (TEXT) c; |
| 1027 | } |
| 1028 | |
| 1029 | // in-line comments are equivalent to end of line |
| 1030 | |
| 1031 | if (c == '!') |
| 1032 | { |
| 1033 | while (c != '\n' && c != EOF) |
| 1034 | { |
| 1035 | c = nextchar(); |
| 1036 | num_chars++; |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | // in-line SQL comments are equivalent to end of line |
| 1041 | |
| 1042 | if (gpreGlob.sw_sql && (c == '-')) |
| 1043 | { |
| 1044 | const SSHORT peek = nextchar(); |
| 1045 | if (peek != '-') |
| 1046 | return_char(peek); |
| 1047 | else |
| 1048 | { |
| 1049 | while (c != '\n' && c != EOF) |
| 1050 | { |
| 1051 | c = nextchar(); |
| 1052 | num_chars++; |
| 1053 | } |
| 1054 | last_position = position - 1; |
| 1055 | } |
| 1056 | } |
| 1057 | |
| 1058 | if (c == EOF) |
| 1059 | { |
| 1060 | gpreGlob.token_global.tok_symbol = NULL; |
| 1061 | gpreGlob.token_global.tok_keyword = KW_none; |
| 1062 | return NULL; |
no test coverage detected