Skip to content

Commit 2b9ea60

Browse files
committed
Split PHP into two lexers - PHP and PHTML.
The former is pure PHP code while the latter is PHP code in <? ?> tags, within HTML. Fixes #210.
1 parent 1150149 commit 2b9ea60

10 files changed

Lines changed: 229 additions & 118 deletions

File tree

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ linters:
2020
- wsl
2121
- gomnd
2222
- gocognit
23+
- goerr113
24+
- nolintlint
25+
- testpackage
26+
- godot
27+
- nestif
2328

2429
linters-settings:
2530
govet:

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go:
44
- "1.13.x"
55
script:
66
- go test -v ./...
7-
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.22.2
7+
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s 1.26.0
88
- ./bin/golangci-lint run
99
- git clean -fdx .
1010
after_success:

lexers/circular/php.go

Lines changed: 63 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package circular
22

33
import (
4-
"strings"
5-
64
. "github.com/alecthomas/chroma" // nolint
7-
"github.com/alecthomas/chroma/lexers/h"
85
"github.com/alecthomas/chroma/lexers/internal"
96
)
107

11-
// PHP lexer.
12-
var PHP = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
8+
// PHP lexer for pure PHP code (not embedded in HTML).
9+
var PHP = internal.Register(MustNewLexer(
1310
&Config{
1411
Name: "PHP",
1512
Aliases: []string{"php", "php3", "php4", "php5"},
@@ -19,73 +16,65 @@ var PHP = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
1916
CaseInsensitive: true,
2017
EnsureNL: true,
2118
},
22-
Rules{
23-
"root": {
24-
{`<\?(php)?`, CommentPreproc, Push("php")},
25-
{`[^<]+`, Other, nil},
26-
{`<`, Other, nil},
27-
},
28-
"php": {
29-
{`\?>`, CommentPreproc, Pop(1)},
30-
{`(<<<)([\'"]?)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)`, ByGroups(LiteralString, LiteralString, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, Punctuation, Text), nil},
31-
{`\s+`, Text, nil},
32-
{`#.*?\n`, CommentSingle, nil},
33-
{`//.*?\n`, CommentSingle, nil},
34-
{`/\*\*/`, CommentMultiline, nil},
35-
{`/\*\*.*?\*/`, LiteralStringDoc, nil},
36-
{`/\*.*?\*/`, CommentMultiline, nil},
37-
{`(->|::)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Operator, Text, NameAttribute), nil},
38-
{`[~!%^&*+=|:.<>/@-]+`, Operator, nil},
39-
{`\?`, Operator, nil},
40-
{`[\[\]{}();,]+`, Punctuation, nil},
41-
{`(class)(\s+)`, ByGroups(Keyword, Text), Push("classname")},
42-
{`(function)(\s*)(?=\()`, ByGroups(Keyword, Text), nil},
43-
{`(function)(\s+)(&?)(\s*)`, ByGroups(Keyword, Text, Operator, Text), Push("functionname")},
44-
{`(const)(\s+)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Keyword, Text, NameConstant), nil},
45-
{`(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally)\b`, Keyword, nil},
46-
{`(true|false|null)\b`, KeywordConstant, nil},
47-
Include("magicconstants"),
48-
{`\$\{\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*\}`, NameVariable, nil},
49-
{`\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameVariable, nil},
50-
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameOther, nil},
51-
{`(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil},
52-
{`\d+e[+-]?[0-9]+`, LiteralNumberFloat, nil},
53-
{`0[0-7]+`, LiteralNumberOct, nil},
54-
{`0x[a-f0-9]+`, LiteralNumberHex, nil},
55-
{`\d+`, LiteralNumberInteger, nil},
56-
{`0b[01]+`, LiteralNumberBin, nil},
57-
{`'([^'\\]*(?:\\.[^'\\]*)*)'`, LiteralStringSingle, nil},
58-
{"`([^`\\\\]*(?:\\\\.[^`\\\\]*)*)`", LiteralStringBacktick, nil},
59-
{`"`, LiteralStringDouble, Push("string")},
60-
},
61-
"magicfuncs": {
62-
{Words(``, `\b`, `__construct`, `__destruct`, `__call`, `__callStatic`, `__get`, `__set`, `__isset`, `__unset`, `__sleep`, `__wakeup`, `__toString`, `__invoke`, `__set_state`, `__clone`, `__debugInfo`), NameFunctionMagic, nil},
63-
},
64-
"magicconstants": {
65-
{Words(``, `\b`, `__LINE__`, `__FILE__`, `__DIR__`, `__FUNCTION__`, `__CLASS__`, `__TRAIT__`, `__METHOD__`, `__NAMESPACE__`), NameConstant, nil},
66-
},
67-
"classname": {
68-
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameClass, Pop(1)},
69-
},
70-
"functionname": {
71-
Include("magicfuncs"),
72-
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameFunction, Pop(1)},
73-
Default(Pop(1)),
74-
},
75-
"string": {
76-
{`"`, LiteralStringDouble, Pop(1)},
77-
{`[^{$"\\]+`, LiteralStringDouble, nil},
78-
{`\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})`, LiteralStringEscape, nil},
79-
{`\$(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*(\[\S+?\]|->(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)?`, LiteralStringInterpol, nil},
80-
{`(\{\$\{)(.*?)(\}\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil},
81-
{`(\{)(\$.*?)(\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil},
82-
{`(\$\{)(\S+)(\})`, ByGroups(LiteralStringInterpol, NameVariable, LiteralStringInterpol), nil},
83-
{`[${\\]`, LiteralStringDouble, nil},
84-
},
19+
phpCommonRules.Rename("php", "root"),
20+
))
21+
22+
var phpCommonRules = Rules{
23+
"php": {
24+
{`\?>`, CommentPreproc, Pop(1)},
25+
{`(<<<)([\'"]?)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)`, ByGroups(LiteralString, LiteralString, LiteralStringDelimiter, LiteralString, LiteralStringDelimiter, Punctuation, Text), nil},
26+
{`\s+`, Text, nil},
27+
{`#.*?\n`, CommentSingle, nil},
28+
{`//.*?\n`, CommentSingle, nil},
29+
{`/\*\*/`, CommentMultiline, nil},
30+
{`/\*\*.*?\*/`, LiteralStringDoc, nil},
31+
{`/\*.*?\*/`, CommentMultiline, nil},
32+
{`(->|::)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Operator, Text, NameAttribute), nil},
33+
{`[~!%^&*+=|:.<>/@-]+`, Operator, nil},
34+
{`\?`, Operator, nil},
35+
{`[\[\]{}();,]+`, Punctuation, nil},
36+
{`(class)(\s+)`, ByGroups(Keyword, Text), Push("classname")},
37+
{`(function)(\s*)(?=\()`, ByGroups(Keyword, Text), nil},
38+
{`(function)(\s+)(&?)(\s*)`, ByGroups(Keyword, Text, Operator, Text), Push("functionname")},
39+
{`(const)(\s+)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)`, ByGroups(Keyword, Text, NameConstant), nil},
40+
{`(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally)\b`, Keyword, nil},
41+
{`(true|false|null)\b`, KeywordConstant, nil},
42+
Include("magicconstants"),
43+
{`\$\{\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*\}`, NameVariable, nil},
44+
{`\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameVariable, nil},
45+
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameOther, nil},
46+
{`(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil},
47+
{`\d+e[+-]?[0-9]+`, LiteralNumberFloat, nil},
48+
{`0[0-7]+`, LiteralNumberOct, nil},
49+
{`0x[a-f0-9]+`, LiteralNumberHex, nil},
50+
{`\d+`, LiteralNumberInteger, nil},
51+
{`0b[01]+`, LiteralNumberBin, nil},
52+
{`'([^'\\]*(?:\\.[^'\\]*)*)'`, LiteralStringSingle, nil},
53+
{"`([^`\\\\]*(?:\\\\.[^`\\\\]*)*)`", LiteralStringBacktick, nil},
54+
{`"`, LiteralStringDouble, Push("string")},
55+
},
56+
"magicfuncs": {
57+
{Words(``, `\b`, `__construct`, `__destruct`, `__call`, `__callStatic`, `__get`, `__set`, `__isset`, `__unset`, `__sleep`, `__wakeup`, `__toString`, `__invoke`, `__set_state`, `__clone`, `__debugInfo`), NameFunctionMagic, nil},
58+
},
59+
"magicconstants": {
60+
{Words(``, `\b`, `__LINE__`, `__FILE__`, `__DIR__`, `__FUNCTION__`, `__CLASS__`, `__TRAIT__`, `__METHOD__`, `__NAMESPACE__`), NameConstant, nil},
61+
},
62+
"classname": {
63+
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameClass, Pop(1)},
64+
},
65+
"functionname": {
66+
Include("magicfuncs"),
67+
{`(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*`, NameFunction, Pop(1)},
68+
Default(Pop(1)),
69+
},
70+
"string": {
71+
{`"`, LiteralStringDouble, Pop(1)},
72+
{`[^{$"\\]+`, LiteralStringDouble, nil},
73+
{`\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})`, LiteralStringEscape, nil},
74+
{`\$(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*(\[\S+?\]|->(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)?`, LiteralStringInterpol, nil},
75+
{`(\{\$\{)(.*?)(\}\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil},
76+
{`(\{)(\$.*?)(\})`, ByGroups(LiteralStringInterpol, UsingSelf("root"), LiteralStringInterpol), nil},
77+
{`(\$\{)(\S+)(\})`, ByGroups(LiteralStringInterpol, NameVariable, LiteralStringInterpol), nil},
78+
{`[${\\]`, LiteralStringDouble, nil},
8579
},
86-
).SetAnalyser(func(text string) float32 {
87-
if strings.Contains(text, "<?php") {
88-
return 0.5
89-
}
90-
return 0.0
91-
})))
80+
}

lexers/circular/phtml.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package circular
2+
3+
import (
4+
"strings"
5+
6+
. "github.com/alecthomas/chroma" // nolint
7+
"github.com/alecthomas/chroma/lexers/h"
8+
"github.com/alecthomas/chroma/lexers/internal"
9+
)
10+
11+
// PHTML lexer is PHP in HTML.
12+
var PHTML = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
13+
&Config{
14+
Name: "PHTML",
15+
Aliases: []string{"phtml"},
16+
Filenames: []string{"*.phtml"},
17+
MimeTypes: []string{"application/x-php", "application/x-httpd-php", "application/x-httpd-php3", "application/x-httpd-php4", "application/x-httpd-php5"},
18+
DotAll: true,
19+
CaseInsensitive: true,
20+
EnsureNL: true,
21+
},
22+
Rules{
23+
"root": {
24+
{`<\?(php)?`, CommentPreproc, Push("php")},
25+
{`[^<]+`, Other, nil},
26+
{`<`, Other, nil},
27+
},
28+
}.Merge(phpCommonRules),
29+
).SetAnalyser(func(text string) float32 {
30+
if strings.Contains(text, "<?php") {
31+
return 0.5
32+
}
33+
return 0.0
34+
})))

lexers/lexers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestLexers(t *testing.T) {
7373
if os.Getenv("RECORD") == "true" {
7474
// Update the expected file with the generated output of this lexer
7575
f, err := os.Create(expectedFilename)
76-
defer f.Close()
76+
defer f.Close() // nolint: gosec
7777
assert.NoError(t, err)
7878
assert.NoError(t, formatters.JSON.Format(f, nil, chroma.Literator(actual...)))
7979
} else {

lexers/testdata/php.actual

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<body>
4-
5-
<h1>My first PHP page</h1>
6-
<?php
7-
81
$docs = $modx->getIterator('modResource', ["parent" => 84]);
92

103
foreach($docs as $doc){
114
$q=$doc->content;
125
$doc->set("content", preg_replace("/Some value/i", "Replacement", $q));
136
print_r($doc->content);
147
// $doc->save();
15-
}
8+
}
169
// some comment
17-
?>
18-
</body>
19-
</html>

lexers/testdata/php.expected

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
[
2-
{"type":"CommentPreproc","value":"\u003c!DOCTYPE html\u003e"},
3-
{"type":"Text","value":"\n"},
4-
{"type":"Punctuation","value":"\u003c"},
5-
{"type":"NameTag","value":"html"},
6-
{"type":"Punctuation","value":"\u003e"},
7-
{"type":"Text","value":"\n"},
8-
{"type":"Punctuation","value":"\u003c"},
9-
{"type":"NameTag","value":"body"},
10-
{"type":"Punctuation","value":"\u003e"},
11-
{"type":"Text","value":"\n\n"},
12-
{"type":"Punctuation","value":"\u003c"},
13-
{"type":"NameTag","value":"h1"},
14-
{"type":"Punctuation","value":"\u003e"},
15-
{"type":"Text","value":"My first PHP page"},
16-
{"type":"Punctuation","value":"\u003c/"},
17-
{"type":"NameTag","value":"h1"},
18-
{"type":"Punctuation","value":"\u003e"},
19-
{"type":"Text","value":"\n"},
20-
{"type":"CommentPreproc","value":"\u003c?php"},
21-
{"type":"Text","value":"\n\n"},
222
{"type":"NameVariable","value":"$docs"},
233
{"type":"Text","value":" "},
244
{"type":"Operator","value":"="},
@@ -81,16 +61,6 @@
8161
{"type":"Text","value":"\n "},
8262
{"type":"CommentSingle","value":"// $doc-\u003esave();\n"},
8363
{"type":"Punctuation","value":"}"},
84-
{"type":"Text","value":" \n"},
85-
{"type":"CommentSingle","value":"// some comment\n"},
86-
{"type":"CommentPreproc","value":"?\u003e"},
87-
{"type":"Text","value":"\n"},
88-
{"type":"Punctuation","value":"\u003c/"},
89-
{"type":"NameTag","value":"body"},
90-
{"type":"Punctuation","value":"\u003e"},
9164
{"type":"Text","value":"\n"},
92-
{"type":"Punctuation","value":"\u003c/"},
93-
{"type":"NameTag","value":"html"},
94-
{"type":"Punctuation","value":"\u003e"},
95-
{"type":"Text","value":"\n"}
65+
{"type":"CommentSingle","value":"// some comment\n"}
9666
]

lexers/testdata/phtml.actual

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
5+
<h1>My first PHP page</h1>
6+
<?php
7+
8+
$docs = $modx->getIterator('modResource', ["parent" => 84]);
9+
10+
foreach($docs as $doc){
11+
$q=$doc->content;
12+
$doc->set("content", preg_replace("/Some value/i", "Replacement", $q));
13+
print_r($doc->content);
14+
// $doc->save();
15+
}
16+
// some comment
17+
?>
18+
</body>
19+
</html>

lexers/testdata/phtml.expected

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
[
2+
{"type":"CommentPreproc","value":"\u003c!DOCTYPE html\u003e"},
3+
{"type":"Text","value":"\n"},
4+
{"type":"Punctuation","value":"\u003c"},
5+
{"type":"NameTag","value":"html"},
6+
{"type":"Punctuation","value":"\u003e"},
7+
{"type":"Text","value":"\n"},
8+
{"type":"Punctuation","value":"\u003c"},
9+
{"type":"NameTag","value":"body"},
10+
{"type":"Punctuation","value":"\u003e"},
11+
{"type":"Text","value":"\n\n"},
12+
{"type":"Punctuation","value":"\u003c"},
13+
{"type":"NameTag","value":"h1"},
14+
{"type":"Punctuation","value":"\u003e"},
15+
{"type":"Text","value":"My first PHP page"},
16+
{"type":"Punctuation","value":"\u003c/"},
17+
{"type":"NameTag","value":"h1"},
18+
{"type":"Punctuation","value":"\u003e"},
19+
{"type":"Text","value":"\n"},
20+
{"type":"CommentPreproc","value":"\u003c?php"},
21+
{"type":"Text","value":"\n\n"},
22+
{"type":"NameVariable","value":"$docs"},
23+
{"type":"Text","value":" "},
24+
{"type":"Operator","value":"="},
25+
{"type":"Text","value":" "},
26+
{"type":"NameVariable","value":"$modx"},
27+
{"type":"Operator","value":"-\u003e"},
28+
{"type":"NameAttribute","value":"getIterator"},
29+
{"type":"Punctuation","value":"("},
30+
{"type":"LiteralStringSingle","value":"'modResource'"},
31+
{"type":"Punctuation","value":","},
32+
{"type":"Text","value":" "},
33+
{"type":"Punctuation","value":"["},
34+
{"type":"LiteralStringDouble","value":"\"parent\""},
35+
{"type":"Text","value":" "},
36+
{"type":"Operator","value":"=\u003e"},
37+
{"type":"Text","value":" "},
38+
{"type":"LiteralNumberInteger","value":"84"},
39+
{"type":"Punctuation","value":"]);"},
40+
{"type":"Text","value":"\n\n"},
41+
{"type":"Keyword","value":"foreach"},
42+
{"type":"Punctuation","value":"("},
43+
{"type":"NameVariable","value":"$docs"},
44+
{"type":"Text","value":" "},
45+
{"type":"Keyword","value":"as"},
46+
{"type":"Text","value":" "},
47+
{"type":"NameVariable","value":"$doc"},
48+
{"type":"Punctuation","value":"){"},
49+
{"type":"Text","value":"\n "},
50+
{"type":"NameVariable","value":"$q"},
51+
{"type":"Operator","value":"="},
52+
{"type":"NameVariable","value":"$doc"},
53+
{"type":"Operator","value":"-\u003e"},
54+
{"type":"NameAttribute","value":"content"},
55+
{"type":"Punctuation","value":";"},
56+
{"type":"Text","value":"\n "},
57+
{"type":"NameVariable","value":"$doc"},
58+
{"type":"Operator","value":"-\u003e"},
59+
{"type":"NameAttribute","value":"set"},
60+
{"type":"Punctuation","value":"("},
61+
{"type":"LiteralStringDouble","value":"\"content\""},
62+
{"type":"Punctuation","value":","},
63+
{"type":"Text","value":" "},
64+
{"type":"NameOther","value":"preg_replace"},
65+
{"type":"Punctuation","value":"("},
66+
{"type":"LiteralStringDouble","value":"\"/Some value/i\""},
67+
{"type":"Punctuation","value":","},
68+
{"type":"Text","value":" "},
69+
{"type":"LiteralStringDouble","value":"\"Replacement\""},
70+
{"type":"Punctuation","value":","},
71+
{"type":"Text","value":" "},
72+
{"type":"NameVariable","value":"$q"},
73+
{"type":"Punctuation","value":"));"},
74+
{"type":"Text","value":"\n "},
75+
{"type":"NameOther","value":"print_r"},
76+
{"type":"Punctuation","value":"("},
77+
{"type":"NameVariable","value":"$doc"},
78+
{"type":"Operator","value":"-\u003e"},
79+
{"type":"NameAttribute","value":"content"},
80+
{"type":"Punctuation","value":");"},
81+
{"type":"Text","value":"\n "},
82+
{"type":"CommentSingle","value":"// $doc-\u003esave();\n"},
83+
{"type":"Punctuation","value":"}"},
84+
{"type":"Text","value":" \n"},
85+
{"type":"CommentSingle","value":"// some comment\n"},
86+
{"type":"CommentPreproc","value":"?\u003e"},
87+
{"type":"Text","value":"\n"},
88+
{"type":"Punctuation","value":"\u003c/"},
89+
{"type":"NameTag","value":"body"},
90+
{"type":"Punctuation","value":"\u003e"},
91+
{"type":"Text","value":"\n"},
92+
{"type":"Punctuation","value":"\u003c/"},
93+
{"type":"NameTag","value":"html"},
94+
{"type":"Punctuation","value":"\u003e"},
95+
{"type":"Text","value":"\n"}
96+
]

0 commit comments

Comments
 (0)