From de73757508728904853a3d6c06d916eb138c4217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Bulej?= Date: Sat, 20 Oct 2018 11:27:16 +0200 Subject: [PATCH] Allow fields without annotations in DiSL classes Relaxed the DiSL class parser to allow DiSL class to contain fields without annotations. The parser previously threw exceptions, which made it impossible to include guards in the DiSL class. The parser should really only choke on fields without annotations that are actually accessed from DiSL snippets. --- src-disl/ch/usi/dag/disl/classparser/AbstractParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-disl/ch/usi/dag/disl/classparser/AbstractParser.java b/src-disl/ch/usi/dag/disl/classparser/AbstractParser.java index 75d60175..463b5810 100644 --- a/src-disl/ch/usi/dag/disl/classparser/AbstractParser.java +++ b/src-disl/ch/usi/dag/disl/classparser/AbstractParser.java @@ -101,8 +101,8 @@ abstract class AbstractParser { for (final FieldNode field : fields) { if (field.invisibleAnnotations == null) { - throw new ParserException("DiSL annotation for field " - + className + "." + field.name + " is missing"); + // Ignore fields without annotations. + continue; } if (field.invisibleAnnotations.size() > 1) { -- GitLab