fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 20 forks source link

Two further bugs in Java import: unicode escape sequences in string literals and 'str' identifier #1135

Closed codemanyak closed 8 months ago

codemanyak commented 8 months ago

Java code import still fails in the following cases:

  1. String literals with unicode escape sequences like in unsuitedFiles += "\n\u2022 " + filename; - the parser rejects the entire string literal (by complaining about the first quote);
  2. an identifier str (or one of binary, hex. unbinary, or unhex) is declared or used in the Java code, like in String str = "Too bad!";.

Problem 1 is simply due to a forgotten escape sequence specification in the used grammar. Problem 2 is caused by an overdone grammar extension to make Processing (cf. #932) code pass, where some specific conversion functions are named after Java base types (cf. #959) - instead of introducing specific rules only for these conversion functions, even those were added that hadn't caused conflicts (but therefore did now).