v0.1.25: support inline ABC in definition modules (new :== code construct)

parent 75a176b7
Pipeline #26091 passed with stage
in 29 seconds
......@@ -252,6 +252,8 @@ var highlightRules = {
],
type: [
[/(where)/, ['keyword'], 'pop'],
[/(:==)(\s*)(code)(\s*)({)/,
['punctuation', 'whitespace', 'keyword', 'whitespace', 'punctuation'], 'jump:abc'],
[/\b(of)\b/, ['keyword'], 'typeOfPattern'],
[/([a-z][\w`]*)/, ['typevar']],
[/(A)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
......@@ -446,12 +448,15 @@ var highlightRules = {
],
abcInstruction: [
[/(})/, ['punctuation'], 'pop:2'],
[/(;)/, ['punctuation'], 'pop'],
[/(\n)/, ['whitespace'], 'pop'],
[/(\|.*\n)/, ['comment'], 'pop'],
[/(\S+)/, ['abc-instruction'], 'jump:abcArgument']
],
abcArgument: [
[/(\n)/, ['whitespace'], 'pop'],
[/(})/, ['punctuation'], 'pop:2'],
[/(;)/, ['punctuation'], 'pop'],
[/(\|.*\n)/, ['comment'], 'pop'],
[/('(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))')/,
['literal literal-char']],
......@@ -469,6 +474,8 @@ var highlightRules = {
],
abcDirective: [
[/(\n)/, ['whitespace'], 'pop'],
[/(})/, ['punctuation'], 'pop:2'],
[/(;)/, ['punctuation'], 'pop'],
[/(\|.*\n)/, ['comment'], 'pop'],
[/(\S+)/, ['abc-directive'], 'jump:abcArgument']
],
......
{
"name": "clean-highlighter",
"version": "0.1.24",
"version": "0.1.25",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
-----
instance < {#Char} :: !{#Char} !{#Char} -> Bool :== code { .d 2 0 ; jsr cmpAC ; .o 0 1 i ; pushI 0 ; gtI }
-----
keyword instance
whitespace
classname <
whitespace
punctuation {#
type Char
punctuation }
whitespace
punctuation ::
whitespace
punctuation !{#
type Char
punctuation }
whitespace
punctuation !{#
type Char
punctuation }
whitespace
punctuation ->
whitespace
type Bool
whitespace
punctuation :==
whitespace
keyword code
whitespace
punctuation {
whitespace
abc-instruction .d
whitespace
literal literal-int literal-int-dec 2
whitespace
literal literal-int literal-int-dec 0
whitespace
punctuation ;
whitespace
abc-instruction jsr
whitespace
abc-argument cmpAC
whitespace
punctuation ;
whitespace
abc-instruction .o
whitespace
literal literal-int literal-int-dec 0
whitespace
literal literal-int literal-int-dec 1
whitespace
abc-argument i
whitespace
punctuation ;
whitespace
abc-instruction pushI
whitespace
literal literal-int literal-int-dec 0
whitespace
punctuation ;
whitespace
abc-instruction gtI
whitespace
punctuation }
Markdown is supported
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