Features
- new
ast::Definition
methods - goto-bus-stop, pull/456
When working withDefinition
nodes, you can use the.name()
method to get the name of a definition, regardless of its kind. Forschema
definitions, it returnsNone
.
You can use.is_extension_definition()
to check if a definition node is an extension.
Fixes
-
fix token order around type names - goto-bus-stop, issue/362, pull/443
type Query { field: Int # comment }
Previously, the whitespace and comment around the
Int
type name would end up before the type name in the parse tree. This would mess up the location information for theInt
type name. Now this is fixed. -
fix spans after parsing unexpected tokens - goto-bus-stop, issue/325, pull/446
Location information for all nodes after an unexpected token was incorrect. It's better now, though still imperfect: lexing errors still have this problem.
-
fix ignored token positioning in the AST - goto-bus-stop, pull/445
This makes spans for all nodes more specific, not including ignored tokens after the node. When ignored tokens are consumed, they are first stored separately, and then added to the AST just before the next node is started. This way ignored tokens are always inside the outermost possible node, and therefore all individual nodes will have spans that only contain that node and not more.
The most obvious effect of this is that diagnostics now point to the exact thing they are about, instead of a bunch of whitespace :)