| 1 |
/* |
| 2 |
Exerpt from |
| 3 |
https://github.com/StoneCypher/short_offer/raw/main/src/peg/sdp_parser.pegjs |
| 4 |
*/ |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
RawDocument |
| 9 |
= Offer |
| 10 |
/ Answer |
| 11 |
/ UnknownTerminatingString // junk |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
Digit |
| 16 |
= [0-9] |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
// Decimal |
| 21 |
// = d:Digit+ { return BigInt(d.join(''), 10); } |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
Hex |
| 26 |
= [0-9a-fA-F] |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
Hex2 |
| 31 |
= a:Hex b:Hex { return `${a}${b}`; } |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
Hex4 |
| 36 |
= a:Hex b:Hex c:Hex d:Hex |
| 37 |
{ return [a,b,c,d].join(''); } |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
Hex8 |
| 42 |
= a:Hex b:Hex c:Hex d:Hex e:Hex f:Hex g:Hex h:Hex |
| 43 |
{ return [a,b,c,d,e,f,g,h].join(''); } |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
Hex12 |
| 48 |
= a:Hex b:Hex c:Hex d:Hex e:Hex f:Hex g:Hex h:Hex i:Hex j:Hex k:Hex l:Hex |
| 49 |
{ return [a,b,c,d,e,f,g,h,i,j,k,l].join(''); } |
| 50 |
|
| 51 |
// truncated |