Rewrite parser to support block/dynamic comments

This commit is contained in:
alstr
2021-03-28 09:56:33 +01:00
parent a6fcdf71b1
commit cd988d2d92
8 changed files with 1269 additions and 300 deletions

231
syntax.json Normal file
View File

@@ -0,0 +1,231 @@
[
{
"language": "Python",
"markers": [
{
"type": "line",
"pattern": "#"
}
]
},
{
"language": "YAML",
"markers": [
{
"type": "line",
"pattern": "#"
}
]
},
{
"language": "Ruby",
"markers": [
{
"type": "line",
"pattern": "#"
},
{
"type": "block",
"pattern": {
"start": "=begin",
"end": "=end"
}
}
]
},
{
"language": "PHP",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "line",
"pattern": "#"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
},
{
"type": "block",
"pattern": {
"start": "<!--",
"end": "-->"
}
}
]
},
{
"language": "C",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "C++",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "C#",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "Java",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "JavaScript",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "Kotlin",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "Objective-C",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "SASS",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "Swift",
"markers": [
{
"type": "line",
"pattern": "//"
},
{
"type": "block",
"pattern": {
"start": "/\\*",
"end": "\\*/"
}
}
]
},
{
"language": "HTML",
"markers": [
{
"type": "block",
"pattern": {
"start": "<!--",
"end": "-->"
}
}
]
},
{
"language": "CSS",
"markers": [
{
"type": "block",
"pattern": {
"start": "<!--",
"end": "-->"
}
}
]
}
]