mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 22:46:30 +00:00
add ::<
This commit is contained in:
parent
8c172ccbe4
commit
da1dbb92cd
@ -1,7 +1,6 @@
|
|||||||
import { Reporter } from "./info.ts";
|
import { Reporter } from "./info.ts";
|
||||||
import { Pos, Token } from "./token.ts";
|
import { Pos, Token } from "./token.ts";
|
||||||
|
|
||||||
|
|
||||||
export class Lexer {
|
export class Lexer {
|
||||||
private index = 0;
|
private index = 0;
|
||||||
private line = 1;
|
private line = 1;
|
||||||
@ -77,8 +76,7 @@ export class Lexer {
|
|||||||
if (this.done()) {
|
if (this.done()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
value +=
|
value += {
|
||||||
{
|
|
||||||
n: "\n",
|
n: "\n",
|
||||||
t: "\t",
|
t: "\t",
|
||||||
"0": "\0",
|
"0": "\0",
|
||||||
@ -132,6 +130,16 @@ export class Lexer {
|
|||||||
this.step();
|
this.step();
|
||||||
return this.token("->", pos);
|
return this.token("->", pos);
|
||||||
}
|
}
|
||||||
|
if (first === ":") {
|
||||||
|
if (!this.done() && this.test(":")) {
|
||||||
|
this.step();
|
||||||
|
if (!this.done() && this.test("<")) {
|
||||||
|
this.step();
|
||||||
|
return this.token("::<", pos);
|
||||||
|
}
|
||||||
|
return this.token("::", pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.token(first, pos);
|
return this.token(first, pos);
|
||||||
}
|
}
|
||||||
if (this.test("/")) {
|
if (this.test("/")) {
|
||||||
|
@ -26,6 +26,8 @@ syn match Operator '>='
|
|||||||
syn match Operator '\.'
|
syn match Operator '\.'
|
||||||
syn match Operator ':'
|
syn match Operator ':'
|
||||||
syn match Operator '->'
|
syn match Operator '->'
|
||||||
|
syn match Operator '::'
|
||||||
|
syn match Operator '::<'
|
||||||
|
|
||||||
syn match Number '0'
|
syn match Number '0'
|
||||||
syn match Number '[1-9][0-9]*'
|
syn match Number '[1-9][0-9]*'
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
"operators": {
|
"operators": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "\\+|\\-|\\*|\\/|=|(==)|(!=)|<|>|(<=)|(>=)|\\.|:|(\\->)",
|
"match": "\\+|\\-|\\*|\\/|=|(==)|(!=)|<|>|(<=)|(>=)|\\.|:|(\\->)|(::)|(::<)",
|
||||||
"name": "keyword.operator.slige"
|
"name": "keyword.operator.slige"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -89,8 +89,12 @@
|
|||||||
"idents": {
|
"idents": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b",
|
"match": "\\b[a-z_][a-zA-Z0-9_]*\\b",
|
||||||
"name": "variable.other.slige"
|
"name": "variable.other.slige"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
|
||||||
|
"name": "entity.name.type.slige"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user