Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
7ab7cadb
Unverified
Commit
7ab7cadb
authored
Jun 05, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stringify non C identifier symbols to stop macro errors by old gcc.
parent
2c1d209f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Rakefile
Rakefile
+7
-7
include/mruby/presym.h
include/mruby/presym.h
+1
-1
src/symbol.c
src/symbol.c
+2
-2
No files found.
Rakefile
View file @
7ab7cadb
...
...
@@ -181,24 +181,24 @@ file presym_inc => presym_file do
if
/\A\w+\Z/
=~
sym
f
.
print
"MRB_PRESYM_CSYM(
#{
sym
}
,
#{
i
+
1
}
)
\n
"
elsif
op_table
.
key?
(
sym
)
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
op_table
[
sym
]
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
op_table
[
sym
]
}
,
#{
i
+
1
}
)
\n
"
elsif
/\?\Z/
=~
sym
s
=
sym
.
dup
;
s
[
-
1
]
=
"_p"
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
elsif
/\!\Z/
=~
sym
s
=
sym
.
dup
;
s
[
-
1
]
=
"_b"
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
elsif
/\=\Z/
=~
sym
s
=
sym
.
dup
;
s
[
-
1
]
=
"_e"
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
elsif
/\A@/
=~
sym
s
=
sym
.
dup
;
s
[
0
]
=
"a_"
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
elsif
/\A$/
=~
sym
s
=
sym
.
dup
;
s
[
0
]
=
"d_"
f
.
print
"MRB_PRESYM_QSYM(
#{
sym
}
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_QSYM(
\"
#{
sym
}
\"
,
#{
s
}
,
#{
i
+
1
}
)
\n
"
else
f
.
print
"MRB_PRESYM_SYM(
#{
sym
}
,
#{
i
+
1
}
)
\n
"
f
.
print
"MRB_PRESYM_SYM(
\"
#{
sym
}
\"
,
#{
i
+
1
}
)
\n
"
end
end
f
.
print
"#define MRB_PRESYM_MAX
#{
presyms
.
size
}
"
...
...
include/mruby/presym.h
View file @
7ab7cadb
...
...
@@ -9,7 +9,7 @@
#undef MRB_PRESYM_MAX
#define MRB_PRESYM_CSYM(sym, num) MRB_PRESYM__##sym = (num<<1),
#define MRB_PRESYM_QSYM(s
rc
, sym, num) MRB_PRESYM_q_##sym = (num<<1),
#define MRB_PRESYM_QSYM(s
tr
, sym, num) MRB_PRESYM_q_##sym = (num<<1),
#define MRB_PRESYM_SYM(sym, num)
enum
mruby_presym
{
...
...
src/symbol.c
View file @
7ab7cadb
...
...
@@ -17,8 +17,8 @@
#undef MRB_PRESYM_QSYM
#undef MRB_PRESYM_SYM
#define MRB_PRESYM_CSYM(sym, num) #sym,
#define MRB_PRESYM_QSYM(s
ym, name, num) #sym
,
#define MRB_PRESYM_SYM(s
ym, num) #sym
,
#define MRB_PRESYM_QSYM(s
tr, name, num) str
,
#define MRB_PRESYM_SYM(s
tr, num) str
,
static
const
char
*
presym_table
[]
=
{
#include <../build/presym.inc>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment