Docs: Broken formatting in Reflection guide

Created on 27 Dec 2017  ·  5Comments  ·  Source: dotnet/docs

https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names

On this page the table "Backus-Naur Form Grammar for Type Names" is rendering incorrectly. Here's what it previously looked like on msdn: https://msdn.microsoft.com/it-it/library/yfsftwz6(v=vs.110).aspx

OLD
image

NEW
image

Area - .NET Framework Guide P1 doc-bug

All 5 comments

Thanks for letting us know @ChrisMaddock! We'll address it shortly. It's probably due to the use of pipes.

@terrajobst One solution would be to translate from BNF to ANTLR, and use the ANTLR grammar syntax highlighter. See example from the C# grammar

Thoughts?

Like this? Yep, looks very readable to me. 👍

TypeSpec
    : ReferenceTypeSpec
    | SimpleTypeSpec
    ;

ReferenceTypeSpec
    : SimpleTypeSpec '&'
    ;

SimpleTypeSpec
    : PointerTypeSpec
    | ArrayTypeSpec
    | TypeName
    ;

PointerTypeSpec
    : SimpleTypeSpec '*'
    ;

ArrayTypeSpec
    : SimpleTypeSpec '[ReflectionDimension]'
    | SimpleTypeSpec '[ReflectionEmitDimension]'
    ;

ReflectionDimension
    : '*'
    | ReflectionDimension ',' ReflectionDimension
    | NOTOKEN
    ;

ReflectionEmitDimension
    : '*'
    | Number '..' Numero
    | Number '…'
    | ReflectionDimension ',' ReflectionDimension
    | NOTOKEN
    ;

Number
    : [0-9]+
    ;

TypeName
    : NamespaceTypeName
    | NamespaceTypeName ',' AssemblyNameSpec
    ;

NamespaceTypeName
    : NestedTypeName
    | NamespaceSpec '.' NestedTypeName
    ;

NestedTypeName
    : IDENTIFIER
    | NestedTypeName '+' IDENTIFIER
    ;

NamespaceSpec
    : IDENTIFIER
    | NamespaceSpec '.' IDENTIFIER
    ;

AssemblyNameSpec
    : IDENTIFIER
    | IDENTIFIER ',' AssemblyProperties
    ;

AssemblyProperties
    : AssemblyProperty
    | AssemblyProperties ',' AssemblyProperty
    ;

AssemblyProperty
    : AssemblyPropertyName '=' AssemblyPropertyValue
    ;

@mairaw Do you want help with this one?

Hey @BillWagner, thanks for the offer. I'm not particularly attached to this issue, so feel free to take over if you'd like.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebagomez picture sebagomez  ·  3Comments

Eilon picture Eilon  ·  3Comments

sdmaclea picture sdmaclea  ·  3Comments

Manoj-Prabhakaran picture Manoj-Prabhakaran  ·  3Comments

JagathPrasad picture JagathPrasad  ·  3Comments