Skip to content

Commit

Permalink
Merge pull request #39 from TheLazyDutchmen/syntax-highlighting
Browse files Browse the repository at this point in the history
Syntax highlighting
  • Loading branch information
TheLazyDutchman authored Apr 8, 2022
2 parents 080abbb + 3c61e4d commit 8fc52f1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Lumina is a hobby programming language.

It is self-hosted and compiled, as well as statically typed.

- [Quick Start](#quick-start)
- [Variables](#variables)
- [Types](#types)
- [Importing](#importing)
- [Functions](#functions)
- [Syntax Highlighting](#syntax-highlighting)

## Support
Lumina can currently be compiled to:
* `linux x84_64`
Expand Down Expand Up @@ -90,5 +97,17 @@ func max(int a, int b) -> int {
return b;
}
```
## Syntax HighLighting
files for syntax highlighting can be found in the [Editor Folder](/editors).
currently supported are:
- [x] vim
- [ ] emacs
- [ ] vscode

### Vim Setup
to setup syntax highlighting, copy the `lumina.vim` file to the location `~/.vim/syntax/lumina.vim`, and then add the following line to your `vimrc` file:
```vimrc
au BufRead,BufNewFile *.lumina set filetype=lumina
```
## Standard Library
The standard library is currently very prone to changes, therefore, it may take a while to create good documentation for it, if you want to see the functions that are defined currently, you can see them in the `std` directory. To use those functions, you will need to use `import` with a local path to the corresponding file in `std`.
16 changes: 16 additions & 0 deletions editors/lumina.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syn keyword basicKeyword var const if else while func type sizeof return import
syn match comment "//.*$"
syn match identifier "[A-Za-z_]\+"
syn region block start="{" end="}" fold transparent
syn match number "\d\+"
syn match string '".*"'
syn match character "\'\\?\'"

let b:current_syntax = "lumina"

hi def link basicKeyword Statement
hi def link comment Comment
hi def link number Constant
hi def link string Constant
hi def link character Constant
hi def link identifier Type

0 comments on commit 8fc52f1

Please sign in to comment.