-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from thomscoder/expandOperations
Expand operations
- Loading branch information
Showing
17 changed files
with
160 additions
and
30 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
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
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ADDITION_MODE, CONST_MODE, DIVISION_MODE, MULTIPLICATION_MODE, SUBTRACTION_MODE } from "./texts/texts.js" | ||
|
||
export const defaultText = (select) => { | ||
const instruction = select.value | ||
switch (instruction) { | ||
case ADDITION_MODE: | ||
return `(module | ||
(func (export "addNumbers") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.add) | ||
) | ||
` | ||
case SUBTRACTION_MODE: | ||
return `(module | ||
(func (export "subtractNumbers") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.sub) | ||
) | ||
` | ||
case MULTIPLICATION_MODE: | ||
return `(module | ||
(func (export "multiplyNumbers") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.mul) | ||
) | ||
` | ||
case DIVISION_MODE: | ||
return `(module | ||
(func (export "divideNumbers") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.div) | ||
) | ||
` | ||
case CONST_MODE: | ||
return `(module | ||
(func (export "operationWithInternalVariable") (param i32 i32) (result i32) | ||
local.get 0 | ||
i32.const 10 | ||
i32.add) | ||
) | ||
` | ||
} | ||
} |
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,5 @@ | ||
export const CONST_MODE = 'const'; | ||
export const ADDITION_MODE = 'addition'; | ||
export const SUBTRACTION_MODE = 'subtraction'; | ||
export const MULTIPLICATION_MODE = 'multiplication'; | ||
export const DIVISION_MODE = 'division'; |
Binary file not shown.
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
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
009b20c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
luna – ./
luna-git-master-thomscoder.vercel.app
luna-demo.vercel.app
luna-thomscoder.vercel.app