rbs 4.0.0.dev.1 → 4.0.0.dev.2
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 +4 -4
- data/.github/workflows/ruby.yml +28 -0
- data/Rakefile +8 -0
- data/ext/rbs_extension/ast_translation.c +2 -0
- data/ext/rbs_extension/ast_translation.h +4 -0
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +4 -0
- data/ext/rbs_extension/legacy_location.h +5 -0
- data/ext/rbs_extension/rbs_extension.h +3 -0
- data/ext/rbs_extension/rbs_string_bridging.h +4 -0
- data/include/rbs/lexer.h +3 -3
- data/lib/rbs/version.rb +1 -1
- data/src/lexstate.c +3 -3
- data/src/parser.c +1 -1
- data/src/util/rbs_constant_pool.c +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f04dce135a1eb82da13c36f9a8ac01710c75cc2d2943643508b94187f281529
|
4
|
+
data.tar.gz: e4ddb5b4dd310100eb75e07b0a88a1cd92a2787f262db440b33834fbdd595b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55dc93bbac5c8472d7241e999bfa879ee6fe2c4e8e518eebae130596fc650a9e512a6140fc52d62be3b11751a3fb6414c7cdd8aeed85423e65077862223435f9
|
7
|
+
data.tar.gz: c160219cfb46afc018c8f5a1e21d10d21ba517f5f13b74d3871add96713fefe3597865d0907fc59f229098f7e13d3de729026136ee1eb15e0055ce90abfc8b9c
|
data/.github/workflows/ruby.yml
CHANGED
@@ -106,3 +106,31 @@ jobs:
|
|
106
106
|
- run: bundle exec rake test:valgrind
|
107
107
|
env:
|
108
108
|
RUBY_FREE_AT_EXIT: 1
|
109
|
+
C99_compile:
|
110
|
+
runs-on: macos-latest
|
111
|
+
strategy:
|
112
|
+
fail-fast: false
|
113
|
+
matrix:
|
114
|
+
ruby: ['3.4', head]
|
115
|
+
steps:
|
116
|
+
- uses: actions/checkout@v4
|
117
|
+
- name: Install dependencies
|
118
|
+
run: |
|
119
|
+
brew install ruby-build
|
120
|
+
- uses: ruby/setup-ruby@v1
|
121
|
+
with:
|
122
|
+
ruby-version: ${{ matrix.ruby }}
|
123
|
+
bundler: none
|
124
|
+
- name: Set working directory as safe
|
125
|
+
run: git config --global --add safe.directory $(pwd)
|
126
|
+
- name: Update rubygems & bundler
|
127
|
+
run: |
|
128
|
+
ruby -v
|
129
|
+
gem update --system
|
130
|
+
- name: clang version
|
131
|
+
run: clang --version
|
132
|
+
- name: bin/setup
|
133
|
+
run: |
|
134
|
+
bin/setup
|
135
|
+
- run: bundle exec rake clean compile_c99
|
136
|
+
|
data/Rakefile
CHANGED
@@ -437,3 +437,11 @@ task :changelog do
|
|
437
437
|
puts " (🤑 There is no *unreleased* pull request associated to the milestone.)"
|
438
438
|
end
|
439
439
|
end
|
440
|
+
|
441
|
+
desc "Compile extension without C23 extensions"
|
442
|
+
task :compile_c99 do
|
443
|
+
ENV["TEST_NO_C23"] = "true"
|
444
|
+
Rake::Task[:"compile"].invoke
|
445
|
+
ensure
|
446
|
+
ENV.delete("TEST_NO_C23")
|
447
|
+
end
|
@@ -1146,4 +1146,6 @@ VALUE rbs_struct_to_ruby_value(rbs_translation_context_t ctx, rbs_node_t *instan
|
|
1146
1146
|
return ID2SYM(rb_intern3((const char *) constant->start, constant->length, ctx.encoding));
|
1147
1147
|
}
|
1148
1148
|
}
|
1149
|
+
|
1150
|
+
rb_raise(rb_eRuntimeError, "Unknown node type: %d", instance->type);
|
1149
1151
|
}
|
@@ -8,8 +8,12 @@
|
|
8
8
|
#ifndef RBS_EXTENSION_AST_TRANSLATION_H
|
9
9
|
#define RBS_EXTENSION_AST_TRANSLATION_H
|
10
10
|
|
11
|
+
#include "compat.h"
|
12
|
+
|
13
|
+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
|
11
14
|
#include "ruby.h"
|
12
15
|
#include "ruby/encoding.h"
|
16
|
+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
|
13
17
|
|
14
18
|
#include "rbs/ast.h"
|
15
19
|
#include "rbs/location.h"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#ifdef __clang__
|
2
|
+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN \
|
3
|
+
_Pragma("clang diagnostic push") \
|
4
|
+
_Pragma("clang diagnostic ignored \"-Wc2x-extensions\"")
|
5
|
+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END \
|
6
|
+
_Pragma("clang diagnostic pop")
|
7
|
+
#else
|
8
|
+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
|
9
|
+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
|
10
|
+
#endif
|
@@ -13,5 +13,9 @@ $srcs = Dir.glob("#{root_dir}/src/**/*.c") +
|
|
13
13
|
|
14
14
|
append_cflags ['-std=gnu99', '-Wimplicit-fallthrough', '-Wunused-result']
|
15
15
|
append_cflags ['-O0', '-g'] if ENV['DEBUG']
|
16
|
+
if ENV["TEST_NO_C23"]
|
17
|
+
puts "Adding -Wc2x-extensions to CFLAGS"
|
18
|
+
$CFLAGS << " -Werror -Wc2x-extensions"
|
19
|
+
end
|
16
20
|
|
17
21
|
create_makefile 'rbs_extension'
|
@@ -1,8 +1,12 @@
|
|
1
1
|
#ifndef RBS__RBS_STRING_BRIDGING_H
|
2
2
|
#define RBS__RBS_STRING_BRIDGING_H
|
3
3
|
|
4
|
+
#include "compat.h"
|
5
|
+
|
6
|
+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
|
4
7
|
#include "ruby.h"
|
5
8
|
#include "ruby/encoding.h"
|
9
|
+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
|
6
10
|
|
7
11
|
#include "rbs/string.h"
|
8
12
|
|
data/include/rbs/lexer.h
CHANGED
@@ -140,9 +140,9 @@ typedef struct {
|
|
140
140
|
const rbs_encoding_t *encoding;
|
141
141
|
} rbs_lexer_t;
|
142
142
|
|
143
|
-
extern rbs_token_t NullToken;
|
144
|
-
extern rbs_position_t NullPosition;
|
145
|
-
extern rbs_range_t NULL_RANGE;
|
143
|
+
extern const rbs_token_t NullToken;
|
144
|
+
extern const rbs_position_t NullPosition;
|
145
|
+
extern const rbs_range_t NULL_RANGE;
|
146
146
|
|
147
147
|
char *rbs_peek_token(rbs_lexer_t *lexer, rbs_token_t tok);
|
148
148
|
int rbs_token_chars(rbs_token_t tok);
|
data/lib/rbs/version.rb
CHANGED
data/src/lexstate.c
CHANGED
@@ -92,9 +92,9 @@ static const char *RBS_TOKENTYPE_NAMES[] = {
|
|
92
92
|
"tANNOTATION", /* Annotation */
|
93
93
|
};
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
const rbs_position_t NullPosition = { -1, -1, -1, -1 };
|
96
|
+
const rbs_range_t NULL_RANGE = { { -1, -1, -1, -1 }, { -1, -1, -1, -1 } };
|
97
|
+
const rbs_token_t NullToken = { .type = NullType, .range = { {0}, {0} } };
|
98
98
|
|
99
99
|
const char *rbs_token_type_str(enum RBSTokenType type) {
|
100
100
|
return RBS_TOKENTYPE_NAMES[type];
|
data/src/parser.c
CHANGED
@@ -96,7 +96,7 @@ rbs_constant_pool_resize(rbs_constant_pool_t *pool) {
|
|
96
96
|
}
|
97
97
|
|
98
98
|
// This storage is initialized by `Init_rbs_extension()` in `main.c`.
|
99
|
-
static rbs_constant_pool_t RBS_GLOBAL_CONSTANT_POOL_STORAGE = {};
|
99
|
+
static rbs_constant_pool_t RBS_GLOBAL_CONSTANT_POOL_STORAGE = {0};
|
100
100
|
rbs_constant_pool_t *RBS_GLOBAL_CONSTANT_POOL = &RBS_GLOBAL_CONSTANT_POOL_STORAGE;
|
101
101
|
|
102
102
|
/**
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.dev.
|
4
|
+
version: 4.0.0.dev.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: logger
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- ext/rbs_extension/ast_translation.h
|
161
161
|
- ext/rbs_extension/class_constants.c
|
162
162
|
- ext/rbs_extension/class_constants.h
|
163
|
+
- ext/rbs_extension/compat.h
|
163
164
|
- ext/rbs_extension/extconf.rb
|
164
165
|
- ext/rbs_extension/legacy_location.c
|
165
166
|
- ext/rbs_extension/legacy_location.h
|