[#25] New language: YoptaScript
This commit is contained in:
parent
e4ee19b87c
commit
b222c33f15
|
@ -26,7 +26,7 @@ install:
|
|||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length > 1) {
|
||||
console.error("usage: repl.js [FILE]");
|
||||
console.error("usage: cat-lang [FILE]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
id: "yoptascript"
|
||||
aliases:
|
||||
- "yopta"
|
||||
name: "YoptaScript"
|
||||
|
||||
info:
|
||||
year: 2016
|
||||
desc: "The world's first scripting programming language for gopniks and real boys"
|
||||
ext: yopta
|
||||
web:
|
||||
home: "https://yopta.space/"
|
||||
source: "https://github.com/samgozman/YoptaScript"
|
||||
category: general
|
||||
mode: interpreted
|
||||
platform: nodejs
|
||||
syntax: c
|
||||
typing: dynamic
|
||||
paradigm:
|
||||
- functional
|
||||
- imperative
|
||||
- oo
|
||||
usage: []
|
||||
|
||||
install:
|
||||
npm:
|
||||
- yopta
|
||||
scripts:
|
||||
yopta: |
|
||||
#!/usr/bin/env -S NODE_PATH=/opt/yopta/lib/node_modules node
|
||||
const fs = require("fs");
|
||||
const repl = require("repl");
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length > 1) {
|
||||
console.error("usage: yopta [FILE]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const program = args.length === 1 ? fs.readFileSync(args[0], "utf-8") : null;
|
||||
|
||||
require("yopta");
|
||||
|
||||
if (program !== null) {
|
||||
eval(yopta(program));
|
||||
}
|
||||
|
||||
repl.start({prompt: yopta> ", eval: (cmd, context, filename, callback) => callback(null, eval(yopta(cmd)))});
|
||||
|
||||
repl: |
|
||||
yopta
|
||||
|
||||
main: "main.yopta"
|
||||
template: |
|
||||
красноглазое.чмо("Привет мир!") нах
|
||||
hello: |
|
||||
Привет мир!
|
||||
|
||||
run: |
|
||||
yopta main.yopta
|
||||
|
||||
scope:
|
||||
code: |
|
||||
x = 123 * 234
|
Loading…
Reference in New Issue