diff options
-rw-r--r-- | coroutine/ppc/Context.S | 2 | ||||
-rw-r--r-- | coroutine/ppc/Context.h | 2 | ||||
-rw-r--r-- | coroutine/ppc64/Context.h | 2 | ||||
-rw-r--r-- | prism/regexp.c | 24 | ||||
-rwxr-xr-x | prism/templates/template.rb | 4 |
5 files changed, 19 insertions, 15 deletions
diff --git a/coroutine/ppc/Context.S b/coroutine/ppc/Context.S index cdda93e179..e2431a9250 100644 --- a/coroutine/ppc/Context.S +++ b/coroutine/ppc/Context.S @@ -3,7 +3,7 @@ ; Some relevant examples: https://github.com/gcc-mirror/gcc/blob/master/libphobos/libdruntime/config/powerpc/switchcontext.S ; https://github.com/gcc-mirror/gcc/blob/master/libgcc/config/rs6000/darwin-gpsave.S ; https://www.ibm.com/docs/en/aix/7.2?topic=epilogs-saving-gprs-only -; ppc32 version may be re-written compactly with stmw/lwm, but the code wonʼt be faster, see: https://github.com/ruby/ruby/pull/5927#issuecomment-1139730541 +; ppc32 version may be re-written compactly with stmw/lwm, but the code won't be faster, see: https://github.com/ruby/ruby/pull/5927#issuecomment-1139730541 ; Notice that this code is only for Darwin (macOS). Darwin ABI differs from AIX and ELF. ; To add support for AIX, *BSD or *Linux, please make separate implementations. diff --git a/coroutine/ppc/Context.h b/coroutine/ppc/Context.h index 1fce112579..8035d08556 100644 --- a/coroutine/ppc/Context.h +++ b/coroutine/ppc/Context.h @@ -13,7 +13,7 @@ enum { COROUTINE_REGISTERS = - 20 /* 19 general purpose registers (r13–r31) and 1 return address */ + 20 /* 19 general purpose registers (r13-r31) and 1 return address */ + 4 /* space for fiber_entry() to store the link register */ }; diff --git a/coroutine/ppc64/Context.h b/coroutine/ppc64/Context.h index 3e6f77f55a..085b475ed5 100644 --- a/coroutine/ppc64/Context.h +++ b/coroutine/ppc64/Context.h @@ -12,7 +12,7 @@ enum { COROUTINE_REGISTERS = - 20 /* 19 general purpose registers (r13–r31) and 1 return address */ + 20 /* 19 general purpose registers (r13-r31) and 1 return address */ + 4 /* space for fiber_entry() to store the link register */ }; diff --git a/prism/regexp.c b/prism/regexp.c index 22833d177f..cd52857f79 100644 --- a/prism/regexp.c +++ b/prism/regexp.c @@ -116,18 +116,18 @@ pm_regexp_char_find(pm_regexp_parser_t *parser, uint8_t value) { * The properly track everything, we're going to build a little state machine. * It looks something like the following: * - * ┌───────┐ ┌─────────┐ ────────────┐ - * ──── lbrace ───> │ start │ ──── digit ───> │ minimum │ │ - * └───────┘ └─────────┘ <─── digit ─┘ - * │ │ │ - * ┌───────┐ │ │ rbrace - * │ comma │ <───── comma ┌──── comma ───────┘ │ - * └───────┘ V V - * │ ┌─────────┐ ┌─────────┐ - * └── digit ──> │ maximum │ ── rbrace ──> │| final |│ - * └─────────┘ └─────────┘ - * │ ^ - * └─ digit ─┘ + * +-------+ +---------+ ------------+ + * ---- lbrace ---> | start | ---- digit ---> | minimum | | + * +-------+ +---------+ <--- digit -+ + * | | | + * +-------+ | | rbrace + * | comma | <----- comma +---- comma -------+ | + * +-------+ V V + * | +---------+ +---------+ + * +-- digit --> | maximum | -- rbrace --> || final || + * +---------+ +---------+ + * | ^ + * +- digit -+ * * Note that by the time we've hit this function, the lbrace has already been * consumed so we're in the start state. diff --git a/prism/templates/template.rb b/prism/templates/template.rb index 553dbb5504..8a9825dfc0 100755 --- a/prism/templates/template.rb +++ b/prism/templates/template.rb @@ -360,6 +360,7 @@ module Prism =end HEADING else + escape = true <<~HEADING /******************************************************************************/ /* This file is generated by the templates/template.rb script and should not */ @@ -373,6 +374,9 @@ module Prism write_to ||= File.expand_path("../#{name}", __dir__) contents = heading + erb.result_with_hash(locals) + if escape + (contents = contents.b).gsub!(/[^\t-~]/) {|c| "\\x%.2x" % c.ord} + end FileUtils.mkdir_p(File.dirname(write_to)) File.write(write_to, contents) |