MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / PAR_native_value

Function PAR_native_value

src/gpre/par.cpp:920–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918//
919
920TEXT* 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] == '\'')) {

Callers 15

EXP_subscriptFunction · 0.85
par_native_valueFunction · 0.85
SQL_var_or_stringFunction · 0.85
act_describeFunction · 0.85
act_executeFunction · 0.85
act_fetchFunction · 0.85
act_prepareFunction · 0.85
act_set_namesFunction · 0.85
act_set_transactionFunction · 0.85
par_intoFunction · 0.85
par_optionsFunction · 0.85
par_usingFunction · 0.85

Calls 5

isQuotedFunction · 0.85
gobbleFunction · 0.85
CPR_s_errorFunction · 0.85
MSC_allocFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected