-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ligo: adding support for ligolang, http://ligolang.org
- Loading branch information
Brice Aldrich
committed
Jun 21, 2019
1 parent
f571cfc
commit 50990d3
Showing
16 changed files
with
257 additions
and
14 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// LIGO lang is a layer 2 smart contract language for the tezos blockchain | ||
|
||
Prism.languages.ligo = { | ||
'comment': [ | ||
/\(\*[\s\S]+?\*\)/, | ||
/\/\/.*/ | ||
], | ||
'string': [ | ||
{ | ||
pattern: /(?:'(?:''|[^'\r\n])*'|#[&$%]?[a-f\d]+)+|\^[a-z]/i, | ||
greedy: true | ||
}, | ||
{ | ||
pattern: /(?:"(?:""|[^"\r\n])*"|#[&$%]?[a-f\d]+)+|\^[a-z]/i, | ||
greedy: true | ||
}, | ||
], | ||
'keyword': [ | ||
{ | ||
// Turbo Pascal | ||
pattern: /(^|[^&])\b(?:if|while|for|return|nil|remove|from|else|then|skip|with|is|function|var|const|type|end|begin|block)\b/i, | ||
lookbehind: true | ||
}, | ||
{ | ||
// Free Pascal | ||
pattern: /(^|[^&])\b(?:True|False)\b/i, | ||
lookbehind: true | ||
}, | ||
], | ||
'builtin': { | ||
pattern: /(^|[^&])\b(?:int|unit|string|nat|map)\b/i, | ||
lookbehind: true | ||
}, | ||
'function': { | ||
pattern: /(?!with\b)\b\w+ ?(?=\()/i, | ||
lookbehind: true | ||
}, | ||
'variable': [ | ||
{ | ||
pattern: /\w+ ?(?=\:\=)/i, | ||
lookbehind: true | ||
}, | ||
{ | ||
pattern: /\w+ ?(?=\:)/i, | ||
lookbehind: true | ||
}, | ||
], | ||
'class-name': { | ||
pattern: /\w+ ?(?= is ?)/i, | ||
lookbehind: true | ||
}, | ||
'number': [ | ||
// Hexadecimal, octal and binary | ||
/(?:[&%]\d+|\$[a-f\d]+)/i, | ||
// Decimal | ||
/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i | ||
], | ||
'operator': [ | ||
/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/i, | ||
], | ||
'punctuation': /\(\.|\.\)|[()\[\]:;,.]/ | ||
}; | ||
|
||
Prism.languages.objectligo = Prism.languages.ligo; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.