Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing compiler output not working #58

Open
v-tr opened this issue Feb 27, 2023 · 1 comment
Open

Parsing compiler output not working #58

v-tr opened this issue Feb 27, 2023 · 1 comment

Comments

@v-tr
Copy link

v-tr commented Feb 27, 2023

When using the @compiler and @error_format directive, the error output of the used compiler is not parsed.

Build

Build from HEAD (6a9a3af) using ldc2 on MacOS/arm64

Observed Behavior

When running lit -c hello.lit on

@code_type lua .lua
@comment_type -- %s
@compiler lit hello.lit && luacheck --formatter plain hello.lua
@error_format %f:%l:%s: %m

@title Hello World

@s Hello world program

--- hello.lua
local msg = "Hello World"

@{print msg}
---

@s printing

--- print msg
print(msg)
end
---

the output remains

lit hello.lit && luacheck --formatter plain hello.lua
hello.lua:6:1: expected <eof> near 'end'

which is the unparsed output of hte luacheck command.

Expected Behavior

Parsing and translating the filename and line number in the output

lit hello.lit && luacheck --formatter plain hello.lua
hello.lit:20:1: expected <eof> near 'end'
@v-tr
Copy link
Author

v-tr commented Feb 27, 2023

Using this example, which should use the build-in error format for clang leads to a comparable result

@compiler lit hello.lit && clang hello.c
@title Hello world in C

@s Introduction

This is an example hello world C program.
We can define codeblocks with `---`

--- hello.c
@{Includes}

int main() {
    @{Print a string}
    return 0;
    b = 5;
}
---

Now we can define the `Includes` codeblock:

--- Includes
#include <stdio.h>
---

Finally, our program needs to print "hello world"

--- Print a string
printf("hello world\n");
---
lit hello.lit && clang hello.c
hello.c:8:5: error: use of undeclared identifier 'b'
    b = 5;
    ^
1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant