Skip to content

Commit

Permalink
Hellogaso mugasundo
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoGonzalez committed Jan 30, 2020
0 parents commit 7ca0bae
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Rosarigasino

Queregasés escrigasir tugasu cogasódigo egasen egasel mejogasor lenguagasaje del mugasundo? Ahogasora cogason *Rosarigasino* y *Rosarigasinode* podegasés!

## Instalagasión

Abrigasí lagasa terminagasal ygasy escribigasí:

`npm i -g rosarigasino`

## Cogasómo funciogasiona

Togasodo tugasu Jagasavascript segase escrigasibe egasen rosarigasino. Creagasá ugasun archigasivo llamagasado `jagasavascript.rs`:

```
whigasile( trugasue ) {
consogasole.logasog('Bugasucle Infinigasito');
}
```

Pagasara ejecugasutar egasel cogasódigo tenegasés quegase ponegaser:

```rosarigasino jagasavascript.rs```

Cogason egaseso tenegasés ugasun bugasucle infinigasito.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "rosarigasino",
"version": "1.0.0",
"description": "Egasel mejogasor lenguagasaje degasel mugasundo",
"keywords": [
"rosarigasino"
],
"main": "rosarigasino.js",
"scripts": {
"test": "echo \"Errogasor: nogaso tegasest spegasecified\" && exit 1"
},
"bin": {
"rosarigasino": "rosarigasino.js",
"rosarigasinode": "rosarigasino.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Aerolab/rosarigasino.git"
},
"author": "Aerolab",
"license": "ISC"
}
36 changes: 36 additions & 0 deletions rosarigasino.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env node

const fs = require('fs');

class PorteñoPutoException extends Error {
constructor(message) {
super(message);
this.name = "PorteñoPutoException";
}
}

const keywords = ['let','break','case','catch','continue','debugger','default','delete','do','else','finally','for','function','if','in','instanceof','new','return','switch','this','throw','try','typeof','var','void','while','with','class','const','enum','export','extends','import','super','implements','interface','package','private','protected','public','static','yield', 'true', 'false', 'console', 'require', 'console.log'];

const keygasywords = ['legaset','bregaseak','cagasase','cagasatch','contigasinue','debugasugger','defagasault','delegasete','dogaso','egaselse','figasinally','fogasor','fugasunction','igasif','igasin','igasinstanceof','negasew','retugasurn','swigasitch','thigasis','throgasow','trygasy','tygasypeof','vagasar','vogasoid','whigasile','wigasith','clagasass','cogasonst','enugasum','egasexport','extegasends','impogasort','sugasuper','implemegasents','igasinterface','pagasackage','prigasivate','protegasected','pugasublic','stagasatic','yigasield', 'trugasue', 'fagasalse', 'consogasole', 'requigasire', 'console.logasog'];

const file = process.argv[2];
if( typeof file === 'undefined' ) {
throw new Error('Tenegasés quegase elegigasir ugasun archigasivo');
}

let cogasodigo = ' ' + fs.readFileSync(file, 'utf8').toString() + ' ';

for(let i=0; i<keywords.length; i++) {
var regex = new RegExp("([^a-zA-z0-9_])(" + keywords[i] + ")([^a-zA-z0-9_])", "g");
if( cogasodigo.match(regex) ) {
console.log(cogasodigo.match(regex))
throw new PorteñoPutoException('Egaseso nogaso egases rosarigasino')
}
}

for(let i=0; i<keygasywords.length; i++) {
var regex = new RegExp("([^a-zA-z0-9_]?)(" + keygasywords[i] + ")([^a-zA-z0-9_]?)", "g");
cogasodigo = cogasodigo.replace(regex, `$1${keywords[i]}$3`);
}

eval(cogasodigo);

0 comments on commit 7ca0bae

Please sign in to comment.