Skip to content

Commit

Permalink
add squirre.nut and squirrel.vim
Browse files Browse the repository at this point in the history
  • Loading branch information
ykanda committed Aug 29, 2010
1 parent 4df1178 commit 2780677
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
10 changes: 10 additions & 0 deletions INSTALL 100644 → 100755
@@ -0,0 +1,10 @@
install details

1. make folder
%VIMHOME%/after/syntax

2. copy "squrrel.vim" to
%VIMHOME%/after/syntax

3. write in .vimrc
au BufNewFile,BufRead *.nut setf squirrel
8 changes: 8 additions & 0 deletions README 100644 → 100755
@@ -0,0 +1,8 @@
created by
Yasuhiro Kanda

description
Vim syntax file for Squirrel (http://squirrel-lang.org/default.aspx)

install details
you read INSTALL
46 changes: 46 additions & 0 deletions squirrel.nut
@@ -0,0 +1,46 @@
// statement
break case continue default for while else catch if
switch throw try

// keywords
class clone delegate extends local resume return this
parent yield constructor vargc vargv static function


// operators
! != || == && <= => > + += - -= / /= * *= % %= ++ -- <-
= & ^ | ~ >> << >>> instanceof in delete typeof
[ ] . ::

// other tokens
{ } : ;



// literals
true
false
null
1
12
123
1234
0
00
0xf
0xF
0XF
0Xf
0xFF00A120
0xff00a120
0xcafebabe
0xCAFEBABE
1.52
1.e2
1.e-2
"I'm a string"
@"I'm a verbatim string"
@"I'm a multiline verbatim string"


/* hoghoge */
68 changes: 68 additions & 0 deletions squirrel.vim
@@ -0,0 +1,68 @@
"------------------------------------------------------------------------------
" Vim syntax file
" Language: Squirrel (squirrel-lang.org)
" Maintainer: YASUHIRO.Kanda <yasuhiro.kanda@gmail.com>
" Last Change: 08-Mar-2010.
" Filenames: *.nut
" Version: 0.2
"------------------------------------------------------------------------------
" how to install
"
" 1. make folder
" %VIMHOME%/after/syntax
"
" 2. copy "squrrel.vim" to
" %VIMHOME%/after/syntax
"
" 3. in .vimrc
" au BufNewFile,BufRead *.nut setf squirrel
"------------------------------------------------------------------------------

syn case match
syn keyword sqStatement clone delegate resume return this parent constructor
syn keyword sqStatement vargc vargv yield class extends
syn keyword sqConditional else if switch case default
syn keyword sqExeption try catch throw
syn keyword sqRepeat for while continue break
syn keyword sqOperator in delete typeof instanceof
syn keyword sqFunction function
syn keyword sqStorageClass local static
syn keyword sqConstant null
syn keyword sqBoolean true false

" Comments
syn region sqCommentL start="\/\/" skip="\\$" end="$" keepend
syn region sqComment start=+/\*+ end=+\*/+

" Strings
syn region sqString start=+"+ skip=+\\"+ end=+"+
syn region sqString start=+@"+ skip=+\\"+ end=+"+

" Numbers (decimal, octadecimal, hexadecimal, floating point number)
syn match sqNumberD "\<[1-9]\=\d\+\>" display
syn match sqNumberH "\<0[xX]\x\+\>" display
syn match sqNumberO "\<0\o\>" display
syn match sqFloat "\<\d[\.][e\|E]\=[\-]\=\d\+\>" display

hi def link sqStatement Statement
hi def link sqConditional Conditional
hi def link sqException Exception
hi def link sqLabel Label
hi def link sqRepeat Repeat
hi def link sqOperator Operator
hi def link sqFunction Function
hi def link sqStorageClass StorageClass
hi def link sqConstant Constant
hi def link sqBoolean Boolean
hi def link sqComment Comment
hi def link sqCommentL Comment
hi def link sqString String
hi def link sqCharacter Character
hi def link sqFloat Float
hi def link sqNumberD Number
hi def link sqNumberO Number
hi def link sqNumberH Number
hi def link sqKeyword Keyword

syn sync maxlines=50
let b:current_syntax = "squirrel"

0 comments on commit 2780677

Please sign in to comment.