main
Last change
on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
929 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | // https://qiskit.github.io/openqasm/grammar/index.html
|
---|
| 2 |
|
---|
| 3 | Prism.languages.openqasm = {
|
---|
| 4 | 'comment': /\/\*[\s\S]*?\*\/|\/\/.*/,
|
---|
| 5 | 'string': {
|
---|
| 6 | pattern: /"[^"\r\n\t]*"|'[^'\r\n\t]*'/,
|
---|
| 7 | greedy: true
|
---|
| 8 | },
|
---|
| 9 |
|
---|
| 10 | 'keyword': /\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,
|
---|
| 11 | 'class-name': /\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,
|
---|
| 12 | 'function': /\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,
|
---|
| 13 |
|
---|
| 14 | 'constant': /\b(?:euler|pi|tau)\b|π|𝜏|ℇ/,
|
---|
| 15 | 'number': {
|
---|
| 16 | pattern: /(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,
|
---|
| 17 | lookbehind: true
|
---|
| 18 | },
|
---|
| 19 | 'operator': /->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,
|
---|
| 20 | 'punctuation': /[(){}\[\];,:.]/
|
---|
| 21 | };
|
---|
| 22 |
|
---|
| 23 | Prism.languages.qasm = Prism.languages.openqasm;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.