Skip to content

Commit

Permalink
version 1.2020.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed Jan 12, 2020
1 parent 275cde1 commit 19b9eb3
Show file tree
Hide file tree
Showing 137 changed files with 2,093 additions and 2,582 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2019.14-SNAPSHOT</version>
<version>1.2020.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>PlantUML</name>
Expand Down
9 changes: 5 additions & 4 deletions src/gen/lib/dotgen/cluster__c.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import static gen.lib.common.utils__c.UF_setname;
import static gen.lib.common.utils__c.UF_singleton;
import static gen.lib.dotgen.class2__c.class2;
import static gen.lib.dotgen.class2__c.merge_chain;
import static gen.lib.dotgen.class2__c.mergeable;
import static gen.lib.dotgen.dotinit__c.dot_root;
import static gen.lib.dotgen.fastgr__c.delete_fast_edge;
Expand All @@ -67,6 +68,7 @@
import static gen.lib.dotgen.fastgr__c.flat_edge;
import static gen.lib.dotgen.fastgr__c.merge_oneway;
import static gen.lib.dotgen.fastgr__c.other_edge;
import static gen.lib.dotgen.fastgr__c.safe_other_edge;
import static gen.lib.dotgen.fastgr__c.virtual_edge;
import static gen.lib.dotgen.fastgr__c.virtual_node;
import static gen.lib.dotgen.mincross__c.allocate_ranks;
Expand Down Expand Up @@ -112,7 +114,6 @@
import h.ST_Agraph_s;
import h.ST_nodequeue;
import h.ST_pointf;
import smetana.core.__ptr__;

public class cluster__c {
//1 2digov3edok6d5srhgtlmrycs
Expand Down Expand Up @@ -940,9 +941,9 @@ public static void interclexp(ST_Agraph_s subg) {
ED_to_virt(e, null);
if (ED_to_virt(prev) == null)
continue; /* internal edge */
UNSUPPORTED("8d5mw7m9lzlseqbyx8a8mncgs"); // merge_chain(subg, e, ED_to_virt(prev), 0);
UNSUPPORTED("87mmnlsj8quzlzg0vxax15kt2"); // safe_other_edge(e);
UNSUPPORTED("6hyelvzskqfqa07xtgjtvg2is"); // continue;
merge_chain(subg, e, ED_to_virt(prev), false);
safe_other_edge(e);
continue;
}
/* flat edges */
if (ND_rank(agtail(e)) == ND_rank(aghead(e))) {
Expand Down
35 changes: 17 additions & 18 deletions src/gen/lib/dotgen/fastgr__c.java
Original file line number Diff line number Diff line change
Expand Up @@ -797,18 +797,17 @@ public static ST_Agedge_s find_flat_edge(ST_Agnode_s u, ST_Agnode_s v) {

//3 cttswsffgmw1g710jzvdd3wzn
// static void safe_list_append(edge_t * e, elist * L)
public static Object safe_list_append(Object... arg) {
UNSUPPORTED("59dl3yc4jbcy2pb7j1njhlybi"); // static void
UNSUPPORTED("3kdqf9wvozj4zu6wrv6ur2k47"); // safe_list_append(edge_t * e, elist * L)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
UNSUPPORTED("dhvbzrcz6s76mme3x94begmvr"); // for (i = 0; i < L->size; i++)
UNSUPPORTED("c0a4ruccwt5263vw39xrttm0y"); // if (e == L->list[i])
UNSUPPORTED("6cprbghvenu9ldc0ez1ifc63q"); // return;
public static void safe_list_append(ST_Agedge_s e, ST_elist L) {
ENTERING("cttswsffgmw1g710jzvdd3wzn","safe_list_append");
try {
int i;
for (i = 0; i < L.size; i++)
if (EQ(e, L.list.get(i)))
return;
UNSUPPORTED("cslejjtgepjdwlcykfas4fmvz"); // elist_append(e, (*L));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

throw new UnsupportedOperationException();
} finally {
LEAVING("cttswsffgmw1g710jzvdd3wzn","safe_list_append");
}
}


Expand Down Expand Up @@ -907,13 +906,13 @@ public static void other_edge(ST_Agedge_s e) {

//3 4zg1fp1b7bhnx2tbeaij8yeel
// void safe_other_edge(edge_t * e)
public static Object safe_other_edge(Object... arg) {
UNSUPPORTED("3cc9ux78ad0yjajm0nkpos345"); // void safe_other_edge(edge_t * e)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("bn816jsdz3qke6htvbwvztrpc"); // safe_list_append(e, &(ND_other(agtail(e))));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

throw new UnsupportedOperationException();
public static void safe_other_edge(ST_Agedge_s e) {
ENTERING("4zg1fp1b7bhnx2tbeaij8yeel","safe_other_edge");
try {
safe_list_append(e, ND_other(agtail(e)));
} finally {
LEAVING("4zg1fp1b7bhnx2tbeaij8yeel","safe_other_edge");
}
}


Expand Down
4 changes: 2 additions & 2 deletions src/net/sourceforge/plantuml/AFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public interface AFile {

public AParentFolder getParentFile();

public String getAbsolutePath();

public File getUnderlyingFile();

public File getSystemFolder() throws IOException;

}
8 changes: 4 additions & 4 deletions src/net/sourceforge/plantuml/AFileRegular.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ public AParentFolder getParentFile() {
return new AParentFolderRegular(file.getParentFile());
}

public String getAbsolutePath() {
return file.getAbsolutePath();
}

public File getUnderlyingFile() {
return file;
}

public File getSystemFolder() throws IOException {
return file.getParentFile().getCanonicalFile();
}

}
8 changes: 4 additions & 4 deletions src/net/sourceforge/plantuml/AFileZipEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public AParentFolder getParentFile() {
return new AParentFolderZip(zipFile, entry);
}

public String getAbsolutePath() {
return zipFile.getAbsolutePath() + "~" + entry;
}

public File getUnderlyingFile() {
return zipFile;
}

public File getSystemFolder() throws IOException {
return zipFile.getParentFile().getCanonicalFile();
}

}
28 changes: 7 additions & 21 deletions src/net/sourceforge/plantuml/BlockUml.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.error.PSystemErrorPreprocessor;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc2.PreprocessorMode;
import net.sourceforge.plantuml.preproc2.PreprocessorModeSet;
import net.sourceforge.plantuml.tim.TimLoader;
import net.sourceforge.plantuml.utils.StartUtils;
Expand Down Expand Up @@ -98,7 +97,6 @@ public static List<StringLocated> convert(List<String> strings) {
return result;
}

private PreprocessorMode pmode = PreprocessorMode.V1_LEGACY;
private boolean preprocessorError;

public BlockUml(List<StringLocated> strings, Defines defines, ISkinSimple skinParam, PreprocessorModeSet mode) {
Expand All @@ -108,16 +106,15 @@ public BlockUml(List<StringLocated> strings, Defines defines, ISkinSimple skinPa
if (StartUtils.startsWithSymbolAnd("start", s0) == false) {
throw new IllegalArgumentException();
}
if (mode != null && mode.getPreprocessorMode() == PreprocessorMode.V2_NEW_TIM) {
this.pmode = mode.getPreprocessorMode();
if (mode == null) {
this.data = new ArrayList<StringLocated>(strings);
} else {
final TimLoader timLoader = new TimLoader(mode.getImportedFiles(), defines, mode.getCharset(),
(DefinitionsContainer) mode);
timLoader.load(strings);
this.data = timLoader.getResultList();
this.debug = timLoader.getDebug();
this.preprocessorError = timLoader.isPreprocessorError();
} else {
this.data = new ArrayList<StringLocated>(strings);
}
}

Expand Down Expand Up @@ -192,25 +189,14 @@ public boolean isStartDef(String name) {
}

public List<String> getDefinition(boolean withHeader) {
final List<String> data2 = new ArrayList<String>();
final List<String> result = new ArrayList<String>();
for (StringLocated s : data) {
data2.add(s.getString());
}
if (withHeader) {
return Collections.unmodifiableList(data2);
}
return Collections.unmodifiableList(data2.subList(1, data2.size() - 1));
}

public List<String> getDefinition2(boolean withHeader) {
final List<String> data2 = new ArrayList<String>();
for (StringLocated s : debug) {
data2.add(s.getString());
result.add(s.getString());
}
if (withHeader) {
return Collections.unmodifiableList(data2);
return Collections.unmodifiableList(result);
}
return Collections.unmodifiableList(data2.subList(1, data2.size() - 1));
return Collections.unmodifiableList(result.subList(1, result.size() - 1));
}

public Defines getLocalDefines() {
Expand Down
43 changes: 10 additions & 33 deletions src/net/sourceforge/plantuml/BlockUmlBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,42 +47,37 @@
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.preproc.ImportedFiles;
import net.sourceforge.plantuml.preproc.PreprocessorChangeModeReader;
import net.sourceforge.plantuml.preproc.ReadLineNumbered;
import net.sourceforge.plantuml.preproc.ReadLineReader;
import net.sourceforge.plantuml.preproc.UncommentReadLine;
import net.sourceforge.plantuml.preproc2.Preprocessor;
import net.sourceforge.plantuml.preproc2.PreprocessorMode;
import net.sourceforge.plantuml.utils.StartUtils;

public final class BlockUmlBuilder implements DefinitionsContainer {

private PreprocessorMode mode = PreprocessorMode.V2_NEW_TIM;

private final List<BlockUml> blocks = new ArrayList<BlockUml>();
private Set<FileWithSuffix> usedFiles = new HashSet<FileWithSuffix>();
private final UncommentReadLine reader2;
private final UncommentReadLine reader;
private final Defines defines;
private final ImportedFiles importedFiles;
private final String charset;

public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader, File newCurrentDir,
public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader readerInit, File newCurrentDir,
String desc) throws IOException {
ReadLineNumbered includer = null;
this.defines = defines;
this.charset = charset;
try {
this.reader2 = new UncommentReadLine(new PreprocessorChangeModeReader(ReadLineReader.create(reader, desc),
this));
this.reader = new UncommentReadLine(ReadLineReader.create(readerInit, desc));
this.importedFiles = ImportedFiles.createImportedFiles(new AParentFolderRegular(newCurrentDir));
includer = new Preprocessor(config, reader2, charset, defines, this, importedFiles);
includer = new Preprocessor(config, reader);
init(includer);
} finally {
if (includer != null) {
includer.close();
usedFiles = includer.getFilesUsed();
}
reader.close();
readerInit.close();
}
}

Expand All @@ -102,11 +97,11 @@ private void init(ReadLineNumbered includer) throws IOException {
}
if (StartUtils.isArobasePauseDiagram(s.getString())) {
paused = true;
reader2.setPaused(true);
reader.setPaused(true);
}
if (StartUtils.isExit(s.getString())) {
paused = true;
reader2.setPaused(true);
reader.setPaused(true);
}
if (current2 != null && paused == false) {
current2.add(s);
Expand All @@ -119,15 +114,15 @@ private void init(ReadLineNumbered includer) throws IOException {

if (StartUtils.isArobaseUnpauseDiagram(s.getString())) {
paused = false;
reader2.setPaused(false);
reader.setPaused(false);
}
if (StartUtils.isArobaseEndDiagram(s.getString()) && current2 != null) {
if (paused) {
current2.add(s);
}
blocks.add(new BlockUml(current2, defines.cloneMe(), null, this));
current2 = null;
reader2.setPaused(false);
reader.setPaused(false);
}
}
}
Expand All @@ -140,33 +135,15 @@ public final Set<FileWithSuffix> getIncludedFiles() {
return Collections.unmodifiableSet(usedFiles);
}

public List<String> getDefinition1(String name) {
public List<String> getDefinition(String name) {
for (BlockUml block : blocks) {
if (block.isStartDef(name)) {
this.defines.importFrom(block.getLocalDefines());
return block.getDefinition(false);
}
}
return Collections.emptyList();
}

public List<String> getDefinition2(String name) {
for (BlockUml block : blocks) {
if (block.isStartDef(name)) {
return block.getDefinition2(false);
}
}
return Collections.emptyList();
}

public PreprocessorMode getPreprocessorMode() {
return mode;
}

public void setPreprocessorMode(PreprocessorMode mode) {
this.mode = mode;
}

public final ImportedFiles getImportedFiles() {
return importedFiles;
}
Expand Down
3 changes: 1 addition & 2 deletions src/net/sourceforge/plantuml/DefinitionsContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

public interface DefinitionsContainer extends PreprocessorModeSet {

public List<String> getDefinition1(String name);
public List<String> getDefinition2(String name);
public List<String> getDefinition(String name);

}
6 changes: 5 additions & 1 deletion src/net/sourceforge/plantuml/Option.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,11 @@ public final List<String> getExcludes() {
public Defines getDefaultDefines(File f) {
final Defines result = Defines.createWithFileName(f);
for (Map.Entry<String, String> ent : defines.entrySet()) {
result.define(ent.getKey(), Arrays.asList(ent.getValue()), false, null);
String value = ent.getValue();
if (value == null) {
value = "";
}
result.define(ent.getKey(), Arrays.asList(value), false, null);
}
return result;
}
Expand Down
4 changes: 4 additions & 0 deletions src/net/sourceforge/plantuml/OptionFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public class OptionFlags {

static public boolean ALLOW_INCLUDE = true;

static public void setAllowIncludeFalse() {
ALLOW_INCLUDE = false;
}

static public void setMaxPixel(int max) {
ImageBuilder.setMaxPixel(max);
}
Expand Down
1 change: 0 additions & 1 deletion src/net/sourceforge/plantuml/PSystemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import net.sourceforge.plantuml.bpm.BpmDiagramFactory;
import net.sourceforge.plantuml.classdiagram.ClassDiagramFactory;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.compositediagram.CompositeDiagramFactory;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;
Expand Down
1 change: 0 additions & 1 deletion src/net/sourceforge/plantuml/SkinParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import java.util.TreeSet;

import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
Expand Down
7 changes: 7 additions & 0 deletions src/net/sourceforge/plantuml/StringLocated.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public StringLocated append(String endOfLine) {
return new StringLocated(s + endOfLine, location, preprocessorError);
}

public StringLocated mergeEndBackslash(StringLocated next) {
if (StringUtils.endsWithBackslash(s) == false) {
throw new IllegalArgumentException();
}
return new StringLocated(s.substring(0, s.length() - 1) + next.s, location, preprocessorError);
}

public StringLocated(String s, LineLocation location, String preprocessorError) {
if (s == null) {
throw new IllegalArgumentException();
Expand Down
Loading

0 comments on commit 19b9eb3

Please sign in to comment.