| 918 | // |
| 919 | |
| 920 | TEXT* PAR_native_value(bool array_ref, bool handle_ref) |
| 921 | { |
| 922 | SCHAR buffer[512]; |
| 923 | |
| 924 | SCHAR* string = buffer; |
| 925 | |
| 926 | while (true) |
| 927 | { |
| 928 | // PAR_native_values copies the string constants. These are |
| 929 | // passed to api calls. Make sure to enclose these with |
| 930 | // double quotes. |
| 931 | |
| 932 | if (gpreGlob.sw_sql_dialect == 1) |
| 933 | { |
| 934 | if (isQuoted(gpreGlob.token_global.tok_type)) |
| 935 | { |
| 936 | //const tok_t typ = gpreGlob.token_global.tok_type; |
| 937 | gpreGlob.token_global.tok_length += 2; |
| 938 | *string++ = '\"'; |
| 939 | gobble(string); |
| 940 | *string++ = '\"'; |
| 941 | break; |
| 942 | } |
| 943 | } |
| 944 | else if (gpreGlob.sw_sql_dialect == 2) |
| 945 | { |
| 946 | if (gpreGlob.token_global.tok_type == tok_dblquoted) |
| 947 | PAR_error("Ambiguous use of double quotes in dialect 2"); |
| 948 | else if (gpreGlob.token_global.tok_type == tok_sglquoted) |
| 949 | { |
| 950 | gpreGlob.token_global.tok_length += 2; |
| 951 | *string++ = '\"'; |
| 952 | gobble(string); |
| 953 | *string++ = '\"'; |
| 954 | break; |
| 955 | } |
| 956 | } |
| 957 | else if (gpreGlob.sw_sql_dialect == 3) |
| 958 | { |
| 959 | if (gpreGlob.token_global.tok_type == tok_sglquoted) |
| 960 | { |
| 961 | gpreGlob.token_global.tok_length += 2; |
| 962 | *string++ = '\"'; |
| 963 | gobble(string); |
| 964 | *string++ = '\"'; |
| 965 | break; |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | if (gpreGlob.token_global.tok_keyword == KW_AMPERSAND || gpreGlob.token_global.tok_keyword == KW_ASTERISK) |
| 970 | gobble(string); |
| 971 | if (gpreGlob.token_global.tok_type != tok_ident) |
| 972 | CPR_s_error("identifier"); |
| 973 | gobble(string); |
| 974 | |
| 975 | // For ADA, gobble '<attribute> |
| 976 | |
| 977 | if ((gpreGlob.sw_language == lang_ada) && (gpreGlob.token_global.tok_string[0] == '\'')) { |
no test coverage detected