Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
f2365ec7
Commit
f2365ec7
authored
Sep 07, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AST & BST: make enums smaller
parent
9ef680bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
src/analysis/scoping_analysis.h
src/analysis/scoping_analysis.h
+1
-1
src/core/ast.h
src/core/ast.h
+4
-4
src/core/bst.h
src/core/bst.h
+2
-2
No files found.
src/analysis/scoping_analysis.h
View file @
f2365ec7
...
...
@@ -65,7 +65,7 @@ public:
// import dis
// print dis.dis(g)
enum
class
VarScopeType
{
enum
class
VarScopeType
:
unsigned
char
{
FAST
,
GLOBAL
,
CLOSURE
,
...
...
src/core/ast.h
View file @
f2365ec7
...
...
@@ -146,7 +146,7 @@ namespace AST_TYPE {
#define GENERATE_ENUM(ENUM, N) ENUM = N,
#define GENERATE_STRING(STRING, N) m[N] = #STRING;
enum
AST_TYPE
{
FOREACH_TYPE
(
GENERATE_ENUM
)
};
enum
AST_TYPE
:
unsigned
char
{
FOREACH_TYPE
(
GENERATE_ENUM
)
};
static
const
char
*
stringify
(
int
n
)
{
static
std
::
map
<
int
,
const
char
*>
m
;
...
...
@@ -730,7 +730,7 @@ public:
class
AST_Num
:
public
AST_expr
{
public:
enum
NumType
{
enum
NumType
:
unsigned
char
{
// These values must correspond to the values in parse_ast.py
INT
=
0x10
,
FLOAT
=
0x20
,
...
...
@@ -852,7 +852,7 @@ public:
class
AST_Str
:
public
AST_expr
{
public:
enum
StrType
{
enum
StrType
:
unsigned
char
{
UNSET
=
0x00
,
STR
=
0x10
,
UNICODE
=
0x20
,
...
...
@@ -1007,7 +1007,7 @@ public:
// These are basically bytecodes, framed as pseudo-AST-nodes.
class
AST_LangPrimitive
:
public
AST_expr
{
public:
enum
Opcodes
{
enum
Opcodes
:
unsigned
char
{
LANDINGPAD
,
// grabs the info about the last raised exception
LOCALS
,
GET_ITER
,
...
...
src/core/bst.h
View file @
f2365ec7
...
...
@@ -147,7 +147,7 @@ namespace BST_TYPE {
#define GENERATE_ENUM(ENUM, N) ENUM = N,
#define GENERATE_STRING(STRING, N) m[N] = #STRING;
enum
BST_TYPE
{
FOREACH_TYPE
(
GENERATE_ENUM
)
};
enum
BST_TYPE
:
unsigned
char
{
FOREACH_TYPE
(
GENERATE_ENUM
)
};
static
const
char
*
stringify
(
int
n
)
{
static
std
::
map
<
int
,
const
char
*>
m
;
...
...
@@ -758,7 +758,7 @@ public:
// These are basically bytecodes, framed as pseudo-BST-nodes.
class
BST_LangPrimitive
:
public
BST_expr
{
public:
enum
Opcodes
{
enum
Opcodes
:
unsigned
char
{
LANDINGPAD
,
// grabs the info about the last raised exception
LOCALS
,
GET_ITER
,
...
...
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