Project

General

Profile

Bug #10988

Extra quote is not generated during preprocessing when alternative for two quotes/apostrophes is used.

Added by Octavian Adrian Gavril 7 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
4GL Preprocessor

Related issues

Related to Testing - Support #6859: preprocessor tests Test
Related to Conversion Tools - Bug #10569: Semicolon is skipped while preprocessing Internal Test
Related to Conversion Tools - Bug #11250: Tilde is not duplicating the next character. New

History

#1 Updated by Octavian Adrian Gavril 7 months ago

Take a look at this OE example:

def var a as char.
a = 's '~' s'.   // '~' -> '' -> ' (two escape layers)
message a.
a = 's ';?' s'.  // ;? is ~ so it would have the same effect
message a.
a = "s '~' s".   // here is no need to escape ' and the tilde is dropped 
message a.
a = 's '' s'.    // '' -> '
message a.
a = 's ~' s'.    // simple ' escape
message a.

a = "d "~" d".   // "~" -> "" -> " (two escape layers)
message a.
a = "d ";?" d".  // ;? is ~ so it would have the same effect
message a.
a = 'd "~" d'.   // here is no need to escape " and the tilde is dropped
message a.
a= "d "" d".     // "" -> " 
message a.
a = "d ~" d".    // simple " escape
message a.

I run COMPILE testcase.p PREPROCESS output.txt SAVE. and this is the output:

def var a as char.
a = 's '~'' s'.   // '~' -> '' -> ' (two escape layers)

message a.
a = 's '~'' s'.  // ~ is ~ so it would have the same effect

message a.
a = "s '~' s".   // here is no need to escape ' and the tilde is dropped 

message a.
a = 's '' s'.    // '' -> '

message a.
a = 's ~' s'.    // simple ' escaped

message a.

a = "d "~"" d".   // "~" -> "" -> " (two escape layers)

message a.
a = "d "~"" d".  // ~ is ~ so it would have the same effect

message a.
a = 'd "~" d'.   // here is no need to escape " and the tilde is dropped

message a.
a= "d "" d".     // "" -> " 

message a.
a = "d ~" d".    // simple " escaped

message a.

When we use '~'/"~", OE is generating an extra '/". This happens only when the escape is needed, implicit only in strings. This works when we use alternative coding ;? for tilde as well.

#2 Updated by Octavian Adrian Gavril 7 months ago

#3 Updated by Octavian Adrian Gavril 7 months ago

  • Related to Bug #10569: Semicolon is skipped while preprocessing added

#4 Updated by Octavian Adrian Gavril 7 months ago

Another example of what the current preprocessing work does is mentioned in #10569-25.

#5 Updated by Octavian Adrian Gavril 5 months ago

  • Related to Bug #11250: Tilde is not duplicating the next character. added

#6 Updated by Greg Shah 5 months ago

  • topics 4GL Preprocessor added

Also available in: Atom PDF