mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Clarify the assignment-context bit.
This commit is contained in:
parent
9d5b040c42
commit
838262df2d
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE DataKinds, GADTs, ScopedTypeVariables, TypeFamilies #-}
|
||||
-- | Assignment of AST onto some other structure (typically terms).
|
||||
--
|
||||
-- Parsing yields an AST represented as a Rose tree labelled with symbols in the language’s grammar and source locations (byte Range and SourceSpan). An Assignment is a tree automaton—a parser of trees, essentially—representing a (partial) map from AST nodes onto some other structure. (For our purposes, this structure is typically Terms annotated with source locations.) Assignments are able to match based on symbol, sequence, and hierarchy; thus, an Identifier occurring in one location might be mapped onto a type for variable references, while in another location it might be assigned a type for a declaration.
|
||||
-- Parsing yields an AST represented as a Rose tree labelled with symbols in the language’s grammar and source locations (byte Range and SourceSpan). An Assignment is a tree automaton—a parser of trees, essentially—representing a (partial) map from AST nodes onto some other structure. (For our purposes, this structure is typically Terms annotated with source locations.) Assignments are able to match based on symbol, sequence, and hierarchy; thus, in @x = y@, both @x@ and @y@ might have the same symbol, @Identifier@, the left can be assigned to a variable declaration, while the right can be assigned to a variable reference.
|
||||
module Data.Syntax.Assignment
|
||||
( Assignment
|
||||
, Location
|
||||
|
Loading…
Reference in New Issue
Block a user