Open ShizCalev opened 6 years ago
still persists - issue happened out of nowhere, fastdmm hasn't changed at all
The issue was related to our codebase having a string like this: "The circuit accepts a reference to thing to be grabbed. It can store up to 10 things. Modes: 1 for grab. 0 for eject the first thing. -1 for eject all."
And the macro for addition/subtraction picking up the . -1 as a macro.
might as well link the patched release https://github.com/Rockdtben/FastDMM/releases/tag/v0.7
@Rockdtben it accepts quite a few random setups, such as infinite decimal places in a number (1.2.3 - 1
), to fix that (and the previous bug) I recommend:
Flavour | Regex |
---|---|
Generic | (\d+.?\d*)[ \t]*(\+\|-)[ \t]*(\d+.?\d*) |
Java | (\\d\\+\\.?\\d*)[ \t]*(\\+\|\\-)[ \\t]*(\\d\\+\\.?\\d*) |
and yes, it is dividing when it should subtract
@RemieRichards Thank you for checking that for me. I will see about getting that fixed during my next layover flight.
I'm going to add some unit tests on that regex matcher and include some of the know bad statements.
Did you have any other examples of bad matching? Might as well get as many test cases as possible.
Well, the old regex is quite poor. ([\\d\\.]+)[ \\t]*(\\+|\\-)[ \\t]*([\\d\\.]+)
But it mostly fails on decimal places.
. - 1
(the original bug here)1.234.5 + 2
(Any amount of decimal places in numbers)1................................................5 - 1
(Sequential decimal places, essentially the same as the above, but more obvious). - .
(Just plain absurd, neither of these are numbers, it is however a cute face!)In terms of finding a int/float number with regex, ([\\d\\.]+)
is just unusable, I won't insult you by presuming you know nothing of regex, but that block (occurring twice in the regex itself) is saying "there must be at least one number or dot but there can be infinite of each", so this is why .
is seen as a number, and why it doesn't care if there's more than 1.
My "number block" is (\\d+.?\\d*)
which says "at least one number, then optionally one dot, then infinitely optional numbers", eg 13 is valid, since the dot is optional, and 1.3 is valid since it does have the dot, and 1.3333333 is valid too, and so on.
I get this error when trying to load my .dme file. I tried 0.6 and 0.7, no luck. Have never been able to get it to work
@Chewyyy by the looks of it you probably have a bad #include
statement.
pastebin your .dme.
Was I suppose to add an #include statement into my dme for this to work?
I didn’t see anything
@Chewyyy
The dme contains one #include
statement for every file you include in your project.
They normally get there by ticking/unticking the file in dreammaker.
But the line that errored inside FastDMM looks like it found a DME line like:
#include ""
or #include
instead of:
#include "some/path/to/a/file.dm"
Which as far as I'm aware, DM doesn't naturally make broken #include
s, thats why I wanted you to copypaste your DME somewhere so I/someone could try and find the line (if there is one)
Could be a presumption in FastDMM though, but without seeing the DME, no idea.
`` // DM Environment file for .dme. // All manual changes should be made outside the BEGIN and END blocks. // New source code should be placed in .dm files: choose File/New --> Code File.
// BEGIN_INTERNALS // END_INTERNALS
// BEGIN_FILE_DIR
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
// END_INCLUDE ``
That is the DME
@Chewyyy Ah, it's these lines:
#include <deadron\xml\XML.dme>
#include <lummoxjr\iconprocs\IconProcs.dme>
FastDMM doesn't yet support loading DMEs inside DMEs (like the two libraries you've imported above) As a work around, you can copy past the code from those libraries, if available, into their own folders within your own project, just until FastDMM supports libraries (I'm working on it)
I moved the libraries over into their own folders and compiled, everything worked fine. I loaded up FastDMM, it didn't give the java errors, and began to load the map, and then after it finished, nothing popped up. Still says its awaiting a DMM to be loaded.
https://github.com/tgstation/FastDMM
If you want the latest and greatest. I don't think monster860 is working on this anymore.
https://github.com/monster860/FastDMM/blob/e62b4b7e93742e4cebc261ec1f4e93a1d796b833/src/main/java/com/github/monster860/fastdmm/objtree/ObjectTree.java#L206
Java 1.8.0_151 byond 512.1402