Skip to content

Commit

Permalink
Merge 7a4411d into e68eb6d
Browse files Browse the repository at this point in the history
  • Loading branch information
vihanb committed Oct 29, 2016
2 parents e68eb6d + 7a4411d commit d7dda4c
Show file tree
Hide file tree
Showing 157 changed files with 132 additions and 2,302 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Expand Up @@ -2,6 +2,7 @@
"presets": ["es2015"],
"plugins": [
"babel-plugin-transform-class-properties",
"babel-plugin-add-module-exports"
"babel-plugin-add-module-exports",
"babel-plugin-include"
]
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -20,6 +20,7 @@
"atob": "^2.0.3",
"bases": "^0.2.1",
"btoa": "^1.1.2",
"cheddar-parser": "^0.1.4",
"colors": "^1.1.2",
"commander": "^2.9.0",
"crypto": "0.0.3",
Expand All @@ -42,6 +43,7 @@
"babel-core": "^6.13.2",
"babel-istanbul": "^0.11.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-include": "^1.2.0",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-preset-es2015": "^6.13.2",
"browserify": "^13.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/browser_repl.es6
Expand Up @@ -6,7 +6,7 @@ import CheddarScope from '../interpreter/core/env/scope';
import NIL from '../interpreter/core/consts/nil';

import cheddar from '../interpreter/exec';
import tokenizer from '../tokenizer/tok';
import tokenizer from 'cheddar-parser/dist/tok';

import HelperCaret from '../helpers/caret';

Expand Down Expand Up @@ -57,4 +57,4 @@ windw.Chedz = function input(STDIN) {
console.log(`< Unprintable object of class "${Output.constructor.name.magenta}" with literal value ${Output.magenta} >`, '', 'orange');
}
}
}
}
2 changes: 1 addition & 1 deletion src/cli/cheddar.sh
Expand Up @@ -12,4 +12,4 @@ CHEDDAR_EXE="`$rp $(
[[ -f "$cpath/../share/cheddar/dist/cli/cheddar.js" ]] && echo "$cpath/../share/cheddar/dist/cli/cheddar.js"
) &> /dev/null`"
NODE_EXE=`which node`
"$NODE_EXE" "$CHEDDAR_EXE" "$0" "$@"
"$NODE_EXE" "$CHEDDAR_EXE" "$0" "$@"
4 changes: 2 additions & 2 deletions src/cli/debug.es6
Expand Up @@ -10,7 +10,7 @@ import CheddarString from '../interpreter/core/primitives/String';
import HelperCaret from '../helpers/caret';

import cheddar from '../interpreter/exec';
import tokenizer from '../tokenizer/tok';
import tokenizer from 'cheddar-parser/dist/tok';

import stdlib from '../stdlib/stdlib';

Expand All @@ -36,4 +36,4 @@ var Output = Executor.exec(process.stdout.write.bind(process.stdout));

if (typeof Output === "string") {
DRAW_ERROR(Output, "Runtime Error");
}
}
2 changes: 1 addition & 1 deletion src/cli/prog.es6
Expand Up @@ -7,7 +7,7 @@ import colors from 'colors';
import HelperCaret from '../helpers/caret';

import cheddar from '../interpreter/exec';
import tokenizer from '../tokenizer/tok';
import tokenizer from 'cheddar-parser/dist/tok';

import stdlib from '../stdlib/stdlib';

Expand Down
2 changes: 1 addition & 1 deletion src/cli/repl.es6
Expand Up @@ -9,7 +9,7 @@ import CheddarString from '../interpreter/core/primitives/String';
import NIL from '../interpreter/core/consts/nil';

import cheddar from '../interpreter/exec';
import tokenizer from '../tokenizer/tok';
import tokenizer from 'cheddar-parser/dist/tok';

import HelperCaret from '../helpers/caret';

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/caret.es6
Expand Up @@ -35,4 +35,4 @@ export default function caret (Code, Index, highlight) {
);

return lines.join("\n");
}
}
2 changes: 1 addition & 1 deletion src/helpers/init.es6
Expand Up @@ -7,4 +7,4 @@ export default function HelperInit(Class, ...Args) {
} else {
return B;
}
}
}
2 changes: 1 addition & 1 deletion src/helpers/var.es6
Expand Up @@ -15,4 +15,4 @@ export default function HelperVariable(Name, Scope, Type, Value, Arguments) {
return Scope.set(Name, new CheddarVariable(A, Arguments));
else
return B;
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/config/alias.es6
Expand Up @@ -8,4 +8,4 @@ export default new Map([
[CheddarNumber, 'Number'],
[CheddarArray, 'Array'],
[CheddarBool, 'Bool'],
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/config/link.es6
Expand Up @@ -26,4 +26,4 @@ import CheddarFunctionizedProperty from '../evaluated/fprop';
export const EVALUATED_LINKS = new Map([
["CheddarFunctionizedOperatorToken", CheddarFunctionizedOperator],
["CheddarFunctionizedPropertyToken", CheddarFunctionizedProperty],
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/consts/dict.es6
@@ -1 +1 @@
export const KEY_INTERNAL = new Set("String", "Number");
export const KEY_INTERNAL = new Set("String", "Number");
2 changes: 1 addition & 1 deletion src/interpreter/core/consts/err.es6
Expand Up @@ -14,4 +14,4 @@ export default {
MALFORMED_TOKEN : Symbol('MALFORMED_TOKEN'),

ABSTRACT_USED : Symbol('ABSTRACT_USED')
};
};
2 changes: 1 addition & 1 deletion src/interpreter/core/consts/err_msg.es6
Expand Up @@ -11,4 +11,4 @@ export default new Map([
[RuntimeError.UNLINKED_CLASS, "InternalError: Token `$0` has no link."],
[RuntimeError.MALFORMED_TOKEN, "InternalError: Recieved a malformed token at callstack ref. $0"],
[RuntimeError.ABSTRACT_USED, "InternalError: Attempted to construct an abstract interface"]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/consts/nil.es6
Expand Up @@ -16,4 +16,4 @@ export default class NIL extends CheddarClass {
false
)]
]);
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/env/class.es6
Expand Up @@ -79,4 +79,4 @@ export default class CheddarClass extends CheddarScope {
// be constructed.
return CheddarError.ABSTRACT_USED;
}
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/env/defaults.es6
Expand Up @@ -164,4 +164,4 @@ export const DEFAULT_CAST = new Map([
}]
]);

export const DEFAULT_RHS_OP = new Map();
export const DEFAULT_RHS_OP = new Map();
4 changes: 2 additions & 2 deletions src/interpreter/core/env/scope.es6
Expand Up @@ -11,7 +11,7 @@
// |- Preset data

import * as CheddarError from '../consts/err';
import {RESERVED_KEYWORDS} from '../../../tokenizer/consts/ops';
import {RESERVED_KEYWORDS} from 'cheddar-parser/dist/consts/ops';

import CheddarVariable from './var';

Expand Down Expand Up @@ -147,4 +147,4 @@ export default class CheddarScope {
//console.log(this.Scope);
this.Scope.set(path, setter);
}
}
}
4 changes: 2 additions & 2 deletions src/interpreter/core/eval/callstack.es6
@@ -1,5 +1,5 @@
import CheddarScope from '../env/scope';
import CheddarShuntingYard from '../../../tokenizer/tok/shunting_yard';
import CheddarShuntingYard from 'cheddar-parser/dist/tok/shunting_yard';

export default class CheddarCallStack {
constructor(exec_instruct, scope = new CheddarScope()) {
Expand Down Expand Up @@ -35,4 +35,4 @@ export default class CheddarCallStack {
}
return ret;
}
}
}
10 changes: 5 additions & 5 deletions src/interpreter/core/eval/eval.es6
Expand Up @@ -19,13 +19,13 @@

// Primitive <-> Class Links
import {PRIMITIVE_LINKS} from '../config/link';
import {TYPE as OP_TYPE, EXCLUDE_META_ASSIGNMENT as REG_OPS} from '../../../tokenizer/consts/ops';
import {TYPE as OP_TYPE, EXCLUDE_META_ASSIGNMENT as REG_OPS} from 'cheddar-parser/dist/consts/ops';

// Reference tokens
import CheddarPropertyToken from '../../../tokenizer/parsers/property';
import CheddarLiteral from '../../../tokenizer/literals/literal';
import CheddarOperatorToken from '../../../tokenizer/literals/op';
import CheddarExpressionToken from '../../../tokenizer/parsers/expr';
import CheddarPropertyToken from 'cheddar-parser/dist/parsers/property';
import CheddarLiteral from 'cheddar-parser/dist/literals/literal';
import CheddarOperatorToken from 'cheddar-parser/dist/literals/op';
import CheddarExpressionToken from 'cheddar-parser/dist/parsers/expr';

import CheddarScope from '../env/scope';

Expand Down
8 changes: 4 additions & 4 deletions src/interpreter/core/eval/prop.es6
@@ -1,6 +1,6 @@
import CheddarParenthesizedExpressionToken from '../../../tokenizer/parsers/paren_expr';
import CheddarVariableToken from '../../../tokenizer/literals/var';
import CheddarLiteral from '../../../tokenizer/literals/literal';
import CheddarParenthesizedExpressionToken from 'cheddar-parser/dist/parsers/paren_expr';
import CheddarVariableToken from 'cheddar-parser/dist/literals/var';
import CheddarLiteral from 'cheddar-parser/dist/literals/literal';
import CheddarClass from '../env/class';

import {PRIMITIVE_LINKS, EVALUATED_LINKS} from '../config/link';
Expand Down Expand Up @@ -276,4 +276,4 @@ export default function eval_prop(prop, scope, evaluate) {
}

return OPERATOR;
}
}
4 changes: 2 additions & 2 deletions src/interpreter/core/evaluated/fop.es6
Expand Up @@ -3,7 +3,7 @@ import CheddarFunction from '../env/func';
import CheddarError from '../consts/err';
import CheddarClass from '../env/class';
import CheddarErrorDesc from '../consts/err_msg';
import { UOP, OP } from '../../../tokenizer/consts/ops';
import { UOP, OP } from 'cheddar-parser/dist/consts/ops';

const UNARY_ONLY = UOP.filter(i => OP.indexOf(i) === -1);

Expand Down Expand Up @@ -52,4 +52,4 @@ export default function(operator, force_unary) {
}

});
}
}
4 changes: 2 additions & 2 deletions src/interpreter/core/evaluated/fprop.es6
@@ -1,5 +1,5 @@
import CheddarFunction from '../env/func';
import CheddarVariableToken from '../../../tokenizer/literals/var';
import CheddarVariableToken from 'cheddar-parser/dist/literals/var';
import eval_prop from '../eval/prop';
import CheddarEval from '../eval/eval';

Expand All @@ -15,4 +15,4 @@ export default function(prop) {
], function(scope, input) {
return eval_prop(prop, scope, CheddarEval);
});
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Array.es6
Expand Up @@ -89,4 +89,4 @@ export default class CheddarArray extends CheddarClass {
Cast = BehaviorCast;
}

CheddarArray.Scope = require('../../../stdlib/primitive/Array/static');
CheddarArray.Scope = require('../../../stdlib/primitive/Array/static');
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Bool.es6
Expand Up @@ -40,4 +40,4 @@ export default class CheddarBool extends CheddarClass {
Operator = new Map([...CheddarClass.Operator, ...BehaviorOperator]);
Cast = BehaviorCast;

}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Dictionary.es6
Expand Up @@ -50,4 +50,4 @@ export default class CheddarDictionary extends CheddarClass {
}

//CheddarDictionary.Scope = require('../../../stdlib/primitive/Dictionary/static');
//CheddarDictionary.prototype.Scope = require('../../../stdlib/primitive/Dictionary/lib');
//CheddarDictionary.prototype.Scope = require('../../../stdlib/primitive/Dictionary/lib');
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Number.es6
Expand Up @@ -30,4 +30,4 @@ export default class CheddarNumber extends CheddarClass {
get Scope() {
return require('../../../stdlib/primitive/Number/lib');
}
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Regex.es6
Expand Up @@ -43,4 +43,4 @@ export default class CheddarRegex extends CheddarClass {

Operator = new Map([...CheddarClass.Operator, ...BehaviorOperator])
Cast = BehaviorCast;
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/String.es6
Expand Up @@ -59,4 +59,4 @@ export default class CheddarString extends CheddarClass {
}

CheddarString.Scope = require('../../../stdlib/primitive/String/static');
CheddarString.prototype.Scope = require('../../../stdlib/primitive/String/lib');
CheddarString.prototype.Scope = require('../../../stdlib/primitive/String/lib');
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/Symbol.es6
Expand Up @@ -21,4 +21,4 @@ export default class CheddarSymbol extends CheddarClass {

Operator = new Map([...CheddarClass.Operator, ...BehaviorOperator])
Cast = BehaviorCast;
}
}
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/cast/bool.es6
Expand Up @@ -12,4 +12,4 @@ export default new Map([
: HelperInit(CheddarString, "false")
],
['Number', (RHS) => HelperInit(CheddarNumber, 10, 0, +RHS.value)]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/cast/dict.es6
Expand Up @@ -2,4 +2,4 @@ import CheddarString from '../String';
import HelperInit from '../../../../helpers/init';

export default new Map([
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/cast/number.es6
Expand Up @@ -3,4 +3,4 @@ import HelperInit from '../../../../helpers/init';

export default new Map([
['String', (LHS) => HelperInit(CheddarString, LHS.value)]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/cast/regex.es6
Expand Up @@ -9,4 +9,4 @@ export default new Map([

return HelperInit(CheddarString, self.source);
}]
]);
]);
6 changes: 3 additions & 3 deletions src/interpreter/core/primitives/cast/string.es6
Expand Up @@ -5,8 +5,8 @@ import * as CheddarError from '../../consts/err';
import CheddarNumber from '../Number';

// Tokenizers
import CheddarLexer from '../../../../tokenizer/tok/lex';
import CheddarNumberToken from '../../../../tokenizer/literals/number';
import CheddarLexer from 'cheddar-parser/dist/tok/lex';
import CheddarNumberToken from 'cheddar-parser/dist/literals/number';

import HelperInit from '../../../../helpers/init';

Expand Down Expand Up @@ -34,4 +34,4 @@ CLASS ::= class <identifier> <idlist> {
ITEM ::= init <codeblock> |
(cast (from|to)|(get|set))? <indentifier> <arglist> <codeblock> |
(assignby (copy|reference))|
*/
*/
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/cast/symbol.es6
Expand Up @@ -6,4 +6,4 @@ export default new Map([
let CheddarString = require('../String');
return HelperInit(CheddarString, `@${self.value}`);
}]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/op/bool.es6
Expand Up @@ -7,4 +7,4 @@ export default new Map([
else
return CheddarError.NO_OP_BEHAVIOR;
}]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/op/dict.es6
Expand Up @@ -8,4 +8,4 @@ export default new Map([

return LHS;
}]
]);
]);
2 changes: 1 addition & 1 deletion src/interpreter/core/primitives/op/symbol.es6
@@ -1 +1 @@
export default new Map();
export default new Map();
2 changes: 1 addition & 1 deletion src/interpreter/exec.es6
Expand Up @@ -42,4 +42,4 @@ export default class CheddarExec {
this.step();
return this.lrep;
}
}
}
2 changes: 1 addition & 1 deletion src/interpreter/links.es6
Expand Up @@ -14,4 +14,4 @@ export default {
StatementBreak,
StatementReturn,
StatementExpression
}
}
2 changes: 1 addition & 1 deletion src/interpreter/signal.es6
Expand Up @@ -12,4 +12,4 @@ export default class Signal {
// SIGNALS
static BREAK = Symbol('SIGBREAK');
static RETURN = Symbol('RETURN');
}
}
2 changes: 1 addition & 1 deletion src/interpreter/states/assign.es6
Expand Up @@ -83,4 +83,4 @@ export default class CheddarAssign {
return `\`${this.assignl.tok(0)}\` is a reserved keyword`;
}
}
}
}

0 comments on commit d7dda4c

Please sign in to comment.