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

to add new command line argument -copy #434

Open
Graur opened this issue Nov 23, 2022 · 4 comments
Open

to add new command line argument -copy #434

Graur opened this issue Nov 23, 2022 · 4 comments

Comments

@Graur
Copy link

Graur commented Nov 23, 2022

We need to add new command line argument -copy. Which will copy files from https://github.com/polystat/c2eo/tree/master/project/eo-lib next the main translated .eo file.

e.g. I want to translate this C file:

int foo(int x) {
    return 42 / x;
}

to EO file. I run docker run -v $(pwd):/eo yegor256/c2eo:0.1.24 foo.c foo.eo and get this part of foo.eo:

+alias c2eo.coperators.plus
+alias c2eo.coperators.ram
+alias c2eo.coperators.read-as-int32
+alias c2eo.coperators.write-as-int32
+package c2eo.src.global

[args...] > global

...

But when I try to compile EO file I get error:

Failed while trying to pull /Users/…/c2eo/coperators/address.eo

Because address.eo is an internal library in c2eo.
So, we need to have opportunity to copy these files and place them near the translated .eo file by adding a new argument:

c2eo -copy foo.c
@Graur
Copy link
Author

Graur commented Nov 23, 2022

@EugeneDar Can you help us here?

@EugeneDar
Copy link

EugeneDar commented Nov 25, 2022

@Graur I don't understand why we need file name in command c2eo -copy foo.c. I think here should be path to the target directory like c2eo -copy . or we should use this flag in the first step of translation like c2eo -copy sourse.c target.eo.

@Graur
Copy link
Author

Graur commented Nov 25, 2022

@EugeneDar It was just an example. I think about this usage c2eo -copy sourse.c target.eo. But if you have another ideas you are welcome to share them

@EugeneDar
Copy link

@Graur why should we download files from github if we have eo-lib locally in package project?

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

2 participants