neugram / ng

scripting language integrated with Go
https://neugram.io
BSD 2-Clause "Simplified" License
916 stars 43 forks source link

cmd/ng-gengo: add a command to generate a Go package from a Ng script #198

Closed sbinet closed 6 years ago

sbinet commented 6 years ago

Command ng-gengo generates a Go package file from a Neugram script.

    Usage: ng-gengo [options] file1.ng

    ex:
     $> ng-gengo ./eval/testdata/defer1.ng
     $> ng-gengo ./eval/testdata/defer1.ng > defer1.go
     $> ng-gengo -pkg=main ./eval/testdata/defer1.ng

    options:
      -pkg string
            name of the output Go package (default "main")
codecov-io commented 6 years ago

Codecov Report

Merging #198 into master will decrease coverage by 0.13%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
- Coverage   49.99%   49.85%   -0.14%     
==========================================
  Files          22       22              
  Lines       10406    10406              
==========================================
- Hits         5202     5188      -14     
- Misses       4702     4714      +12     
- Partials      502      504       +2
Impacted Files Coverage Δ
parser/scanner.go 68.92% <0%> (-2.2%) :arrow_down:
parser/parser.go 70.05% <0%> (-0.22%) :arrow_down:

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 be30bf5...c656d20. Read the comment docs.

sbinet commented 6 years ago

ah... I didn't notice that :)

I created this little command mainly for debugging purposes (ie: fixing the gengo tests when implementing a new thing under eval/testdata)

I can drop this if you want (the ng -o main foo.ng modus operandi suits me.)

crawshaw commented 6 years ago

Submitting it for debugging is fine with me. Maybe mention that in its docs somewhere?