1
1
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:
Rob Rix 2015-10-14 14:40:21 -04:00
parent 645e038982
commit ed004ca4c1

View File

@ -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 {