-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GODT-2032): AddressList parsing with encoded text that starts with =
Rewrite grammar so that it correctly handles the case where the encode text starts with '='.
- Loading branch information
1 parent
0bddd1d
commit e501260
Showing
4 changed files
with
142 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,66 @@ | ||
lexer grammar RFC2047Lexer; | ||
|
||
// Printable (0x20-0x7E) | ||
fragment Exclamation: '!'; // \u0021 | ||
fragment DQuote: '"'; // \u0022 | ||
fragment Hash: '#'; // \u0023 | ||
fragment Dollar: '$'; // \u0024 | ||
fragment Percent: '%'; // \u0025 | ||
fragment Ampersand: '&'; // \u0026 | ||
fragment SQuote: '\''; // \u0027 | ||
fragment LParens: '('; // \u0028 | ||
fragment RParens: ')'; // \u0029 | ||
fragment Asterisk: '*'; // \u002A | ||
fragment Plus: '+'; // \u002B | ||
fragment Comma: ','; // \u002C | ||
fragment Minus: '-'; // \u002D | ||
fragment Period: '.'; // \u002E | ||
fragment Slash: '/'; // \u002F | ||
fragment Digit: [0-9]; // \u0030 -- \u0039 | ||
fragment Colon: ':'; // \u003A | ||
fragment Semicolon: ';'; // \u003B | ||
fragment Less: '<'; // \u003C | ||
fragment Equal: '='; // \u003D | ||
fragment Greater: '>'; // \u003E | ||
Exclamation: '!'; // \u0021 | ||
DQuote: '"'; // \u0022 | ||
Hash: '#'; // \u0023 | ||
Dollar: '$'; // \u0024 | ||
Percent: '%'; // \u0025 | ||
Ampersand: '&'; // \u0026 | ||
SQuote: '\''; // \u0027 | ||
LParens: '('; // \u0028 | ||
RParens: ')'; // \u0029 | ||
Asterisk: '*'; // \u002A | ||
Plus: '+'; // \u002B | ||
Comma: ','; // \u002C | ||
Minus: '-'; // \u002D | ||
Period: '.'; // \u002E | ||
Slash: '/'; // \u002F | ||
Digit: [0-9]; // \u0030 -- \u0039 | ||
Colon: ':'; // \u003A | ||
Semicolon: ';'; // \u003B | ||
Less: '<'; // \u003C | ||
Equal: '='; // \u003D | ||
Greater: '>'; // \u003E | ||
Question: '?'; // \u003F | ||
fragment At: '@'; // \u0040 | ||
fragment LBracket: '['; // \u005B | ||
fragment Backslash: '\\'; // \u005C | ||
fragment RBracket: ']'; // \u005D | ||
fragment Caret: '^'; // \u005E | ||
fragment Underscore: '_'; // \u005F | ||
fragment Backtick: '`'; // \u0060 | ||
fragment LCurly: '{'; // \u007B | ||
fragment Pipe: '|'; // \u007C | ||
fragment RCurly: '}'; // \u007D | ||
fragment Tilde: '~'; // \u007E | ||
At: '@'; // \u0040 | ||
LBracket: '['; // \u005B | ||
Backslash: '\\'; // \u005C | ||
RBracket: ']'; // \u005D | ||
Caret: '^'; // \u005E | ||
Underscore: '_'; // \u005F | ||
Backtick: '`'; // \u0060 | ||
LCurly: '{'; // \u007B | ||
Pipe: '|'; // \u007C | ||
RCurly: '}'; // \u007D | ||
Tilde: '~'; // \u007E | ||
|
||
fragment A: 'A'|'a'; | ||
fragment B: 'B'|'b'; | ||
fragment C: 'C'|'c'; | ||
fragment D: 'D'|'d'; | ||
fragment E: 'E'|'e'; | ||
fragment F: 'F'|'f'; | ||
fragment G: 'G'|'g'; | ||
fragment H: 'H'|'h'; | ||
fragment I: 'I'|'i'; | ||
fragment J: 'J'|'j'; | ||
fragment K: 'K'|'k'; | ||
fragment L: 'L'|'l'; | ||
fragment M: 'M'|'m'; | ||
fragment N: 'N'|'n'; | ||
fragment O: 'O'|'o'; | ||
fragment P: 'P'|'p'; | ||
fragment Q: 'Q'|'q'; | ||
fragment R: 'R'|'r'; | ||
fragment S: 'S'|'s'; | ||
fragment T: 'T'|'t'; | ||
fragment U: 'U'|'u'; | ||
fragment V: 'V'|'v'; | ||
fragment W: 'W'|'w'; | ||
fragment X: 'X'|'x'; | ||
fragment Y: 'Y'|'y'; | ||
fragment Z: 'Z'|'z'; | ||
A: 'A'|'a'; | ||
B: 'B'|'b'; | ||
C: 'C'|'c'; | ||
D: 'D'|'d'; | ||
E: 'E'|'e'; | ||
F: 'F'|'f'; | ||
G: 'G'|'g'; | ||
H: 'H'|'h'; | ||
I: 'I'|'i'; | ||
J: 'J'|'j'; | ||
K: 'K'|'k'; | ||
L: 'L'|'l'; | ||
M: 'M'|'m'; | ||
N: 'N'|'n'; | ||
O: 'O'|'o'; | ||
P: 'P'|'p'; | ||
Q: 'Q'|'q'; | ||
R: 'R'|'r'; | ||
S: 'S'|'s'; | ||
T: 'T'|'t'; | ||
U: 'U'|'u'; | ||
V: 'V'|'v'; | ||
W: 'W'|'w'; | ||
X: 'X'|'x'; | ||
Y: 'Y'|'y'; | ||
Z: 'Z'|'z'; | ||
|
||
fragment Alpha: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ; | ||
|
||
EncodeBegin: Equal Question; | ||
EncodeEnd : Question Equal; | ||
|
||
Encoding: Q|B; | ||
|
||
fragment TokenChar | ||
: Alpha | ||
| Exclamation | ||
| Hash | ||
| Dollar | ||
| Percent | ||
| Ampersand | ||
| SQuote | ||
| Asterisk | ||
| Plus | ||
| Minus | ||
| Digit | ||
| Backslash | ||
| Caret | ||
| Underscore | ||
| Backtick | ||
| LCurly | ||
| Pipe | ||
| RCurly | ||
| Tilde | ||
; | ||
|
||
|
||
Token: TokenChar+; | ||
|
||
fragment EncodedChar | ||
: Alpha | ||
| Exclamation | ||
| DQuote | ||
| Hash | ||
| Dollar | ||
| Percent | ||
| Ampersand | ||
| SQuote | ||
| LParens | ||
| RParens | ||
| Asterisk | ||
| Plus | ||
| Comma | ||
| Minus | ||
| Period | ||
| Slash | ||
| Digit | ||
| Colon | ||
| Semicolon | ||
| Less | ||
| Equal | ||
| Greater | ||
| At | ||
| LBracket | ||
| Backslash | ||
| RBracket | ||
| Caret | ||
| Underscore | ||
| Backtick | ||
| LCurly | ||
| Pipe | ||
| RCurly | ||
| Tilde | ||
; | ||
|
||
EncodedText: EncodedChar+; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters