Do not use non-ASCII chars in sources

No encodings are guaranteed in C compilers, and other than UTF-8
encodings may be assumed in some platforms, e.g., CP932 on Windows
Japanese edition, and may result in compilation errors.
This commit is contained in:
Nobuyoshi Nakada 2023-11-05 02:14:26 +09:00
Родитель 054a4672cb
Коммит 368a1cb3c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 3582D74E1FEE4465
5 изменённых файлов: 19 добавлений и 15 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -13,7 +13,7 @@
enum {
COROUTINE_REGISTERS =
20 /* 19 general purpose registers (r13r31) 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 */
};

Просмотреть файл

@ -12,7 +12,7 @@
enum {
COROUTINE_REGISTERS =
20 /* 19 general purpose registers (r13r31) 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 */
};

Просмотреть файл

@ -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.

Просмотреть файл

@ -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)