windelbouwman / ppci

A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
https://ppci.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
335 stars 35 forks source link

Adding an example of file reading #115

Closed darleybarreto closed 4 years ago

darleybarreto commented 4 years ago

I've made a really simple example of reading a file from the fs and printing on the screen.

codecov-commenter commented 4 years ago

Codecov Report

Merging #115 into master will increase coverage by 0.30%. The diff coverage is 36.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
+ Coverage   78.54%   78.85%   +0.30%     
==========================================
  Files         352      351       -1     
  Lines       46147    46954     +807     
==========================================
+ Hits        36248    37024     +776     
- Misses       9899     9930      +31     
Impacted Files Coverage Δ
ppci/cli/cc.py 75.60% <ø> (ø)
ppci/codegen/irdag.py 95.74% <33.33%> (-2.37%) :arrow_down:
ppci/lang/c/codegenerator.py 95.18% <33.33%> (-0.09%) :arrow_down:
ppci/ir.py 90.26% <50.00%> (+0.05%) :arrow_up:
ppci/lang/tools/regex/parser.py 69.86% <0.00%> (-14.92%) :arrow_down:
ppci/lang/tools/regex/regex.py 70.52% <0.00%> (-11.12%) :arrow_down:
ppci/arch/riscv/registers.py 93.06% <0.00%> (-0.94%) :arrow_down:
ppci/binutils/dbg/debugger.py 87.59% <0.00%> (-0.52%) :arrow_down:
ppci/wasm/util.py 38.70% <0.00%> (-0.43%) :arrow_down:
ppci/arch/mips/instructions.py 86.13% <0.00%> (-0.25%) :arrow_down:
... and 97 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1c8328b...2d8a212. Read the comment docs.

darleybarreto commented 4 years ago

I've read the comments on #114 (sorry for the inconvenience) but I'm a bit lost, what should I do to squash those commits into a single one on master? And what do I do on my side (w.r.t git) to merge this PR?

pfalcon commented 4 years ago

@darleybarreto: Thanks for being interested in learning new things (mastering git is fully worth it).

What I would do is:

git checkout master
git pull upstream master
git checkout file_reading
git rebase master  ## Here, you should be prepared to deal with conflicts
git rebase -i master ## Follow instructions in your editor (very carefully)

This assumes that you already setup "upstream" remote to pull changes from the main project into your fork.

If any of the commands above are unfamiliar to you, make sense to read man pages for them (e.g. git rebase --help). You may also want to google various things, there're tons of guides for rebase-based git workflow. Random google up from my side: https://medium.com/singlestone/a-git-workflow-using-rebase-1b1210de83e5 (dunno how good it is, but it has "Why squash?" section, so talks about the same things as we here.)

Good luck!

darleybarreto commented 4 years ago

Thank you so much for you explanation, I think I solved it. I am going to close this PR and make another.