Skip to content

Commit

Permalink
Update compiler message regex.
Browse files Browse the repository at this point in the history
Thanks to @cmnrd and edwardalee for pointing out that this was needed.

Lines are correctly adjusted in VS Code now. Note that this could have
been merged without this fix because I chose to specifically exclude
C from the LSP tests out of reluctance to maintain the #line
directive mechanism; see lf-lang/vscode-lingua-franca#84
  • Loading branch information
petervdonovan committed Oct 13, 2022
1 parent 9ea856a commit 0dce38f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public class CGenerator extends GeneratorBase {
// The third match is a character position within the line.
// The fourth match will be the error message.
static final Pattern compileErrorPattern = Pattern.compile(
"^(file:(?<path>.*)):(?<line>[0-9]+):(?<column>[0-9]+):(?<message>.*)$"
"^(?<path>.*):(?<line>[0-9]+):(?<column>[0-9]+):(?<message>.*)$"
);

public static int UNDEFINED_MIN_SPACING = -1;
Expand Down Expand Up @@ -571,17 +571,17 @@ public void doGenerate(Resource resource, LFGeneratorContext context) {
// If we are running an Arduino Target, need to copy over the Arduino-CMake files.
if (targetConfig.platformOptions.platform == Platform.ARDUINO) {
FileUtil.copyDirectoryFromClassPath(
"/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino",
"/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino",
fileConfig.getSrcGenPath().resolve("toolchain/Arduino"),
false
);
FileUtil.copyDirectoryFromClassPath(
"/lib/platform/arduino/Arduino-CMake-Toolchain/Platform",
fileConfig.getSrcGenPath().resolve("toolchain/Platform"),
"/lib/platform/arduino/Arduino-CMake-Toolchain/Platform",
fileConfig.getSrcGenPath().resolve("toolchain/Platform"),
false
);
FileUtil.copyFileFromClassPath(
"/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino-toolchain.cmake",
"/lib/platform/arduino/Arduino-CMake-Toolchain/Arduino-toolchain.cmake",
fileConfig.getSrcGenPath().resolve("toolchain/Arduino-toolchain.cmake"),
true
);
Expand All @@ -590,10 +590,10 @@ public void doGenerate(Resource resource, LFGeneratorContext context) {
s.append("set(ARDUINO_BOARD \"");
s.append(targetConfig.platformOptions.board.getBoardName());
s.append("\")");
FileUtil.writeToFile(s.toString(),
FileUtil.writeToFile(s.toString(),
fileConfig.getSrcGenPath().resolve("toolchain/BoardOptions.cmake"));
}

// Write the generated code
code.writeToFile(targetFile);
} catch (IOException e) {
Expand Down Expand Up @@ -1405,7 +1405,7 @@ private void generateSelfStruct(ReactorDecl decl, CodeBuilder constructorCode) {

// Next, generate fields for modes
CModesGenerator.generateDeclarations(reactor, body, constructorCode);

// The first field has to always be a pointer to the list of
// of allocated memory that must be freed when the reactor is freed.
// This means that the struct can be safely cast to self_base_t.
Expand Down

0 comments on commit 0dce38f

Please sign in to comment.