Skip to content

Commit 9430277

Browse files
committed
Revert changes using base64 encoding
1 parent 2e31f31 commit 9430277

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/compiler/index.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
import * as peggy from 'peggy'
22
import { AST } from '../ast/types/packages-and-modules'
3+
import { ClassFile } from '../ClassFile/types'
34
import { Compiler } from './compiler'
45
import { javaPegGrammar } from './grammar'
5-
import { BinaryWriter } from './binary-writer'
66

7-
export const compile = (ast: AST): string => {
7+
export const compile = (ast: AST): ClassFile => {
88
const compiler = new Compiler()
9-
const classFile = compiler.compile(ast)
10-
11-
const binaryWriter = new BinaryWriter()
12-
const byteArray = binaryWriter.generateBinary(classFile)
13-
const base64encoded = Buffer.from(byteArray).toString('base64')
14-
15-
return base64encoded
9+
return compiler.compile(ast)
1610
}
1711

18-
export const compileFromSource = (javaProgram: string): string => {
12+
export const compileFromSource = (javaProgram: string): ClassFile => {
1913
const parser = peggy.generate(javaPegGrammar, {
2014
allowedStartRules: ['CompilationUnit'],
2115
cache: true

0 commit comments

Comments
 (0)