Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From line/column to offset #108

Merged
merged 12 commits into from
Nov 20, 2024
Prev Previous commit
Next Next commit
Updated cases json files with offset
  • Loading branch information
RamazanIttiev committed Nov 19, 2024
commit 2da5a0c0404ea20992c5fd3630f91cbffceb6296
115 changes: 75 additions & 40 deletions test/cases/all.json
Original file line number Diff line number Diff line change
@@ -20,11 +20,13 @@
"source": {
"start": {
"line": 2,
"column": 3
"column": 3,
"offset": 4
},
"end": {
"line": 2,
"column": 13
"column": 14,
"offset": 15
}
},
"prop": "color",
@@ -34,11 +36,13 @@
"source": {
"start": {
"line": 1,
"column": 1
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 1
"column": 2,
"offset": 1
}
},
"selector": "a"
@@ -53,11 +57,13 @@
"source": {
"start": {
"line": 4,
"column": 1
"column": 1,
"offset": 17
},
"end": {
"line": 4,
"column": 25
"column": 26,
"offset": 42
}
},
"params": "(max-width: 400px)",
@@ -77,11 +83,13 @@
"source": {
"start": {
"line": 6,
"column": 5
"column": 5,
"offset": 55
},
"end": {
"line": 6,
"column": 19
"column": 20,
"offset": 70
}
},
"prop": "padding",
@@ -91,11 +99,13 @@
"source": {
"start": {
"line": 5,
"column": 3
"column": 3,
"offset": 45
},
"end": {
"line": 5,
"column": 7
"column": 8,
"offset": 50
}
},
"selector": ".body"
@@ -117,11 +127,13 @@
"source": {
"start": {
"line": 9,
"column": 3
"column": 3,
"offset": 80
},
"end": {
"line": 9,
"column": 40
"column": 41,
"offset": 118
}
},
"prop": "font-family",
@@ -137,11 +149,13 @@
"source": {
"start": {
"line": 10,
"column": 3
"column": 3,
"offset": 121
},
"end": {
"line": 10,
"column": 32
"column": 33,
"offset": 151
}
},
"text": "transform: rotate(90deg)"
@@ -155,11 +169,13 @@
"source": {
"start": {
"line": 11,
"column": 3
"column": 3,
"offset": 154
},
"end": {
"line": 11,
"column": 19
"column": 20,
"offset": 171
}
},
"prop": "background",
@@ -169,11 +185,13 @@
"source": {
"start": {
"line": 8,
"column": 1
"column": 1,
"offset": 72
},
"end": {
"line": 8,
"column": 5
"column": 6,
"offset": 77
}
},
"selector": ".page"
@@ -193,11 +211,13 @@
"source": {
"start": {
"line": 14,
"column": 3
"column": 3,
"offset": 182
},
"end": {
"line": 14,
"column": 14
"column": 15,
"offset": 194
}
},
"prop": "width",
@@ -218,11 +238,13 @@
"source": {
"start": {
"line": 16,
"column": 5
"column": 5,
"offset": 209
},
"end": {
"line": 16,
"column": 16
"column": 17,
"offset": 221
}
},
"prop": "width",
@@ -232,11 +254,13 @@
"source": {
"start": {
"line": 15,
"column": 3
"column": 3,
"offset": 197
},
"end": {
"line": 15,
"column": 9
"column": 10,
"offset": 204
}
},
"selector": "&_title"
@@ -245,11 +269,13 @@
"source": {
"start": {
"line": 13,
"column": 1
"column": 1,
"offset": 173
},
"end": {
"line": 13,
"column": 6
"column": 7,
"offset": 179
}
},
"selector": ".phone"
@@ -275,11 +301,13 @@
"source": {
"start": {
"line": 20,
"column": 5
"column": 5,
"offset": 244
},
"end": {
"line": 20,
"column": 16
"column": 17,
"offset": 256
}
},
"prop": "color",
@@ -294,11 +322,13 @@
"source": {
"start": {
"line": 21,
"column": 5
"column": 5,
"offset": 261
},
"end": {
"line": 21,
"column": 21
"column": 22,
"offset": 278
}
},
"prop": "background",
@@ -308,11 +338,13 @@
"source": {
"start": {
"line": 19,
"column": 3
"column": 3,
"offset": 231
},
"end": {
"line": 19,
"column": 10
"column": 11,
"offset": 239
}
},
"selector": "--black:"
@@ -321,24 +353,27 @@
"source": {
"start": {
"line": 18,
"column": 1
"column": 1,
"offset": 223
},
"end": {
"line": 18,
"column": 5
"column": 6,
"offset": 228
}
},
"selector": ":root"
}
],
}],
"source": {
"start": {
"line": 1,
"column": 1
"column": 1,
"offset": 0
},
"end": {
"line": 21,
"column": 21
"line": 22,
"column": 1,
"offset": 279
}
}
}
}
38 changes: 25 additions & 13 deletions test/cases/atrules.json
Original file line number Diff line number Diff line change
@@ -15,11 +15,13 @@
"source": {
"start": {
"line": 1,
"column": 1
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 5
"column": 5,
"offset": 4
}
},
"params": ""
@@ -34,11 +36,13 @@
"source": {
"start": {
"line": 3,
"column": 1
"column": 1,
"offset": 7
},
"end": {
"line": 3,
"column": 16
"column": 16,
"offset": 22
}
},
"params": "\"UTF-8\""
@@ -53,11 +57,13 @@
"source": {
"start": {
"line": 5,
"column": 1
"column": 1,
"offset": 25
},
"end": {
"line": 6,
"column": 29
"column": 29,
"offset": 79
}
},
"params": "(color: black),\n (background: black)",
@@ -77,11 +83,13 @@
"source": {
"start": {
"line": 7,
"column": 3
"column": 3,
"offset": 82
},
"end": {
"line": 7,
"column": 44
"column": 44,
"offset": 123
}
},
"params": "(max-width: 400px) ",
@@ -97,11 +105,13 @@
"source": {
"start": {
"line": 8,
"column": 5
"column": 5,
"offset": 126
},
"end": {
"line": 8,
"column": 22
"column": 22,
"offset": 143
}
},
"text": "write code here"
@@ -114,11 +124,13 @@
"source": {
"start": {
"line": 1,
"column": 1
"column": 1,
"offset": 0
},
"end": {
"line": 8,
"column": 22
"column": 22,
"offset": 143
}
}
}
}
Loading
Loading