remove decrease intrinsic+update editor support

This commit is contained in:
0x4261756D 2023-01-11 03:02:10 +01:00
parent 34f52ae864
commit d7c6cada32
6 changed files with 7 additions and 9 deletions

View File

@ -24,6 +24,6 @@ rules:
- type: "\\b(bool|int|str)\\b"
- symbol.operator: "([-+<>]|==|!=|=>|print(ln)?)"
- identifier: "\\b(if|else|while)\\b"
- special: "\\b(deq|swp|dup|req|depth|decrease)\\b"
- special: "\\b(deq|swp|dup|req|depth)\\b"
- special: "\\?\\?\\?"
- statement: "arr"

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

View File

@ -14,7 +14,11 @@
"id": "kurz",
"aliases": ["kurz", "kurz"],
"extensions": [".qbl"],
"configuration": "./language-configuration.json"
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/kurz-light.png",
"dark": "./icons/kurz-dark.png"
}
}],
"grammars": [{
"language": "kurz",

View File

@ -45,7 +45,7 @@
},
{
"name": "support.function.kurz",
"match": "\\b(deq|swp|dup|req|depth|decrease)\\b"
"match": "\\b(deq|swp|dup|req|depth)\\b"
},
{
"name": "keyword.control",

View File

@ -100,7 +100,6 @@ fn main()
("==", (Vec::from([Datatype::Int, Datatype::Int]), Vec::from([Datatype::Bool]))),
("!=", (Vec::from([Datatype::Int, Datatype::Int]), Vec::from([Datatype::Bool]))),
("&&", (Vec::from([Datatype::Bool, Datatype::Bool]), Vec::from([Datatype::Bool]))),
("decrease", (Vec::from([Datatype::Int]), Vec::from([Datatype::Int]))),
]);
let args: Vec<String> = env::args().collect();
if args.len() < 2
@ -901,11 +900,6 @@ fn interpret_program(operations: &Vec<Operation>, queue: &mut Vec<String>, funct
let second = queue.remove(0).parse::<bool>().unwrap();
queue.push((first && second).to_string());
}
"decrease" =>
{
let val = queue.remove(0).parse::<i64>().unwrap();
queue.push((val - 1).to_string());
}
"println" =>
{
output += format!("{}\n", queue.remove(0)).as_str();