Closed flywire closed 2 years ago
Hi,
Thank you for the relevant source files. I would be happy to try to suggest specific lexer and style, as soon as I have some free time.
The following file is probably good enough for the styles folder as described in: https://pygments.org/docs/styledevelopment/
star.py
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class StarStyle(Style):
default_style = ""
styles = {
Comment: '#808080', # Gray
Keyword: '#0000FF', # Blue
Name: '#008000', # Green
Name.Function: '#008000', # Green
Name.Class: '#008000', # Green
String: '#FF0000' # Red
}
VbNetLexer is good enough. Need alias for LibreOfficeBasic, OpenOfficeBasic and StarOfficeBasic, maybe lobas, oobas and sobas.
I don't know how to implement the lexer solution but something like one of these two options should work:
class VbNetLexer(RegexLexer):
"""
For Visual Basic.NET source code.
+ Also LibreOffice Basic, OpenOffice Basic, and StarOffice Basic.
"""
name = 'VB.net'
url = 'https://docs.microsoft.com/en-us/dotnet/visual-basic/'
- aliases = ['vb.net', 'vbnet']
+ aliases = ['vb.net', 'vbnet', 'lobas', 'oobas', 'sobas']
from pygments.lexer import VbNetLexer
from pygments.token import *
class StarOfficeBasicLexer(VbNetLexer):
name = 'sobas'
aliases = ['oobas', 'lobas']
def get_tokens_unprocessed(self, text):
for index, token, value in VbNetLexer.get_tokens_unprocessed(self, text):
yield index, token, value
It looks like there is no style to match lo basic and a new style is needed: