update FML parsers to accept R5 metadata in R4 FML format

This commit is contained in:
Grahame Grieve 2024-03-27 21:14:00 +11:00
parent 51380bad07
commit c9490d88d1
2 changed files with 31 additions and 33 deletions

View File

@ -76,7 +76,7 @@ public class FmlParser extends ParserBase {
if (lexer.hasComments()) {
result.makeElement("description").markLocation(lexer.getCurrentLocation()).setValue(lexer.getAllComments());
}
} else {
}
while (lexer.hasToken("///")) {
lexer.next();
String fid = lexer.takeDottedToken();
@ -84,7 +84,6 @@ public class FmlParser extends ParserBase {
lexer.token("=");
e.setValue(lexer.readConstant("meta value"));
}
}
lexer.setMetadataFormat(false);
if (!result.hasChild("status")) {
result.makeElement("status").setValue("draft");

View File

@ -640,7 +640,7 @@ public class StructureMapUtilities {
result.setName(lexer.readConstant("name"));
result.setDescription(lexer.getAllComments());
result.setStatus(PublicationStatus.DRAFT);
} else {
}
while (lexer.hasToken("///")) {
lexer.next();
String fid = lexer.takeDottedToken();
@ -666,7 +666,6 @@ public class StructureMapUtilities {
// nothing
}
}
}
if (!result.hasId() && result.hasName()) {
String id = Utilities.makeId(result.getName());
if (!Utilities.noString(id)) {