-
Notifications
You must be signed in to change notification settings - Fork 28
/
ChangeLog.txt
28 lines (16 loc) · 3.21 KB
/
ChangeLog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
*
* 2015-April: Paul Kyzivat, [email protected]
*
Update to add support for RFC7405. This adds the string forms %i"..." and %s"...".
Summary of changes made to achieve this:
- Updated main.c, adding support for a new command line switch (-o option-name), as a mechanism for supporting options without consuming a switch character for each. (I would prefer to use the GNU option mechanism (--option) for that, but didn't want to perturb the command line structure that much.)
- Defined two options that are recognized with -o: RFC7405 and ~RFC7405. These turn the new feature on and off. (For now the default is off, but maybe it will at some point be turned on by default.) I did this because RFC7405 is just an extension to RFC5234, not a bis.
- Updated common.h, revising the definition of type object. Replaced the 'flags' field with two new fields: 'fmt' and 'valid_fmts'. The 'fmt' field can take on one of six values representing the possible string formats. (Quoted with no prefix, or with %s/%i, binary with %x, %d, %b.) Also added another field 'valid_fmts' that indicates in which of these six formats the value of this particular string can be represented. Individual formats are represented as a flag bit, combinations by ORing these together. Defined constants for all these flags.
- Updated scanner.l and parser.y to accept the new %s and %i prefixes on quoted strings, and to convey the distinction between these and regular quoted strings to the parser. In the absence of the RFC7405 option a *warning* is issued for the use of %i and %s forms, but processing continues.
- Updated parser.y to take populate termstr objects with the new new fields. The 'fmt' is determined by input from the scanner. The 'valid_fmts' is computed by scanning the string value returned by the scanner.
- Updated printobj_r in parser.y to use the new information in object when printing strings. Quoted strings are printed with the proper prefix. Binary strings are now printed using the form they were defined with. (They all used to print in hex.) When the text form of a binary string is printed as a comment (due to the -k switch) it is now printed using either "..." or %i"..." as appropriate.
- Updated canonify_r in parser.y. It now uses the new information about strings to do a smarter job of combining adjacent strings. It first merges adjacent strings of exactly the same format. It then will selectively merge strings of differing formats if their contents are compatible. For instance it will merge a binary string into a case-sensitive quoted string so long as the binary string contains only printable characters, but will not merge it into a case-insensitive quoted string if it contains alpha characters. After merging, it will also selectively upgrade some string formats to other, preferable, ones. This is fundamentally a matter of taste. For now, it is done only for hex binary strings. These will be upgraded to case-sensitive or case-insensitive strings if possible based on their content. This upgrade is conditioned on the RFC7405 option.
- Added another directory (rfc7405) to tests, with some tests of the changes.
Still needed to complete this:
- add tests for the new features
- revise abnf.cgi to provide allow the RFC7405 option to be enabled.