File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1+ import { check } from './checker'
12import { Node } from './ast/types'
2- import { typeCheckBody } from './checker '
3+ import { parse } from './ast '
34
4- export type TypeCheckResult = { hasTypeErrors : boolean }
5+ export type TypeCheckResult = { hasTypeErrors : boolean ; errorMessages : string [ ] }
6+
7+ export const parseProgram = ( program : string ) : Node => {
8+ return parse ( program )
9+ }
510
611export const typeCheck = ( ast : Node ) : TypeCheckResult => {
7- const result = typeCheckBody ( ast )
8- return { hasTypeErrors : result . errors . length > 0 }
12+ const result = check ( ast )
13+ return {
14+ hasTypeErrors : result . errors . length > 0 ,
15+ errorMessages : result . errors . map ( error => error . message )
16+ }
917}
Original file line number Diff line number Diff line change 1- class A extends B {}
2- class B extends A {}
31public class Main {
4- public static void main (String [] args ) {}
5- }
2+ public static void main (String [] args ) {
3+ throwing ();
4+ }
5+ public static void throwing () throws Exception {}
6+ }
You can’t perform that action at this time.
0 commit comments