diff --git a/jasm-core/src/main/java/me/darknet/assembler/error/ErrorCollector.java b/jasm-core/src/main/java/me/darknet/assembler/error/ErrorCollector.java index 97d25c56..c2ecdf91 100644 --- a/jasm-core/src/main/java/me/darknet/assembler/error/ErrorCollector.java +++ b/jasm-core/src/main/java/me/darknet/assembler/error/ErrorCollector.java @@ -12,15 +12,24 @@ public class ErrorCollector { private final List errors = new ArrayList<>(); + private final List warns = new ArrayList<>(); public void addError(Error error) { errors.add(error); } + public void addWarn(Warn warn) { + warns.add(warn); + } + public void addError(String message, Location location) { errors.add(new Error(message, location)); } + public void addWarn(String message, Location location) { + warns.add(new Warn(message, location)); + } + public void addAll(Collection errors) { this.errors.addAll(errors); } @@ -29,8 +38,16 @@ public boolean hasErr() { return !errors.isEmpty(); } + public boolean hasWarn() { + return !warns.isEmpty(); + } + public List getErrors() { return errors; } + public List getWarns() { + return warns; + } + } diff --git a/jasm-core/src/main/java/me/darknet/assembler/error/Warn.java b/jasm-core/src/main/java/me/darknet/assembler/error/Warn.java new file mode 100644 index 00000000..24770593 --- /dev/null +++ b/jasm-core/src/main/java/me/darknet/assembler/error/Warn.java @@ -0,0 +1,9 @@ +package me.darknet.assembler.error; + +import me.darknet.assembler.util.Location; + +public class Warn extends Error { + public Warn(String message, Location location) { + super(message, location); + } +}