forked from 0x00000001A/es6-string-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
60 lines (54 loc) · 1.12 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Highlight the string value for any var 'sql'
// While still highlighting interpolation correctly
const sql = `
INSERT INTO test
thing, otherthing, otherother
VALUES
('test', 2, '${String(true) + "inside an interpolated value"}');
$2
`;
// Highlight the string value for any key 'sql'
const mything = {
sql: `
SELECT
potato
FROM
mytable
WHERE id IN (1, 2, 3);
`
};
// Should not care about being multiline
function newScopeForMoreSql() {
const sql = `SELECT something FROM nothing;`;
const a = function furtherNestedSqlShadowing() {
const sql = "Not a template string";
};
}
// Do not affect anything else
const singleLineString = "SELECT not_sql FROM my_table;";
const multiLineString = `
asdasdas
asdasdasdasda
sadasdasdasd;
`;
function testFunc() {
for (let i = 0; i < a.length; i++) {
const element = a[i];
console.log(element);
}
return true;
}
function pickles(testParam = `hey`) {
return Boolean(testParam);
}
const testObject = {
prop: testFunc(""),
someKey: `
my multiline string
starts here;
and ends here;
`,
notsql: `
hmmm
`
};