diff options
author | Mats Larsen <me@supergrecko.com> | 2022-01-31 14:05:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 14:05:21 +0100 |
commit | 9b890b16562785e0f22836199108442c3de0c933 (patch) | |
tree | 5906bb82ba3b90e16d5b44a021939f0bc64cc778 /lib/asm-docs/java.ts | |
parent | fe7eb18408cd9b6bc61f7f0eb672d958a10766dd (diff) | |
download | compiler-explorer-9b890b16562785e0f22836199108442c3de0c933.tar.gz compiler-explorer-9b890b16562785e0f22836199108442c3de0c933.zip |
Refactor handling of Assembly Documentation Providers (#3247)gh-1784
Diffstat (limited to 'lib/asm-docs/java.ts')
-rw-r--r-- | lib/asm-docs/java.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/asm-docs/java.ts b/lib/asm-docs/java.ts new file mode 100644 index 000000000..c18fab89c --- /dev/null +++ b/lib/asm-docs/java.ts @@ -0,0 +1,33 @@ +// Copyright (c) 2021, Compiler Explorer Authors +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +import { AssemblyInstructionInfo, BaseAssemblyDocumentationProvider } from './base'; +import { getAsmOpcode } from './generated/asm-docs-java'; + +export class JavaDocumentationProvider extends BaseAssemblyDocumentationProvider { + public static get key() { return 'java'; } + public override getInstructionInformation(instruction: string): AssemblyInstructionInfo | null { + return getAsmOpcode(instruction) || null; + } +} |