Add expression mode for Haskell and JS
This commit is contained in:
parent
4b73ece01c
commit
d16942c0a7
5 changed files with 38 additions and 10 deletions
|
@ -4,9 +4,20 @@ class Haskell extends Language {
|
|||
constructor() {
|
||||
super('haskell', {
|
||||
highlight: 'hs',
|
||||
aliases: ['haskell', 'hs']
|
||||
aliases: ['haskell', 'hs'],
|
||||
options: {
|
||||
e: () => ''
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
runWith(options) {
|
||||
if (options.has('e')) {
|
||||
return { id: this.id, env: { EVAL_EXPR: 'true' } };
|
||||
}
|
||||
|
||||
return super.runWith(options);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Haskell;
|
||||
|
|
|
@ -6,17 +6,23 @@ class JavaScript extends Language {
|
|||
highlight: 'js',
|
||||
aliases: ['javascript', 'js'],
|
||||
options: {
|
||||
harmony: () => ''
|
||||
harmony: () => '',
|
||||
e: () => ''
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
runWith(options) {
|
||||
const ret = { id: this.id, env: {} };
|
||||
if (options.has('harmony')) {
|
||||
return { id: this.id, env: { EVAL_HARMONY: 'true' } };
|
||||
ret.env.EVAL_HARMONY = 'true';
|
||||
}
|
||||
|
||||
return { id: this.id, env: {} };
|
||||
if (options.has('e')) {
|
||||
ret.env.EVAL_EXPR = 'true';
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue