Skip to content

Commit 9a40149

Browse files
jwilssonshellscape
authored andcommitted
At '!' to list of chars that end at-words. Closes #105 (#107)
1 parent 2a03763 commit 9a40149

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/tokenizer/globals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const tilde = '~'.charCodeAt(0);
2424
export const hash = '#'.charCodeAt(0);
2525

2626

27-
export const atEndPattern = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
27+
export const atEndPattern = /[ \n\t\r\f\{\(\)'"\\;/\[\]#!]/g;
2828
export const wordEndPattern = /[ \n\t\r\f\(\)\{\}:,;@!'"\\\]\[#]|\/(?=\*)/g;
2929
export const badBracketPattern = /.[\\\/\("'\n]/;
3030

test/tokenize.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,11 @@ describe('#tokenize()', () => {
188188
// [ '}', '}', 1, 28 ]
189189
// ]);
190190
// });
191+
it('tokenizes @var next to !important separately', () => {
192+
testTokens('@var!important', [
193+
['at-word', '@var', 1, 1, 1, 4],
194+
['word', '!important', 1, 5, 1, 14]
195+
]);
196+
});
191197
});
192198
});

0 commit comments

Comments
 (0)