-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
I am writing a debugger for Go and came across this project via Dmitri Shuralyov and his use of this which uses go/scanner.
One improvement I'd like to see is more fined-grained control over what gets tagged. Rather than reinvent stuff when not necessary, I consulted Pygments to see what it has.
This is from pygments/formatters/terminal.py;
Whitespace: ('lightgray', 'darkgray'),
Comment: ('lightgray', 'darkgray'),
Comment.Preproc: ('teal', 'turquoise'),
Keyword: ('darkblue', 'blue'),
Keyword.Type: ('teal', 'turquoise'),
Operator.Word: ('purple', 'fuchsia'),
Name.Builtin: ('teal', 'turquoise'),
Name.Function: ('darkgreen', 'green'),
Name.Namespace: ('_teal_', '_turquoise_'),
Name.Class: ('_darkgreen_', '_green_'),
Name.Exception: ('teal', 'turquoise'),
Name.Decorator: ('darkgray', 'lightgray'),
Name.Variable: ('darkred', 'red'),
Name.Constant: ('darkred', 'red'),
Name.Attribute: ('teal', 'turquoise'),
Name.Tag: ('blue', 'blue'),
String: ('brown', 'brown'),
Number: ('darkblue', 'blue'),There are some things above that aren't relevant to Go (but you might want to add them for other languages), and there are some things that should be added above for go like Rune, possibly Case label and so on. So here is a list below:
- Whitespace
- Comment
- Keyword
- Type name
- Built in
- Function
- Variable
- Exported name
- Number
- Rune
Kind is a uint8 so there is plenty of space to add constants to this.
If you would like me to create a pull request for this, let me know.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels