THM-MoTE / mope-server

Server process for Modelica | Editor
https://thm-mote.github.io//projects/mope
GNU General Public License v3.0
9 stars 0 forks source link

Server dies when trying to autocomplete SIUnits package #13

Closed CSchoel closed 5 years ago

CSchoel commented 5 years ago

When I add SIUnits to my code, the Mo|E-Server dies with a StackOverflowError.

MWE:

model Foo
  Modelica.SIunits.Time t;
end Foo;

Error Message:

java.lang.StackOverflowError: null
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4736) ~[na:na]
    at java.base/java.util.regex.Pattern$GroupHead.match(Pattern.java:4791) ~[na:na]
    at java.base/java.util.regex.Pattern$LazyLoop.match(Pattern.java:4996) ~[na:na]
    at java.base/java.util.regex.Pattern$GroupTail.match(Pattern.java:4850) ~[na:na]
    at java.base/java.util.regex.Pattern$BranchConn.match(Pattern.java:4700) ~[na:na]
    at java.base/java.util.regex.Pattern$CharProperty.match(Pattern.java:3927) ~[na:na]
    at java.base/java.util.regex.Pattern$Branch.match(Pattern.java:4736) ~[na:na]
        ... [repeat]
njustus commented 5 years ago

Should be fixed in 0.7.2. Actually a omc-api error caused by an ambiguous regular expression. We should definitely implement a basic modelica parser. At least for nested expressions, like Arrays or records.

njustus commented 5 years ago

It doesn't crash with a StackOverflow anymore. Some times the parsing takes too long so the Future is killed before its completed.. :see_no_evil:

We do need a parser, not regular expressions!