Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kunle
committed
Dec 11, 2018
1 parent
200e7c4
commit 11b0d76
Showing
111 changed files
with
913 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/docs | ||
.vscode | ||
.github | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
const helperIseDeclarations = require("./helperise/registeredHelperIse.js"); | ||
|
||
class Environment { | ||
|
||
constructor() { | ||
constructor () { | ||
this.vars = {}; | ||
this.iseDeclarations = {}; | ||
} | ||
|
||
setJeki(scope, name, value) { | ||
setJeki (scope, name, value) { | ||
if (this.vars[scope] == undefined) { | ||
this.vars[scope] = {}; | ||
} | ||
|
||
this.vars[scope][name] = value; | ||
} | ||
|
||
getJeki(scope, name) { | ||
if (this.vars[scope] != undefined) | ||
return this.vars[scope][name]; | ||
getJeki (scope, name) { | ||
if (this.vars[scope] != undefined) { return this.vars[scope][name]; } | ||
} | ||
|
||
setIse(scope, iseName, iseNode) { | ||
setIse (scope, iseName, iseNode) { | ||
if (this.iseDeclarations[scope] == undefined) { | ||
this.iseDeclarations[scope] = {}; | ||
} | ||
|
||
this.iseDeclarations[scope][iseName] = iseNode; | ||
} | ||
|
||
getIse(scope, iseName) { | ||
getIse (scope, iseName) { | ||
if (this.iseDeclarations[scope] != undefined) { | ||
return this.iseDeclarations[scope][iseName]; | ||
} | ||
} | ||
|
||
isExistHelperIse(iseName) { | ||
isExistHelperIse (iseName) { | ||
return helperIseDeclarations[iseName] != undefined; | ||
} | ||
|
||
runHelperIse(iseName, iseArgs) { | ||
runHelperIse (iseName, iseArgs) { | ||
if (this.isExistHelperIse(iseName)) { | ||
return helperIseDeclarations[iseName](iseArgs); | ||
} | ||
} | ||
|
||
sope(value) { | ||
sope (value) { | ||
console.log(value); | ||
} | ||
} | ||
|
||
module.exports = Environment; | ||
module.exports = Environment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
//Get array length | ||
function ka(args) { | ||
// Get array length | ||
function ka (args) { | ||
if (args instanceof Array) { | ||
const [param] = args; | ||
const [param, ] = args; | ||
if (param instanceof Array) return param.length; | ||
|
||
throw new Error (`Invalid param given to helper ise ka.`); | ||
} | ||
throw new Error('Yorlang system error'); | ||
throw new Error("Invalid param given to helper ise ka."); | ||
} | ||
|
||
throw new Error("Yorlang system error"); | ||
} | ||
|
||
module.exports = ka; | ||
module.exports = ka; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
const readlineSync = require('readline-sync'); | ||
const readlineSync = require("readline-sync"); | ||
|
||
//Takes command line input | ||
function teSibi(args) { | ||
// Takes command line input | ||
function teSibi (args) { | ||
if (args instanceof Array) { | ||
const [param] = args; | ||
if (typeof param === "string"){ | ||
const [param, ] = args; | ||
if (typeof param === "string") { | ||
const input = readlineSync.question(param); | ||
return parseFloat(input) || input; | ||
} | ||
} | ||
|
||
throw new Error (`Invalid param given to helper ise teSibi.`); | ||
} | ||
throw new Error('Yorlang system error'); | ||
throw new Error("Invalid param given to helper ise teSibi."); | ||
} | ||
|
||
throw new Error("Yorlang system error"); | ||
} | ||
|
||
module.exports = teSibi; | ||
module.exports = teSibi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
//Convert String to lower case | ||
function siLetaKekere(args) { | ||
// Convert String to lower case | ||
function siLetaKekere (args) { | ||
if (args instanceof Array) { | ||
const [param] = args; | ||
const [param, ] = args; | ||
if (typeof param === "string") return param.toLowerCase(); | ||
|
||
throw new Error (`Invalid param given to helper ise síLẹ́tàkékeré.`); | ||
} | ||
throw new Error('Yorlang system error'); | ||
throw new Error("Invalid param given to helper ise síLẹ́tàkékeré."); | ||
} | ||
|
||
throw new Error("Yorlang system error"); | ||
} | ||
|
||
module.exports = siLetaKekere; | ||
module.exports = siLetaKekere; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
//Convert String to upper case | ||
function siLetaNla(args) { | ||
// Convert String to upper case | ||
function siLetaNla (args) { | ||
if (args instanceof Array) { | ||
const [param] = args; | ||
const [param, ] = args; | ||
if (typeof param === "string") return param.toUpperCase(); | ||
|
||
throw new Error (`Invalid param given to helper ise síLẹ́tàŃlá.`); | ||
} | ||
throw new Error('Yorlang system error'); | ||
throw new Error("Invalid param given to helper ise síLẹ́tàŃlá."); | ||
} | ||
|
||
throw new Error("Yorlang system error"); | ||
} | ||
|
||
module.exports = siLetaNla; | ||
module.exports = siLetaNla; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const constants = require("../../constants.js"); | ||
|
||
class WokeHelper { | ||
static isWokeVariable(context, tiName) { | ||
class WokeHelper { | ||
static isWokeVariable (context, tiName) { | ||
const wokeList = context.environment().getJeki(context.getCurrentScope(), constants.KW.WOKE); | ||
return wokeList != undefined && wokeList.indexOf(tiName) != -1; | ||
} | ||
} | ||
|
||
module.exports = WokeHelper; | ||
module.exports = WokeHelper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
class IBase { | ||
|
||
constructor() { | ||
constructor () { | ||
if (this.constructor == IBase) { | ||
throw new Error("Cannot instantiate abstract class IBase"); | ||
} | ||
} | ||
|
||
interpreteNode(node) { | ||
throw new Error(`Class of type IBase must implement interpreteNode()`); | ||
interpreteNode (node) { | ||
throw new Error("Class of type IBase must implement interpreteNode()"); | ||
} | ||
} | ||
|
||
module.exports = IBase; | ||
module.exports = IBase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.