@@ -345,19 +345,36 @@ private function hMacro_EvalZ( byval arg as zstring ptr, byval errnum as integer
345345 '' prevent cExpression from writing to .pp.bas file
346346 lex.ctx->reclevel += 1
347347
348- DZstrAssign( lex.ctx->deftext, *arg )
349- lex.ctx->defptr = lex.ctx->deftext.data
350- lex.ctx->deflen += len( *arg )
348+ '' ascii
349+ if ( env.inf.format = FBFILE_FORMAT_ASCII ) then
350+ DZstrAssign( lex.ctx->deftext, *arg )
351+ lex.ctx->defptr = lex.ctx->deftext.data
352+ lex.ctx->deflen += len( *arg )
353+
354+ '' Add an end of expression marker so that the parser
355+ '' doesn't read past the end of the expression text
356+ '' by appending an LFCHAR to the end of the expression
357+ '' It would be better to use the explicit EOF character,
358+ '' but we can't appened an extra NUL character to a zstring
359+
360+ DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
361+ lex.ctx->defptr = lex.ctx->deftext.data
362+ lex.ctx->deflen += len( LFCHAR )
363+
364+ '' unicode
365+ else
366+ DWstrAssignA( lex.ctx->deftextw, *arg )
367+ lex.ctx->defptrw = lex.ctx->deftextw.data
368+ lex.ctx->deflen += len( *arg )
369+
370+ '' Add an end of expression marker so that the parser
371+ '' (see above)
351372
352- '' Add an end of expression marker so that the parser
353- '' doesn't read past the end of the expression text
354- '' by appending an LFCHAR to the end of the expression
355- '' It would be better to use the explicit EOF character,
356- '' but we can't appened an extra NUL character to a zstring
373+ DWstrConcatAssignA( lex.ctx->deftextw, LFCHAR )
374+ lex.ctx->defptrw = lex.ctx->deftextw.data
375+ lex.ctx->deflen += len( LFCHAR )
357376
358- DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
359- lex.ctx->defptr = lex.ctx->deftext.data
360- lex.ctx->deflen += len( LFCHAR )
377+ end if
361378
362379 dim expr as ASTNODE ptr = cExpression( )
363380 var errmsg = FB_ERRMSG_OK
@@ -432,19 +449,36 @@ private function hMacro_EvalW( byval arg as wstring ptr, byval errnum as integer
432449 '' prevent cExpression from writing to .pp.bas file
433450 lex.ctx->reclevel += 1
434451
435- DWstrAssign( lex.ctx->deftextw, *arg )
436- lex.ctx->defptrw = lex.ctx->deftextw.data
437- lex.ctx->deflen += len( *arg )
452+ '' ascii
453+ if ( env.inf.format = FBFILE_FORMAT_ASCII ) then
454+ DZstrAssignW( lex.ctx->deftext, *arg )
455+ lex.ctx->defptr = lex.ctx->deftext.data
456+ lex.ctx->deflen += len( *arg )
438457
439- '' Add an end of expression marker so that the parser
440- '' doesn't read past the end of the expression text
441- '' by appending an LFCHAR to the end of the expression
442- '' It would be better to use the explicit EOF character,
443- '' but we can't appened an extra NUL character to a zstring
458+ '' Add an end of expression marker so that the parser
459+ '' doesn't read past the end of the expression text
460+ '' by appending an LFCHAR to the end of the expression
461+ '' It would be better to use the explicit EOF character,
462+ '' but we can't appened an extra NUL character to a zstring
463+
464+ DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
465+ lex.ctx->defptr = lex.ctx->deftext.data
466+ lex.ctx->deflen += len( LFCHAR )
467+
468+ ''unicode
469+ else
470+ DWstrAssign( lex.ctx->deftextw, *arg )
471+ lex.ctx->defptrw = lex.ctx->deftextw.data
472+ lex.ctx->deflen += len( *arg )
444473
445- DWstrConcatAssign( lex.ctx->deftextw, LFCHAR )
446- lex.ctx->defptrw = lex.ctx->deftextw.data
447- lex.ctx->deflen += len( LFCHAR )
474+ '' Add an end of expression marker so that the parser
475+ '' (see above)
476+
477+ DWstrConcatAssignA( lex.ctx->deftextw, LFCHAR )
478+ lex.ctx->defptrw = lex.ctx->deftextw.data
479+ lex.ctx->deflen += len( LFCHAR )
480+
481+ end if
448482
449483 dim expr as ASTNODE ptr = cExpression( )
450484 var errmsg = FB_ERRMSG_OK
@@ -1037,13 +1071,27 @@ private function hDefQuerySymZ_cb( byval argtb as LEXPP_ARGTB ptr, byval errnum
10371071 '' prevent cExpression from writing to .pp.bas file
10381072 lex.ctx->reclevel += 1
10391073
1040- DZstrAssign( lex.ctx->deftext, *sexpr )
1041- lex.ctx->defptr = lex.ctx->deftext.data
1042- lex.ctx->deflen += len( *sexpr )
1074+ '' ascii
1075+ if ( env.inf.format = FBFILE_FORMAT_ASCII ) then
1076+ DZstrAssign( lex.ctx->deftext, *sexpr )
1077+ lex.ctx->defptr = lex.ctx->deftext.data
1078+ lex.ctx->deflen += len( *sexpr )
10431079
1044- DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
1045- lex.ctx->defptr = lex.ctx->deftext.data
1046- lex.ctx->deflen += len( LFCHAR )
1080+ DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
1081+ lex.ctx->defptr = lex.ctx->deftext.data
1082+ lex.ctx->deflen += len( LFCHAR )
1083+
1084+ '' unicode
1085+ else
1086+ DWstrAssignA( lex.ctx->deftextw, *sexpr )
1087+ lex.ctx->defptrw = lex.ctx->deftextw.data
1088+ lex.ctx->deflen += len( *sexpr )
1089+
1090+ DWstrConcatAssignA( lex.ctx->deftextw, LFCHAR )
1091+ lex.ctx->defptrw = lex.ctx->deftextw.data
1092+ lex.ctx->deflen += len( LFCHAR )
1093+
1094+ end if
10471095
10481096 '' if filtervalue is zero then set the default methods to use for
10491097 '' look-up depending on what we are looking for
@@ -1133,13 +1181,27 @@ private function hDefQuerySymZ_cb( byval argtb as LEXPP_ARGTB ptr, byval errnum
11331181 '' reset the current lexer context and refresh the text to parse.
11341182 lexInit( FALSE , TRUE )
11351183
1136- DZstrAssign( lex.ctx->deftext, *sexpr )
1137- lex.ctx->defptr = lex.ctx->deftext.data
1138- lex.ctx->deflen += len( *sexpr )
1184+ '' ascii
1185+ if ( env.inf.format = FBFILE_FORMAT_ASCII ) then
1186+ DZstrAssign( lex.ctx->deftext, *sexpr )
1187+ lex.ctx->defptr = lex.ctx->deftext.data
1188+ lex.ctx->deflen += len( *sexpr )
11391189
1140- DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
1141- lex.ctx->defptr = lex.ctx->deftext.data
1142- lex.ctx->deflen += len( LFCHAR )
1190+ DZstrConcatAssign( lex.ctx->deftext, LFCHAR )
1191+ lex.ctx->defptr = lex.ctx->deftext.data
1192+ lex.ctx->deflen += len( LFCHAR )
1193+
1194+ '' unicode
1195+ else
1196+ DWstrAssignA( lex.ctx->deftextw, *sexpr )
1197+ lex.ctx->defptrw = lex.ctx->deftextw.data
1198+ lex.ctx->deflen += len( *sexpr )
1199+
1200+ DWstrConcatAssignA( lex.ctx->deftextw, LFCHAR )
1201+ lex.ctx->defptrw = lex.ctx->deftextw.data
1202+ lex.ctx->deflen += len( LFCHAR )
1203+
1204+ end if
11431205 end if
11441206
11451207 end if
0 commit comments