Skip to content
Snippets Groups Projects
Commit 4d9580f9 authored by Kunshan Wang's avatar Kunshan Wang
Browse files

Initial commit.

parents
No related merge requests found
LICENSE 0 → 100644
The MIT License (MIT)
Copyright (c) 2014 Kunshan Wang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Vim Syntax Highlighting for MicroVM Intermediate Representation
===============================================================
Copy all directories into your `~/.vim/` directory, but
[Vundle](https://github.com/gmarik/Vundle.vim) or
[Pathogen](https://github.com/tpope/vim-pathogen) is recommended for managing
your Vim plugins.
There are some µIR snippets in the `tests` directory of the
[microvm-refimpl](https://github.com/microvm-project/microvm-refimpl) project.
Author
------
Kunshan Wang <wks1986@gmail.com>
autocmd BufRead,BufNewFile *.uir set filetype=uir
" Vim syntax file
" Language: MicroVM Intermediate Representation (Text Form)
" Maintainer: Kunshan Wang
" Latest Revision: 14 Aug 2014
if exists("b:current_syntax")
finish
endif
setlocal iskeyword+=.
syntax region uirComment start=/\/\// end=/$/
syntax keyword uirTopLevel .typedef .funcsig .const .global .funcdecl .funcdef
syntax keyword uirType int float double ref iref weakref struct array hybrid void
syntax keyword uirType func stack thread tagref64
syntax keyword uirInst ADD SUB MUL UDIV SDIV UREM SREM SHL LSHR ASHR AND OR XOR
syntax keyword uirInst FADD FSUB FMUL FDIV FREM
syntax keyword uirInst EQ NE ULT ULE UGT UGE SLT SLE SGT SGE
syntax keyword uirInst FTRUE FFALSE FORD FOEQ FONE FOLT FOLE FOGT FOGE
syntax keyword uirInst FUNO FUEQ FUNE FULT FULE FUGT FUGE
syntax keyword uirInst TRUNC ZEXT SEXT FPTRUNC FPEXT FPTOUI FPTOSI UITOFP SITOFP
syntax keyword uirInst BITCAST REFCAST IREFCAST FUNCCAST
syntax keyword uirInst SELECT BRANCH BRANCH2 SWITCH PHI CALL INVOKE TAILCALL
syntax keyword uirInst RET RETVOID THROW LANDINGPAD EXTRACTVALUE INSERTVALUE
syntax keyword uirInst NEW NEWHYBRID ALLOCA ALLOCAHYBRID GETIREF GETFIELDIREF
syntax keyword uirInst GETELEMIREF SHIFTIREF GETFIXEDPARTIREF GETVARPARTIREF
syntax keyword uirInst LOAD STORE CMPXCHG ATOMICRMW FENCE TRAP WATCHPOINT
syntax keyword uirInst CCALL NEWSTACK ICALL IINVOKE
syntax keyword uirMemOrder NOT_ATOMIC UNORDERED MONOTONIC ACQUIRE CONSUME
syntax keyword uirMemOrder RELEASE ACQ_REL SEQ_CST
syntax keyword uirAtomicRMWOp XCHG ADD SUB AND NAND OR XOR MIN MAX UMIN UMAX
syntax keyword uirCallConv DEFAULT
syntax keyword uirMisc KEEPALIVE bitsf bitsd
syntax match uirIdentifier /[@%][a-zA-Z0-9_\-.]\+/
syntax match uirIntLiteral /[+-]\?\(0[xX][0-9a-fA-F]\+\|0[0-7]*\|[1-9][0-9]*\)/
syntax match uirFpLiteral /\([0-9]\+\.[0-9]\+\(e[+-]\?[0-9]\+\)\?\|nan\|[+-]\?inf\)[fd]/
syntax match uirNullLiteral /NULL/
syntax region uirAngularBrackets start=/</ end=/>/ contains=ALL
highlight link uirComment Comment
highlight link uirTopLevel Statement
highlight link uirType Type
highlight link uirInst Operator
highlight link uirMemOrder Keyword
highlight link uirAtomicRMWOp Keyword
highlight link uirCallConv Keyword
highlight link uirMisc Keyword
highlight link uirIdentifier Identifier
highlight link uirIntLiteral Number
highlight link uirFpLiteral Float
highlight link uirNullLiteral Constant
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment