1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Rename rangeAndSyntaxToDOM.

This commit is contained in:
Rob Rix 2015-11-03 15:26:32 -05:00
parent f5c21074c5
commit e096881578

View File

@ -67,9 +67,9 @@ function wrap(tagName, element) {
} }
/// String -> Syntax a -> Range -> (a -> Range) -> (a -> DOM) -> DOM /// String -> Syntax a -> Range -> (a -> Range) -> (a -> DOM) -> DOM
function rangeAndSyntaxToDOM(source, syntax, extract, getRange, recur) { function termToDOM(source, syntax, extract, getRange, recur) {
recur = recur || function(term) { recur = recur || function(term) {
return rangeAndSyntaxToDOM(source, term.unwrap, term.extract, getRange); return termToDOM(source, term.unwrap, term.extract, getRange);
} }
var categories = extract.categories; var categories = extract.categories;
var range = extract.range; var range = extract.range;
@ -173,7 +173,7 @@ function diffToDOM(diff, sources) {
function pureToDOM(sources, patch, getRangeFun, diffToDOMFun) { function pureToDOM(sources, patch, getRangeFun, diffToDOMFun) {
var elementA, elementB; var elementA, elementB;
if (patch.before != null) { if (patch.before != null) {
elementA = rangeAndSyntaxToDOM(sources.before, patch.before.unwrap, patch.before.extract, getRangeFun); elementA = termToDOM(sources.before, patch.before.unwrap, patch.before.extract, getRangeFun);
elementA.classList.add("delete"); elementA.classList.add("delete");
if (patch.after != null) { if (patch.after != null) {
elementA.classList.add("replace"); elementA.classList.add("replace");
@ -181,7 +181,7 @@ function pureToDOM(sources, patch, getRangeFun, diffToDOMFun) {
} }
if (patch.after != null) { if (patch.after != null) {
elementB = rangeAndSyntaxToDOM(sources.after, patch.after.unwrap, patch.after.extract, getRangeFun); elementB = termToDOM(sources.after, patch.after.unwrap, patch.after.extract, getRangeFun);
elementB.classList.add("insert"); elementB.classList.add("insert");
if (patch.before != null) { if (patch.before != null) {
elementB.classList.add("replace"); elementB.classList.add("replace");