mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-01-24 12:44:12 +01:00
21 lines
792 B
TypeScript
21 lines
792 B
TypeScript
import React from 'react';
|
|
import AppState from '../shell/AppState';
|
|
import { CmdShell, CommandInput } from '../shell/cmd';
|
|
import BitwiseResultView from './components/BitwiseResultView';
|
|
import {parser} from './expression';
|
|
|
|
const expressionAppModule = {
|
|
setup: function(appState: AppState, cmd: CmdShell) {
|
|
|
|
// Bitwise Expressions
|
|
cmd.command({
|
|
canHandle: (input:string) => parser.canParse(input),
|
|
handle: function(c: CommandInput) {
|
|
var expr = parser.parse(c.input);
|
|
appState.addCommandResult(c.input, () => <BitwiseResultView expression={expr!} emphasizeBytes={appState.emphasizeBytes} annotateTypes={appState.annotateTypes} />);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
export default expressionAppModule; |