Pagination, readable error messages to user, syntax highlighting started.
Pagination now works. Temporary hardcoded 10 pastes per page, will be put in configuration later. Maybe. From now user will receive readable error message if error occured. Started to work on syntax highlighting, tried to make lexers detection work but apparently to no avail.
This commit is contained in:
1 parent
79c7d39759
commit
48d43ca097
221 files changed
+30321
-29
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
package w
|
||||
|
||||
import (
|
||||
. "github.com/alecthomas/chroma" // nolint
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
)
|
||||
|
||||
// WDTE lexer.
|
||||
var WDTE = internal.Register(MustNewLexer(
|
||||
&Config{
|
||||
Name: "WDTE",
|
||||
Filenames: []string{"*.wdte"},
|
||||
},
|
||||
Rules{
|
||||
"root": {
|
||||
{`\n`, Text, nil},
|
||||
{`\s+`, Text, nil},
|
||||
{`\\\n`, Text, nil},
|
||||
{`#(.*?)\n`, CommentSingle, nil},
|
||||
{`-?[0-9]+`, LiteralNumberInteger, nil},
|
||||
{`-?[0-9]*\.[0-9]+`, LiteralNumberFloat, nil},
|
||||
{`"[^"]*"`, LiteralString, nil},
|
||||
{`'[^']*'`, LiteralString, nil},
|
||||
{Words(``, `\b`, `switch`, `default`, `memo`), KeywordReserved, nil},
|
||||
{`{|}|;|->|=>|\(|\)|\[|\]|\.`, Operator, nil},
|
||||
{`[^{};()[\].\s]+`, NameVariable, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
Reference in new issue
Block a user