Showing off an example of the CeeV language

Very much in the beginning phase, and I haven't starting the parsing
yet, but it is a start.
master
Ruben Dahl 2023-01-15 15:27:31 +01:00
parent c5a1cda975
commit 9745e4d63a
No known key found for this signature in database
GPG Key ID: C7838D0300EDEF1B
4 changed files with 29 additions and 11 deletions

View File

@ -0,0 +1,4 @@
name=examples
version=0.0.1
author=Ruben Dahl
email=dahrub@nxi.no

View File

@ -0,0 +1,19 @@
// creating a character
let mainCharacter = Character("Testy", "testy.png")
// creating a location
let mainLoc = Location("location.png")
// entering a location
show mainLoc
enter mainCharacter center
mainCharacter "Hello World"
// exiting a location
exit mainCharacter
hide mainLoc
// cleanup
unlet mainCharacter
unlet mainLoc

View File

@ -1,4 +0,0 @@
let test = Character("Test")
test "Hello World"
unlet test

View File

@ -1,16 +1,14 @@
if exists("b:current_syntax") if exists("b:current_syntax") | finish | endif
finish
endif
set iskeyword=a-z,A-Z,-,*,_,!,@ set iskeyword=a-z,A-Z,-,*,_,!,@
" Language keywords " Language keywords
syntax keyword ceevKeywords let unlet syntax keyword ceevKeywords let unlet enter exit show hide
syntax keyword ceevTodos TODO
syntax keyword ceevConstant Character syntax keyword ceevConstant Character Location Image
" Comments " Comments
syntax region ceevCommentLine start="//" end="$" contains=ceevTodos syntax region ceevCommentLine start="//" end="$" contains=ceevTodos
" String literals " String literals
syntax region ceevString start=/\v"/ skip=/\v\\./ end=/\v"/ contains=ceevEscapes syntax region ceevString start=/\v"/ skip=/\v\\./ end=/\v"/ contains=ceevEscapes
@ -24,6 +22,7 @@ syntax match ceevEscapes display contained "\\[nr\"']"
" Number literals " Number literals
syntax region ceevNumber start=/\s\d/ skip=/\d/ end=/\s/ syntax region ceevNumber start=/\s\d/ skip=/\d/ end=/\s/
" Set highlights " Set highlights
highlight default link ceevTodos Todo highlight default link ceevTodos Todo
highlight default link ceevKeywords Keyword highlight default link ceevKeywords Keyword