emfrp 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +20 -0
- data/Gemfile +0 -2
- data/lib/emfrp/compile/c/alloc.rb +1 -1
- data/lib/emfrp/compile/c/syntax_codegen.rb +2 -1
- data/lib/emfrp/compile/c/syntax_exp_codegen.rb +2 -0
- data/lib/emfrp/version.rb +1 -1
- data/tests/compiler/GCLifeTime/GCLifeTime.mfrp +13 -0
- data/tests/compiler/GCLifeTime/GCLifeTimeMain.c +17 -0
- data/tests/compiler/GCLifeTime/Rakefile +2 -0
- data/tests/compiler/GCLifeTime/actual_out.txt +10 -0
- data/tests/compiler/GCLifeTime/expected_out.txt +10 -0
- data/tests/compiler/GCLifeTime/in.txt +10 -0
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 990c1ccf97f667ebb79f79f1f0e480ebcb40fe7ca379e4ea0ddecf4907f4c709
|
|
4
|
+
data.tar.gz: 45914615a642a6aa2fe41dff756c8150acf6622d758cfb482c29ec6eeed8fe73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc9f730f0f723f718eb5bc6909a48a7417c1a39641faa5e6738e9192f9fc45387eddb7f002c8eabf9128a3d1c1848915b5582e578086ad19d6d207b8634343aa
|
|
7
|
+
data.tar.gz: 7f5a4ad5655cbb96faed550dff8add18e1aa5a09d7157721da8dd192e0dca09ab64275898a722451d7bdd495a26a25418406cb53b8505e0fac3d16968aac0b95
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v1
|
|
12
|
+
- name: Set up Ruby 2.6
|
|
13
|
+
uses: actions/setup-ruby@v1
|
|
14
|
+
with:
|
|
15
|
+
ruby-version: 2.6.x
|
|
16
|
+
- name: Build and test with Rake
|
|
17
|
+
run: |
|
|
18
|
+
bundle install --jobs 4 --retry 3
|
|
19
|
+
cd tests && bundle exec rake
|
|
20
|
+
|
data/Gemfile
CHANGED
|
@@ -146,6 +146,7 @@ module Emfrp
|
|
|
146
146
|
while_stmts << "if (#{mn} < Counter) { x = #{memory_name(ct)} + #{memory_counter_name(ct)}; break; }"
|
|
147
147
|
s << "#{ref_name(ct)} x;"
|
|
148
148
|
s << ct.make_block("while (1) {", while_stmts, "}")
|
|
149
|
+
s << "x->mark = 0;"
|
|
149
150
|
s << "x->tvalue_id = #{i};" if self[:tvalues].length > 1
|
|
150
151
|
tvalue[:params].each_with_index do |param, i|
|
|
151
152
|
s << "x->value.#{tvalue.struct_name(ct)}.member#{i} = member#{i};"
|
|
@@ -159,7 +160,7 @@ module Emfrp
|
|
|
159
160
|
return if enum?(ct)
|
|
160
161
|
params = [[ref_name(ct), "x"], ["int", "mark"]]
|
|
161
162
|
ct.define_func("void", marker_func_name(ct), params) do |x|
|
|
162
|
-
x << "x->mark = mark;" unless self[:static]
|
|
163
|
+
x << "if (mark > x->mark) { x->mark = mark; }" unless self[:static]
|
|
163
164
|
accessor = self[:static] ? "." : "->"
|
|
164
165
|
cases = []
|
|
165
166
|
self[:tvalues].each_with_index do |tvalue, i|
|
|
@@ -72,6 +72,8 @@ module Emfrp
|
|
|
72
72
|
end
|
|
73
73
|
if i == 0
|
|
74
74
|
stmts << ct.make_block("if (#{cond_exp}) {", then_stmts, "}")
|
|
75
|
+
elsif i == self[:cases].length - 1
|
|
76
|
+
stmts << ct.make_block("else {", then_stmts, "}")
|
|
75
77
|
else
|
|
76
78
|
stmts << ct.make_block("else if (#{cond_exp}) {", then_stmts, "}")
|
|
77
79
|
end
|
data/lib/emfrp/version.rb
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module GCLifeTime
|
|
2
|
+
in a : Int
|
|
3
|
+
out x
|
|
4
|
+
use Std
|
|
5
|
+
|
|
6
|
+
type Wrap = Wrap(Int)
|
|
7
|
+
|
|
8
|
+
node init[Wrap(0)] wrap = Wrap(a)
|
|
9
|
+
node ref = wrap
|
|
10
|
+
node unwrap = ref of Wrap(val) -> val
|
|
11
|
+
node rewrap = Wrap(unwrap)
|
|
12
|
+
|
|
13
|
+
node x = (wrap@last, rewrap) of (Wrap(p), Wrap(q)) -> p + q
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: emfrp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kensuke Sawada
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colorize
|
|
@@ -75,6 +75,7 @@ executables:
|
|
|
75
75
|
extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
|
77
77
|
files:
|
|
78
|
+
- ".github/workflows/test.yml"
|
|
78
79
|
- ".gitignore"
|
|
79
80
|
- Gemfile
|
|
80
81
|
- LICENSE
|
|
@@ -151,6 +152,12 @@ files:
|
|
|
151
152
|
- tests/compiler/ComplexDataType/expected_out.txt
|
|
152
153
|
- tests/compiler/ComplexDataType/graph.png
|
|
153
154
|
- tests/compiler/ComplexDataType/in.txt
|
|
155
|
+
- tests/compiler/GCLifeTime/GCLifeTime.mfrp
|
|
156
|
+
- tests/compiler/GCLifeTime/GCLifeTimeMain.c
|
|
157
|
+
- tests/compiler/GCLifeTime/Rakefile
|
|
158
|
+
- tests/compiler/GCLifeTime/actual_out.txt
|
|
159
|
+
- tests/compiler/GCLifeTime/expected_out.txt
|
|
160
|
+
- tests/compiler/GCLifeTime/in.txt
|
|
154
161
|
- tests/compiler/LCDClock/LCDClock.mfrp
|
|
155
162
|
- tests/compiler/LCDClock/LCDClockMain.c
|
|
156
163
|
- tests/compiler/LCDClock/Rakefile
|
|
@@ -222,8 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
222
229
|
- !ruby/object:Gem::Version
|
|
223
230
|
version: '0'
|
|
224
231
|
requirements: []
|
|
225
|
-
|
|
226
|
-
rubygems_version: 2.5.2.2
|
|
232
|
+
rubygems_version: 3.0.3
|
|
227
233
|
signing_key:
|
|
228
234
|
specification_version: 4
|
|
229
235
|
summary: A compier of Emfrp, a FRP language for small embeded systems.
|