Add a lexer for the TLS presentation language#2455
Conversation
This is the syntax used to define TLS structures. It is defined (somewhat loosely) here: https://www.rfc-editor.org/rfc/rfc8446#section-3 I patterned it after the Carbon syntax, mostly as an example of a small, vaguely-C-like lexer.
|
Hm, what are the uses for this format? Is it only used in the RFC itself, or more widely? |
|
It's used in TLS extensions and anything else that uses that syntax to define structures. (It's just a compact syntax for describing fixed-width fields and fixed-width length prefixes.) Usually they're in other RFCs, which don't integrate with pygments, but @dvorak42 and @jyasskin wanted to embed something using it in a Bikeshed spec, which uses pygments, so I put this together for them. |
|
OK, if it had some influence, why not, given that it's a very simple lexer. |
Also remove line continuation rule. That was a copy/paste error.
Looking at the spec again, I'm not sure whether this is describing syntax for their examples or actual syntax. Also I can't think of any time I've seen it in a spec.
|
One last change in case we crossed mid-air and you didn't see it. I removed this rule. I got that from:
But it only shows up in the spec here: This seems to not actually be syntax but just to describe that, in the example, you could include it or not. I'll... see about getting that cleared up for rfc8446bis. |
|
We have CI failures, please run |
|
Ah, whoops, I only ran plain (On my machine I got the |
|
Maybe you have something in your source tree that interferes? Such as a (non-tox-managed) venv? |
This is the syntax used to define TLS structures. It is defined (somewhat loosely) here:
https://www.rfc-editor.org/rfc/rfc8446#section-3
I patterned it after the Carbon syntax, mostly as an example of a small, vaguely-C-like lexer. Let me know if I got any of the project conventions wrong! I mostly mimicking other files and don't fully understand how the project works. 😄
CC: @dvorak42 @jyasskin