Commit 4dd3c938 authored by Matej Genci's avatar Matej Genci

Hack around javascript highlighting having different offset

parent 6f5aaf8f
...@@ -9,10 +9,10 @@ export function astMetaToGraphData(astMeta) { ...@@ -9,10 +9,10 @@ export function astMetaToGraphData(astMeta) {
return graphData return graphData
} }
function generateMarkerObject(start, end) { function generateMarkerObject(start, end, off = 0) {
return { return {
startRow: start.lineNum - 1, startRow: start.lineNum - 1,
startCol: start.charNum, startCol: start.charNum + off,
endRow: end.lineNum - 1, endRow: end.lineNum - 1,
endCol: end.charNum, endCol: end.charNum,
className: "ast-node-highlight", className: "ast-node-highlight",
...@@ -43,7 +43,7 @@ function createGraphNode(node, astMeta){ ...@@ -43,7 +43,7 @@ function createGraphNode(node, astMeta){
attributes: {value: value}, attributes: {value: value},
highlighting: { highlighting: {
wacc: [generateMarkerObject(node.waccStart, node.waccEnd)], wacc: [generateMarkerObject(node.waccStart, node.waccEnd)],
js: typeof node.jsStart === "undefined" ? [{}] : [generateMarkerObject(node.jsStart, node.jsEnd)], js: typeof node.jsStart === "undefined" ? [{}] : [generateMarkerObject(node.jsStart, node.jsEnd, -1)],
arm: generateArmMarkers(node.armLineNums) arm: generateArmMarkers(node.armLineNums)
}, },
children: children children: children
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment