Skip to content

Commit 0b71f07

Browse files
authored
Merge pull request #4 from mrubyedge/update-mruby-compiler2
Update mruby-compiler2
2 parents e5df634 + 103884f commit 0b71f07

File tree

16 files changed

+264
-20
lines changed

16 files changed

+264
-20
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mruby-compiler2-sys"
3-
version = "0.2.2"
3+
version = "0.3.0"
44
edition = "2024"
55
authors = [
66
"Uchio Kondo <udzura@udzura.jp>",
@@ -19,7 +19,7 @@ include = [
1919
]
2020

2121
[dependencies]
22-
libc = { version = "0.2.177", optional = true }
22+
libc = { version = "0.2.182", optional = true }
2323

2424
[build-dependencies]
2525
bindgen = ">= 0"

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ fn main() {
2222
.define("MRB_INT64", "1")
2323
.define("PRISM_XALLOCATOR", "")
2424
.define("PRISM_BUILD_MINIMAL", "")
25+
.define("PICORB_VM_MRUBYC", "")
26+
.define("MRBC_ALLOC_LIBC", "")
27+
.include("./vendor/include")
2528
.include("./vendor/mruby-compiler2/include")
2629
.include("./vendor/mruby-compiler2/lib/prism/include")
2730
.flag("-fPIC")

vendor/include/mrubyc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Dummy inclusion header

vendor/mruby-compiler2/include/mrc_common.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@
3030
#endif
3131
#include "prism.h"
3232

33-
#define MRC_RELEASE_YEAR 2024
34-
#define MRC_RELEASE_MONTH 9
35-
#define MRC_RELEASE_DAY 9
33+
#ifndef PICORUBY_VERSION
34+
#define MRC_VERSION "unknown (standalone)"
35+
#else
36+
#define MRC_VERSION PICORUBY_VERSION
37+
#endif
38+
39+
#define MRC_RELEASE_YEAR 2026
40+
#define MRC_RELEASE_MONTH 1
41+
#define MRC_RELEASE_DAY 21
3642
#define MRC_RELEASE_DATE MRC_STRINGIZE(MRC_RELEASE_YEAR) "-" \
3743
MRC_STRINGIZE(MRC_RELEASE_MONTH) "-" \
3844
MRC_STRINGIZE(MRC_RELEASE_DAY)

vendor/mruby-compiler2/include/mrc_dump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ mrc_bin_to_uint8(const uint8_t *bin)
145145
static inline const char*
146146
mrc_description(void)
147147
{
148-
return "(" MRC_RELEASE_DATE ") Parser: " RITE_PARSER_NAME ", RITE: " RITE_BINARY_FORMAT_VER;
148+
return MRC_VERSION " (" MRC_RELEASE_DATE ") Parser: " RITE_PARSER_NAME ", RITE: " RITE_BINARY_FORMAT_VER;
149149
}
150150

151151
MRC_END_DECL

vendor/mruby-compiler2/include/mrc_irep.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
*/
1515
MRC_BEGIN_DECL
1616

17-
enum irep_pool_type {
18-
IREP_TT_STR = 0, /* string (need free) */
19-
IREP_TT_SSTR = 2, /* string (static) */
20-
IREP_TT_INT32 = 1, /* 32bit integer */
21-
IREP_TT_INT64 = 3, /* 64bit integer */
22-
IREP_TT_BIGINT = 7, /* big integer (not yet supported) */
23-
IREP_TT_FLOAT = 5, /* float (double/float) */
24-
};
25-
2617
#define IREP_TT_NFLAG 1 /* number (non string) flag */
2718
#define IREP_TT_SFLAG 2 /* static string flag */
2819

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef MRB_IREP_POOL_TYPE_H
2+
#define MRB_IREP_POOL_TYPE_H
3+
4+
MRC_BEGIN_DECL
5+
6+
enum irep_pool_type {
7+
IREP_TT_STR = 0, /* string (need free) */
8+
IREP_TT_SSTR = 2, /* string (static) */
9+
IREP_TT_INT32 = 1, /* 32bit integer */
10+
IREP_TT_INT64 = 3, /* 64bit integer */
11+
IREP_TT_BIGINT = 7, /* big integer (not yet supported) */
12+
IREP_TT_FLOAT = 5, /* float (double/float) */
13+
};
14+
15+
MRC_END_DECL
16+
17+
#endif

vendor/mruby-compiler2/include/mrc_presym.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ MRC_SYM_1(compile, 28)
3030
MRC_SYM_1(__ENCODING__, 29)
3131
MRC_SYM_2(nil_p, nil?,30)
3232
MRC_SYM_2(back_ref, $+, 31)
33+
MRC_SYM_2(defined_p, defined?, 32)
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# frozen_string_literal: true
2+
3+
Gem::Specification.new do |spec|
4+
spec.name = "prism"
5+
spec.version = "1.4.0"
6+
spec.authors = ["Shopify"]
7+
spec.email = ["ruby@shopify.com"]
8+
9+
spec.summary = "Prism Ruby parser"
10+
spec.homepage = "https://github.com/ruby/prism"
11+
spec.license = "MIT"
12+
13+
spec.required_ruby_version = ">= 2.7.0"
14+
15+
spec.require_paths = ["lib"]
16+
spec.files = [
17+
"BSDmakefile",
18+
"CHANGELOG.md",
19+
"CODE_OF_CONDUCT.md",
20+
"CONTRIBUTING.md",
21+
"LICENSE.md",
22+
"Makefile",
23+
"README.md",
24+
"config.yml",
25+
"docs/build_system.md",
26+
"docs/configuration.md",
27+
"docs/cruby_compilation.md",
28+
"docs/design.md",
29+
"docs/encoding.md",
30+
"docs/fuzzing.md",
31+
"docs/heredocs.md",
32+
"docs/javascript.md",
33+
"docs/local_variable_depth.md",
34+
"docs/mapping.md",
35+
"docs/parser_translation.md",
36+
"docs/parsing_rules.md",
37+
"docs/releasing.md",
38+
"docs/relocation.md",
39+
"docs/ripper_translation.md",
40+
"docs/ruby_api.md",
41+
"docs/ruby_parser_translation.md",
42+
"docs/serialization.md",
43+
"docs/testing.md",
44+
"ext/prism/api_node.c",
45+
"ext/prism/api_pack.c",
46+
"ext/prism/extension.c",
47+
"ext/prism/extension.h",
48+
"include/prism.h",
49+
"include/prism/ast.h",
50+
"include/prism/defines.h",
51+
"include/prism/diagnostic.h",
52+
"include/prism/encoding.h",
53+
"include/prism/node.h",
54+
"include/prism/options.h",
55+
"include/prism/pack.h",
56+
"include/prism/parser.h",
57+
"include/prism/prettyprint.h",
58+
"include/prism/regexp.h",
59+
"include/prism/static_literals.h",
60+
"include/prism/util/pm_buffer.h",
61+
"include/prism/util/pm_char.h",
62+
"include/prism/util/pm_constant_pool.h",
63+
"include/prism/util/pm_integer.h",
64+
"include/prism/util/pm_list.h",
65+
"include/prism/util/pm_memchr.h",
66+
"include/prism/util/pm_newline_list.h",
67+
"include/prism/util/pm_strncasecmp.h",
68+
"include/prism/util/pm_string.h",
69+
"include/prism/util/pm_strpbrk.h",
70+
"include/prism/version.h",
71+
"lib/prism.rb",
72+
"lib/prism/compiler.rb",
73+
"lib/prism/desugar_compiler.rb",
74+
"lib/prism/dispatcher.rb",
75+
"lib/prism/dot_visitor.rb",
76+
"lib/prism/dsl.rb",
77+
"lib/prism/ffi.rb",
78+
"lib/prism/inspect_visitor.rb",
79+
"lib/prism/lex_compat.rb",
80+
"lib/prism/mutation_compiler.rb",
81+
"lib/prism/node_ext.rb",
82+
"lib/prism/node.rb",
83+
"lib/prism/pack.rb",
84+
"lib/prism/parse_result.rb",
85+
"lib/prism/parse_result/comments.rb",
86+
"lib/prism/parse_result/errors.rb",
87+
"lib/prism/parse_result/newlines.rb",
88+
"lib/prism/pattern.rb",
89+
"lib/prism/polyfill/append_as_bytes.rb",
90+
"lib/prism/polyfill/byteindex.rb",
91+
"lib/prism/polyfill/unpack1.rb",
92+
"lib/prism/reflection.rb",
93+
"lib/prism/relocation.rb",
94+
"lib/prism/serialize.rb",
95+
"lib/prism/string_query.rb",
96+
"lib/prism/translation.rb",
97+
"lib/prism/translation/parser.rb",
98+
"lib/prism/translation/parser33.rb",
99+
"lib/prism/translation/parser34.rb",
100+
"lib/prism/translation/parser35.rb",
101+
"lib/prism/translation/parser/builder.rb",
102+
"lib/prism/translation/parser/compiler.rb",
103+
"lib/prism/translation/parser/lexer.rb",
104+
"lib/prism/translation/ripper.rb",
105+
"lib/prism/translation/ripper/sexp.rb",
106+
"lib/prism/translation/ripper/shim.rb",
107+
"lib/prism/translation/ruby_parser.rb",
108+
"lib/prism/visitor.rb",
109+
"prism.gemspec",
110+
"rbi/prism.rbi",
111+
"rbi/prism/compiler.rbi",
112+
"rbi/prism/dsl.rbi",
113+
"rbi/prism/inspect_visitor.rbi",
114+
"rbi/prism/node_ext.rbi",
115+
"rbi/prism/node.rbi",
116+
"rbi/prism/parse_result.rbi",
117+
"rbi/prism/reflection.rbi",
118+
"rbi/prism/string_query.rbi",
119+
"rbi/prism/translation/parser.rbi",
120+
"rbi/prism/translation/parser33.rbi",
121+
"rbi/prism/translation/parser34.rbi",
122+
"rbi/prism/translation/parser35.rbi",
123+
"rbi/prism/translation/ripper.rbi",
124+
"rbi/prism/visitor.rbi",
125+
"sig/prism.rbs",
126+
"sig/prism/compiler.rbs",
127+
"sig/prism/dispatcher.rbs",
128+
"sig/prism/dot_visitor.rbs",
129+
"sig/prism/dsl.rbs",
130+
"sig/prism/inspect_visitor.rbs",
131+
"sig/prism/lex_compat.rbs",
132+
"sig/prism/mutation_compiler.rbs",
133+
"sig/prism/node_ext.rbs",
134+
"sig/prism/node.rbs",
135+
"sig/prism/pack.rbs",
136+
"sig/prism/parse_result.rbs",
137+
"sig/prism/pattern.rbs",
138+
"sig/prism/reflection.rbs",
139+
"sig/prism/relocation.rbs",
140+
"sig/prism/serialize.rbs",
141+
"sig/prism/string_query.rbs",
142+
"sig/prism/visitor.rbs",
143+
"src/diagnostic.c",
144+
"src/encoding.c",
145+
"src/node.c",
146+
"src/options.c",
147+
"src/pack.c",
148+
"src/prettyprint.c",
149+
"src/prism.c",
150+
"src/regexp.c",
151+
"src/serialize.c",
152+
"src/static_literals.c",
153+
"src/token_type.c",
154+
"src/util/pm_buffer.c",
155+
"src/util/pm_char.c",
156+
"src/util/pm_constant_pool.c",
157+
"src/util/pm_integer.c",
158+
"src/util/pm_list.c",
159+
"src/util/pm_memchr.c",
160+
"src/util/pm_newline_list.c",
161+
"src/util/pm_string.c",
162+
"src/util/pm_strncasecmp.c",
163+
"src/util/pm_strpbrk.c"
164+
]
165+
166+
spec.extensions = ["ext/prism/extconf.rb"]
167+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
168+
spec.metadata["source_code_uri"] = "https://github.com/ruby/prism"
169+
spec.metadata["changelog_uri"] = "https://github.com/ruby/prism/blob/main/CHANGELOG.md"
170+
end

0 commit comments

Comments
 (0)