| 1 |
filetype: solidity |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.sol$" |
| 5 |
|
| 6 |
rules: |
| 7 |
- preproc: "\\b(contract|library|pragma)\\b" |
| 8 |
- constant.number: "\\b[-]?([0-9]+|0x[0-9a-fA-F]+)\\b" |
| 9 |
- identifier: "[a-zA-Z][_a-zA-Z0-9]*[[:space:]]*" |
| 10 |
- statement: "\\b(assembly|break|continue|do|for|function|if|else|new|return|returns|while)\\b" |
| 11 |
- special: "\\b(\\.send|throw)\\b" # make sure they are very visible |
| 12 |
- type.keyword: "\\b(anonymous|constant|indexed|payable|public|private|external|internal)\\b" |
| 13 |
- constant: "\\b(block(\\.(blockhash|coinbase|difficulty|gaslimit|number|timestamp))?|msg(\\.(data|gas|sender|value))?|now|tx(\\.(gasprice|origin))?)\\b" |
| 14 |
- constant: "\\b(keccak256|sha3|sha256|ripemd160|ecrecover|addmod|mulmod|this|super|selfdestruct|\\.balance)\\b" |
| 15 |
- constant: "\\b(true|false)\\b" |
| 16 |
- constant: "\\b(wei|szabo|finney|ether|seconds|minutes|hours|days|weeks|years)\\b" |
| 17 |
- type: "\\b(address|bool|mapping|string|var|int(\\d*)|uint(\\d*)|byte(\\d*)|fixed(\\d*)|ufixed(\\d*))\\b" |
| 18 |
- error: "\\b(abstract|after|case|catch|default|final|in|inline|interface|let|match|null|of|pure|relocatable|static|switch|try|type|typeof|view)\\b" |
| 19 |
- operator: "[-+/*=<>!~%?:&|]" |
| 20 |
- comment: |
| 21 |
start: "//" |
| 22 |
end: "$" |
| 23 |
rules: [] |
| 24 |
- comment: |
| 25 |
start: "/\\*" |
| 26 |
end: "\\*/" |
| 27 |
rules: [] |
| 28 |
- todo: "TODO:?" |
| 29 |
- constant.string: |
| 30 |
start: "\"" |
| 31 |
end: "\"" |
| 32 |
skip: "\\\\." |
| 33 |
rules: |
| 34 |
- constant.specialChar: "\\\\." |
| 35 |
- constant.string: |
| 36 |
start: "'" |
| 37 |
end: "'" |
| 38 |
skip: "\\\\." |
| 39 |
rules: |
| 40 |
- constant.specialChar: "\\\\." |
| 41 |
|