Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ jobs:
env:
PRISM_BUILD_MINIMAL: "1"

build-with-various-compilers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- name: Build with various compilers
run: bundle exec rake build_in_docker

build-java:
runs-on: ubuntu-latest
env:
Expand Down
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,21 @@ namespace :build do
desc "Build a development version of the gem"
task dev: ["build:dev_version_set", "build", "build:dev_version_clear"]
end

task :build_in_docker => :templates do
# Versions from https://github.com/ruby/ruby/blob/master/.github/workflows/compilers.yml
compilers = (7..15).map { |v| "gcc-#{v}" }
compilers.each do |compiler|
dockerfile = <<~DOCKERFILE
FROM ghcr.io/ruby/ruby-ci-image:#{compiler}
USER root
ADD . /prism
WORKDIR /prism
RUN #{compiler} --version
RUN make CC=#{compiler}
DOCKERFILE
File.write 'Dockerfile', dockerfile
sh "docker build ."
rm 'Dockerfile'
end
end
7 changes: 4 additions & 3 deletions include/prism/internal/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "prism/internal/list.h"
#include "prism/internal/options.h"
#include "prism/internal/static_literals.h"
#include "prism/internal/strpbrk.h"

#include "prism/ast.h"
#include "prism/line_offset_list.h"
Expand Down Expand Up @@ -168,7 +169,7 @@ typedef struct pm_lex_mode {
* This is the character set that should be used to delimit the
* tokens within the list.
*/
uint8_t breakpoints[11];
uint8_t breakpoints[PM_STRPBRK_CACHE_SIZE];
} list;

struct {
Expand All @@ -190,7 +191,7 @@ typedef struct pm_lex_mode {
* This is the character set that should be used to delimit the
* tokens within the regular expression.
*/
uint8_t breakpoints[7];
uint8_t breakpoints[PM_STRPBRK_CACHE_SIZE];
} regexp;

struct {
Expand Down Expand Up @@ -223,7 +224,7 @@ typedef struct pm_lex_mode {
* This is the character set that should be used to delimit the
* tokens within the string.
*/
uint8_t breakpoints[7];
uint8_t breakpoints[PM_STRPBRK_CACHE_SIZE];
} string;

struct {
Expand Down