mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
Annotate terms with their sizes.
This commit is contained in:
parent
645e038982
commit
ed004ca4c1
@ -69,7 +69,7 @@ extension JSON {
|
||||
|
||||
var term: Term {
|
||||
func annotate(json: Syntax<Term, JSONLeaf>) -> Term {
|
||||
return Cofree(0, json)
|
||||
return Cofree(size(json), json)
|
||||
}
|
||||
func size(syntax: Syntax<Term, JSONLeaf>) -> Int {
|
||||
switch syntax {
|
||||
|
Loading…
Reference in New Issue
Block a user