What's wrong
The serializer, deserializer and every generator fully support LiteralExpression<long> and LiteralExpression<float> (the round trip was fixed in #83). The graph layer only knows the other four literal types:
- Inspector:
AstFields.Of (Coder.Graph/AstFields.cs:336-339) and TryWrite (:544-547) handle string, int, double and bool only. A long or float literal falls through to _ => [], so the inspector shows nothing and the value cannot be edited.
- Caption:
AstSchema.Describe (Coder.Graph/AstSchema.cs:707-710) also falls back to GetNodeTypeName(), so the node is captioned Literal<Int64> or Literal<Single> instead of showing its value.
- Test:
AstNodeCoverageTests (Coder.Test/Graph/AstNodeCoverageTests.cs:52) closes generic node types over StorageTypes = [string, int, double, bool] only. The test exists to catch exactly this gap ("a node type left out of either draws an empty inspector rather than failing anything"), but it cannot see these two types.
Failure scenario
Open a document containing:
returnStatement:
expression:
literal<Int64>:
value: 5000000000
Select the literal node. The inspector is empty and the node reads Literal<Int64> instead of 5000000000. The only way to change the value is to edit the YAML by hand. literal<Single> behaves the same way.
Suggested fix / acceptance criteria
- Add
LiteralExpression<long> (as Number, with a new AssignLong parser) and LiteralExpression<float> (as Fraction, formatted so it round-trips) to AstFields.Of, AstFields.TryWrite and AstSchema.Describe.
- Add
typeof(long) and typeof(float) to StorageTypes in AstNodeCoverageTests so the reflective test enforces this from now on.
- Optionally, add Long and Float entries under Literals in
AstNodeCatalog.
What's wrong
The serializer, deserializer and every generator fully support
LiteralExpression<long>andLiteralExpression<float>(the round trip was fixed in #83). The graph layer only knows the other four literal types:AstFields.Of(Coder.Graph/AstFields.cs:336-339) andTryWrite(:544-547) handlestring,int,doubleandboolonly. Alongorfloatliteral falls through to_ => [], so the inspector shows nothing and the value cannot be edited.AstSchema.Describe(Coder.Graph/AstSchema.cs:707-710) also falls back toGetNodeTypeName(), so the node is captionedLiteral<Int64>orLiteral<Single>instead of showing its value.AstNodeCoverageTests(Coder.Test/Graph/AstNodeCoverageTests.cs:52) closes generic node types overStorageTypes = [string, int, double, bool]only. The test exists to catch exactly this gap ("a node type left out of either draws an empty inspector rather than failing anything"), but it cannot see these two types.Failure scenario
Open a document containing:
Select the literal node. The inspector is empty and the node reads
Literal<Int64>instead of5000000000. The only way to change the value is to edit the YAML by hand.literal<Single>behaves the same way.Suggested fix / acceptance criteria
LiteralExpression<long>(asNumber, with a newAssignLongparser) andLiteralExpression<float>(asFraction, formatted so it round-trips) toAstFields.Of,AstFields.TryWriteandAstSchema.Describe.typeof(long)andtypeof(float)toStorageTypesinAstNodeCoverageTestsso the reflective test enforces this from now on.AstNodeCatalog.