StarBasic Support in Pygments

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
flywire
Posts: 9
Joined: Sun Aug 01, 2021 1:42 am

StarBasic Support in Pygments

Post by flywire »

The Code Highlighter 2 extension does not have StarBasic support. I notice https://wiki.openoffice.org/ has <syntaxhighlight lang="oobas">. How can I get a copy of the language definition files?
 Edit: Moved from Code Snippets. 
OpenOffice 4.1 on Windows 10
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: StarBasic Support in Pygments

Post by Lupp »

Deleted by the author. Comment obsolete.
Last edited by Lupp on Sun Jun 26, 2022 7:24 pm, edited 1 time in total.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: StarBasic Support in Pygments

Post by Villeroy »

Language selection "VB.NET" does the job pretty well.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
flywire
Posts: 9
Joined: Sun Aug 01, 2021 1:42 am

Re: StarBasic Support in Pygments

Post by flywire »

A new StarOffice Basic style to get close to the IDE look is nearing completion. It would be good to get some alignment with oobas if it's useful.
OpenOffice 4.1 on Windows 10
flywire
Posts: 9
Joined: Sun Aug 01, 2021 1:42 am

Re: StarBasic Support in Pygments

Post by flywire »

Villeroy wrote: Sun Jun 26, 2022 1:35 pm Language selection "VB.NET" does the job pretty well.
Thanks. Pending:

Code: Select all

aliases = ['vb.net', 'vbnet', 'lobas', 'oobas', 'sobas']
Last edited by flywire on Wed Jun 29, 2022 10:35 am, edited 2 times in total.
OpenOffice 4.1 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: StarBasic Support in Pygments

Post by Villeroy »

The syntax is identical. foo.bar(0).baz is the same object notation like ThisComponent.Sheets(0).DrawPage regardless of the actual meaning.
Basic keywords like Sub, Function, If Then Else, With, For, Next, While, As Object etc. are the same.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
flywire
Posts: 9
Joined: Sun Aug 01, 2021 1:42 am

Re: StarBasic Support in Pygments

Post by flywire »

A new style in Code Highlighter 2 will hopefully match the IDE style except for the punctuation which is variable.
OpenOffice 4.1 on Windows 10
hubert lambert
Posts: 145
Joined: Mon Jun 13, 2016 10:50 am

Re: StarBasic Support in Pygments

Post by hubert lambert »

Hi,

For your information, in response to enhancement requests from flywire (see here and here) Code Highlighter 2 now has two new features:
- option to make use of character styles instead of direct formatting (still improvable);
- pseudo-lexer for LibreOffice Basic (which is in fact a convenient shortcut to VB.net lexer) and two LibreOffice specific styles: libreoffice-classic and libreoffice-dark.
Kind regards.

(The latter feature might become obsolete if Pygments were to embed the same styles).
ch2_1.png
ch2_1.png (77.34 KiB) Viewed 1430 times
ch2_2.png
ch2_2.png (102.82 KiB) Viewed 1430 times
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
flywire
Posts: 9
Joined: Sun Aug 01, 2021 1:42 am

Re: StarBasic Support in Pygments

Post by flywire »

fyi https://github.com/pygments/pygments/re ... tag/2.13.0

Updated lexers:

StarOffice Basic (pygments/pygments#2170)

Added styles:

StarOffice (pygments/pygments#2168)
OpenOffice 4.1 on Windows 10
Post Reply