Skip to content

Commit

Permalink
Implement literals and tweak colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearsandwich committed Oct 16, 2011
1 parent 380df9d commit 26ee85b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,31 @@ language.*
- `return_local`
- `require:`
- `match`
- `match`
- `->`
- `=>`
- `case`
- Constants
- Special Variables
`- `true`, `false`, `nil`, `self`, `super`
- Blocks
- `{ .. }` are recognized but nothing is done with them as yet


## What Needs Work
- Keywords
- `->`
- `=>`
- Literal Strings (without interpolation)
- Literal Numbers
- Literal Strings
- Literal Symbols
- Here Documents


## What Needs Work
- Comments
- Instance Variables
- Class Variables
- Indenting Block Openings
- De-indenting Block Closes
- Message Selectors
ost Message Sends
- Block arguments
- Method Selectors
- Method Sends
- Interpolated Strings
- And all the stuff I haven't seen or thought of yet.


[F]: http://fancy-lang.org
20 changes: 14 additions & 6 deletions syntax/fancy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,35 @@ endif
syn keyword fancyKeyword class def try catch finally retry return return_local
syn keyword fancyKeyword match case
" use match for `require:` since Vim doesn't like the colon in a keyword.
syn match fancyKeyword '\(require:\|->\|=>\)'
syn match fancyKeyword /\(require:\|->\|=>\)/

" Special variables
syn keyword fancySpecialVar nil self super
syn keyword fancyBoolean true false

" Literals
syn match fancyInteger '[0-9]+'
syn match fancyFloat '[0-9]+\.[0-9]+'
"syn match
syn match fancyInteger /\i\@<![-+]\?\d\+/
syn match fancyFloat /\i\@<![-+]\?\d\+\.\d\+/
syn match fancySymbol /'[-0-9A-Za-z_\^?:=|]\+/
syn region fancyNonInterpString start='"' skip='\\"' end='"'
syn region fancyHereDoc start='"""' end='"""'

syn match fancyConstant '[A-Z][a-zA-Z0-9_]*'
" Constants and Identifiers
syn match fancyConstant '\u\w*'

" Syntax Blocks
syn region fancyBlock start="{" end="}" fold transparent


let b:current_syntax = "fancy"

" Highlighting
highlight def link fancyKeyword Keyword
highlight def link fancyConstant Constant
highlight def link fancySpecialVar Special
highlight def link fancyBoolean Boolean
highlight def link fancyInteger Number
highlight def link fancyFloat Float
highlight def link fancySymbol Label
highlight def link fancyNonInterpString String
highlight def link fancyHereDoc String

0 comments on commit 26ee85b

Please sign in to comment.