ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0005916 | Part 01: TTCN-3 Core Language | Editorial | public | 06-07-2011 10:34 | 29-09-2011 09:47

Reporter | Philip Makedonski |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | text | Reproducibility | always
Status | closed | Resolution | won't fix |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.4.1 (published 2012-04) | Fixed in Version |  |
Clause Reference(s) | Part 1, Annex B.1.5, Table B.1
Source (company - Author) | University of GÃ¶ttingen - Philip Makedonski

Summary | 0005916: Clarification of the role of "\" within patterns

Description

It seems trivial at first sight, however reading into the description within Table B.1, it says:
"Cause the following metacharacter to be interpreted as a literal (see note 3)."
- this is clear so far, but:
"When preceding a character without defined metacharacter meaning "\" and the
character together match the character following the "\" (see note 4)"
- although deprecated according to Note 4, it is somewhat confusing - there is perhaps a comma missing here - "when preceding a character ... , "\" and the character together match the character ... " (i.e. "\f" is reduced to "f").
This is in a way also exemplified by "\"" further down in Table B.1, although it has a different connotation to it, which brings about another problem (that may need to be reported as a separate issue):
Clause 6.1.1, Note 3 defines double quote (") as the one and only escape character enabling the use of double quotes within charstring values. Yet, within regular expressions, which are also charstring values, apparently a backslash (\) can serve the same purpose. This is, in my view, an inconsistency which needs to be addressed. Since removing the backslash as an escape character in regular expressions would potentially cause compatibility issues, I guess the only option is to add it as an escape character in all charstring values (which may also cause compatibility issues).
with:
B.1, Note 3: "Consequently the backslash character can be matched by a pair of backslash characters without space between them (\\), e.g. the pattern "\\d" will match the string "\d"; opening or closing square brackets can be matched by "\[" and "\]" respectively, etc."
and:
B.2, Note 4: "Such use of the metacharacter "\" is deprecated as further metacharacters can be defined later."

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files |

Issue History
Date Modified | Username | Field | Change
06-07-2011 10:34 | Philip Makedonski | New Issue |
06-07-2011 10:34 | Philip Makedonski | Clause Reference(s) | => Part 1, Annex B.1.5, Table B.1
06-07-2011 10:34 | Philip Makedonski | Source (company - Author) | => University of GÃ¶ttingen - Philip Makedonski
06-07-2011 10:46 | Philip Makedonski | Note Added: 0010212 |
27-09-2011 12:12 | Gyorgy Rethy | Assigned To | => Gyorgy Rethy
27-09-2011 12:12 | Gyorgy Rethy | Status | new => assigned
27-09-2011 12:14 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
27-09-2011 13:25 | Gyorgy Rethy | Target Version | => Edition 4.4.1
27-09-2011 16:36 | Gyorgy Rethy | Note Added: 0010253 |
27-09-2011 16:37 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:38 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:39 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:42 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:43 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:43 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:44 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:45 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:46 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:46 | Gyorgy Rethy | Note Edited: 0010253 |
27-09-2011 16:47 | Gyorgy Rethy | Note Edited: 0010253 |
29-09-2011 09:47 | Gyorgy Rethy | Status | assigned => closed
29-09-2011 09:47 | Gyorgy Rethy | Resolution | open => won't fix

Notes

(0010212)
Philip Makedonski
06-07-2011 10:46

Or perhaps the intended interpretation is that \" within patterns should still contain a double quote escape character - amounting to \"". Is this the case?

(0010253)
Gyorgy Rethy
27-09-2011 16:36 (edited on: 27-09-2011 16:47)

First, it should be clear, that charstring VALUES and PATTERNS are different things. Not only "\" but also "?", "*", "|", "+" etc. have different meanings in a value and in a pattern.
Let's see the meanings of different combinations of "\" and """ in a value and in a pattern:
combination__|__meaning in a value__|__meaning in a pattern
TODAY
ab""cd | ab"cd | ab"cd
ab\"cd | error | ab"cd
ab\""cd | ab\"cd | error (\" equals ", 2nd " closes the pattern, cd remains hanging)
ab\\cd | ab\\cd | ab\cd
IF \ ADDED TO VALUES AS ESCAPE CHARACTER FOR "
ab""cd | ab"cd | ab"cd -- no change
ab\"cd | ab"cd | ab"cd -- error removed
ab\""cd | error | error -- new error introduced
ab\\cd | ab\cd | ab\cd -- meaning changed
^ (should also be single \ for consistency ?)
I cannot see a way to add \ as escape character for " without causing backward compatibility problems to existing code. It has also be noted, that "\" would have a special meaning in values only if followed by """ (or by "\" ?) but not in other cases. This would be at least as inconsistent as not having it as an escape character in values.
For the above reasons I propose leave the standard as is.