64 lines
1.2 KiB
YAML
64 lines
1.2 KiB
YAML
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
|