@@ -34,30 +34,27 @@ describe "XML grammar", ->
34
34
{tokens } = grammar .tokenizeLine (' <!-- invalid comment --->' )
35
35
expect (tokens[0 ]).toEqual value : ' <!--' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
36
36
expect (tokens[1 ]).toEqual value : ' invalid comment ' , scopes : [' text.xml' , ' comment.block.xml' ]
37
- expect (tokens[2 ]).toEqual value : ' --' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
38
- expect (tokens[3 ]).toEqual value : ' ->' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
37
+ expect (tokens[2 ]).toEqual value : ' --->' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
39
38
40
39
it ' tokenizes comments with two dashes not followed by ">" as invalid' , ->
41
40
{tokens } = grammar .tokenizeLine (' <!-- invalid -- comment -->' )
42
41
expect (tokens[0 ]).toEqual value : ' <!--' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
43
42
expect (tokens[1 ]).toEqual value : ' invalid ' , scopes : [' text.xml' , ' comment.block.xml' ]
44
- expect (tokens[2 ]).toEqual value : ' --' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
45
- expect (tokens[3 ]).toEqual value : ' comment ' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
46
- expect (tokens[4 ]).toEqual value : ' -->' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
43
+ expect (tokens[2 ]).toEqual value : ' -- comment ' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
44
+ expect (tokens[3 ]).toEqual value : ' -->' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
47
45
48
46
it ' tokenizes after invalid comment only if comment was properly closed' , ->
49
47
{tokens } = grammar .tokenizeLine (' <!-- invalid -- comment ---><n></n>--><n></n>' )
50
48
expect (tokens[0 ]).toEqual value : ' <!--' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
51
49
expect (tokens[1 ]).toEqual value : ' invalid ' , scopes : [' text.xml' , ' comment.block.xml' ]
52
- expect (tokens[2 ]).toEqual value : ' --' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
53
- expect (tokens[3 ]).toEqual value : ' comment ---><n></n>' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
54
- expect (tokens[4 ]).toEqual value : ' -->' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
55
- expect (tokens[5 ]).toEqual value : ' <' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
56
- expect (tokens[6 ]).toEqual value : ' n' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' entity.name.tag.xml' , ' entity.name.tag.localname.xml' ]
57
- expect (tokens[7 ]).toEqual value : ' >' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
58
- expect (tokens[8 ]).toEqual value : ' </' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
59
- expect (tokens[9 ]).toEqual value : ' n' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' entity.name.tag.xml' , ' entity.name.tag.localname.xml' ]
60
- expect (tokens[10 ]).toEqual value : ' >' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
50
+ expect (tokens[2 ]).toEqual value : ' -- comment ---><n></n>' , scopes : [' text.xml' , ' comment.block.xml' , ' invalid.illegal.bad-comments-or-CDATA.xml' ]
51
+ expect (tokens[3 ]).toEqual value : ' -->' , scopes : [' text.xml' , ' comment.block.xml' , ' punctuation.definition.comment.xml' ]
52
+ expect (tokens[4 ]).toEqual value : ' <' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
53
+ expect (tokens[5 ]).toEqual value : ' n' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' entity.name.tag.xml' , ' entity.name.tag.localname.xml' ]
54
+ expect (tokens[6 ]).toEqual value : ' >' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
55
+ expect (tokens[7 ]).toEqual value : ' </' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
56
+ expect (tokens[8 ]).toEqual value : ' n' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' entity.name.tag.xml' , ' entity.name.tag.localname.xml' ]
57
+ expect (tokens[9 ]).toEqual value : ' >' , scopes : [' text.xml' , ' meta.tag.no-content.xml' , ' punctuation.definition.tag.xml' ]
61
58
62
59
it " tokenizes empty element meta.tag.no-content.xml" , ->
63
60
{tokens } = grammar .tokenizeLine (' <n></n>' )
0 commit comments