mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 14:57:18 +09:00
Add syntax highlighting for Solidity
This commit is contained in:
@@ -33,6 +33,7 @@ Here is a list of the files that have been converted to properly use colorscheme
|
||||
* sh
|
||||
* git
|
||||
* tex
|
||||
* solidity
|
||||
|
||||
# License
|
||||
|
||||
|
||||
41
runtime/syntax/solidity.micro
Normal file
41
runtime/syntax/solidity.micro
Normal file
@@ -0,0 +1,41 @@
|
||||
# Solidity syntax for Micro
|
||||
# Copyright (C) 2016 Nicolai Søborg
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
syntax "solidity" "\.sol$"
|
||||
|
||||
color preproc "\b(contract|library|pragma)\b"
|
||||
color constant.number "\b[-]?([0-9]+|0x[0-9a-fA-F]+)\b"
|
||||
color identifier "[a-zA-Z][_a-zA-Z0-9]*[[:space:]]*"
|
||||
|
||||
color statement "\b(assembly|break|continue|do|for|function|if|else|new|return|returns|while)\b"
|
||||
color special "\b(\.send|throw)\b" # make sure they are very visible
|
||||
color keyword "\b(anonymous|constant|indexed|payable|public|private|external|internal)\b"
|
||||
|
||||
color constant "\b(block(\.(blockhash|coinbase|difficulty|gaslimit|number|timestamp))?|msg(\.(data|gas|sender|value))?|now|tx(\.(gasprice|origin))?)\b"
|
||||
color constant "\b(keccak256|sha3|sha256|ripemd160|ecrecover|addmod|mulmod|this|super|selfdestruct|\.balance)\b"
|
||||
|
||||
color constant "\b(true|false)\b"
|
||||
color constant "\b(wei|szabo|finney|ether|seconds|minutes|hours|days|weeks|years)\b"
|
||||
color type "\b(address|bool|mapping|string|var|int(\d*)|uint(\d*)|byte(\d*)|fixed(\d*)|ufixed(\d*))\b"
|
||||
|
||||
color error "\b(abstract|after|case|catch|default|final|in|inline|interface|let|match|null|of|pure|relocatable|static|switch|try|type|typeof|view)\b"
|
||||
|
||||
color operator "[-+/*=<>!~%?:&|]"
|
||||
|
||||
color comment "(^|[[:space:]])//.*"
|
||||
color comment "/\*.+\*/"
|
||||
color todo "TODO:?"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
Reference in New Issue
Block a user