File tree Expand file tree Collapse file tree 3 files changed +57
-27
lines changed
src/compiler/phases/1-parse/read
tests/parser-modern/samples/semicolon-inside-quotes Expand file tree Collapse file tree 3 files changed +57
-27
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const REGEX_PERCENTAGE = /^\d+(\.\d+)?%/;
99const REGEX_NTH_OF =
1010 / ^ ( e v e n | o d d | \+ ? ( \d + | \d * n ( \s * [ + - ] \s * \d + ) ? ) | - \d * n ( \s * \+ \s * \d + ) ) ( (? = \s * [ , ) ] ) | \s + o f \s + ) / ;
1111const REGEX_WHITESPACE_OR_COLON = / [ \s : ] / ;
12- const REGEX_BRACE_OR_SEMICOLON = / [ { ; ] (? = (?: [ ^ ' ] * ' [ ^ ' ] * ' ) * [ ^ ' ] * $ ) / ;
12+ const REGEX_BRACE_OR_SEMICOLON = / [ { ; ] (? = (?: [ ^ ' " ] * ' [ ^ ' " ] * ' ) * [ ^ ' " ] * $ ) / ;
1313const REGEX_LEADING_HYPHEN_OR_DIGIT = / - ? \d / ;
1414const REGEX_VALID_IDENTIFIER_CHAR = / [ a - z A - Z 0 - 9 _ - ] / ;
1515const REGEX_COMMENT_CLOSE = / \* \/ / ;
Original file line number Diff line number Diff line change 1+ <h1 >
2+ Semicolon inside quotes
3+ </h1 >
14<style >
2- @import url (' https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap' );
3-
5+ @import url (" https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" );
46 h1 {
57 font-weight : bold ;
68 }
Original file line number Diff line number Diff line change 11{
22 "css" : {
33 "type" : " Style" ,
4- "start" : 0 ,
5- "end" : 137 ,
4+ "start" : 36 ,
5+ "end" : 174 ,
66 "attributes" : [],
77 "children" : [
88 {
99 "type" : " Atrule" ,
10- "start" : 9 ,
11- "end" : 97 ,
10+ "start" : 45 ,
11+ "end" : 135 ,
1212 "name" : " import" ,
13- "prelude" : " url(' https://fonts.googleapis.com/css2?family=Cairo :wght@400;700&display=swap' )" ,
13+ "prelude" : " url(\" https://fonts.googleapis.com/css2?family=Poppins :wght@400;700&display=swap\" )" ,
1414 "block" : null
1515 },
1616 {
1717 "type" : " Rule" ,
1818 "prelude" : {
1919 "type" : " SelectorList" ,
20- "start" : 100 ,
21- "end" : 102 ,
20+ "start" : 137 ,
21+ "end" : 139 ,
2222 "children" : [
2323 {
2424 "type" : " Selector" ,
25- "start" : 100 ,
26- "end" : 102 ,
25+ "start" : 137 ,
26+ "end" : 139 ,
2727 "children" : [
2828 {
2929 "type" : " TypeSelector" ,
3030 "name" : " h1" ,
31- "start" : 100 ,
32- "end" : 102
31+ "start" : 137 ,
32+ "end" : 139
3333 }
3434 ]
3535 }
3636 ]
3737 },
3838 "block" : {
3939 "type" : " Block" ,
40- "start" : 103 ,
41- "end" : 128 ,
40+ "start" : 140 ,
41+ "end" : 165 ,
4242 "children" : [
4343 {
4444 "type" : " Declaration" ,
45- "start" : 107 ,
46- "end" : 124 ,
45+ "start" : 144 ,
46+ "end" : 161 ,
4747 "property" : " font-weight" ,
4848 "value" : " bold"
4949 }
5050 ]
5151 },
52- "start" : 100 ,
53- "end" : 128
52+ "start" : 137 ,
53+ "end" : 165
5454 }
5555 ],
5656 "content" : {
57- "start" : 7 ,
58- "end" : 129 ,
59- "styles" : " \n\t @import url(' https://fonts.googleapis.com/css2?family=Cairo :wght@400;700&display=swap'); \n \n\t h1 {\n\t\t font-weight: bold;\n\t }\n "
57+ "start" : 43 ,
58+ "end" : 166 ,
59+ "styles" : " \n\t @import url(\" https://fonts.googleapis.com/css2?family=Poppins :wght@400;700&display=swap\" ); \n\t h1 {\n\t\t font-weight: bold;\n\t }\n "
6060 }
6161 },
6262 "js" : [],
63- "start" : null ,
64- "end" : null ,
63+ "start" : 0 ,
64+ "end" : 35 ,
6565 "type" : " Root" ,
6666 "fragment" : {
6767 "type" : " Fragment" ,
68- "nodes" : [],
68+ "nodes" : [
69+ {
70+ "type" : " RegularElement" ,
71+ "start" : 0 ,
72+ "end" : 35 ,
73+ "name" : " h1" ,
74+ "attributes" : [],
75+ "fragment" : {
76+ "type" : " Fragment" ,
77+ "nodes" : [
78+ {
79+ "type" : " Text" ,
80+ "start" : 4 ,
81+ "end" : 30 ,
82+ "raw" : " \n\t Semicolon inside quotes\n " ,
83+ "data" : " \n\t Semicolon inside quotes\n "
84+ }
85+ ],
86+ "transparent" : true
87+ }
88+ },
89+ {
90+ "type" : " Text" ,
91+ "start" : 35 ,
92+ "end" : 36 ,
93+ "raw" : " \n " ,
94+ "data" : " \n "
95+ }
96+ ],
6997 "transparent" : false
7098 },
7199 "options" : null
72- }
100+ }
You can’t perform that action at this time.
0 commit comments