Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: remove partial floats in scanner; fix support for identifiers of length 1023 and more #2467

Merged
merged 5 commits into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/gapstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum {

MAX_OPEN_FILES = 16,

MAX_VALUE_LEN = 1030,
MAX_VALUE_LEN = 1024,
};

typedef struct GAPState {
Expand Down
64 changes: 13 additions & 51 deletions src/intrprtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,13 +1730,13 @@ void IntrPow ( void )
** 'IntrIntExpr' is the action to interpret a literal integer expression.
** <str> is the integer as a (null terminated) C character string.
*/
void IntrIntExpr(Char * str)
void IntrIntExpr(Obj string, Char * str)
{
/* ignore or code */
if ( STATE(IntrReturning) > 0 ) { return; }
if ( STATE(IntrIgnoring) > 0 ) { return; }

Obj val = IntStringInternal(0, str);
Obj val = IntStringInternal(string, str);
GAP_ASSERT(val != Fail);

if (STATE(IntrCoding) > 0) {
Expand All @@ -1749,30 +1749,6 @@ void IntrIntExpr(Char * str)
}


/****************************************************************************
**
*F IntrLongIntExpr(<str>) . . interpret literal long integer expression
**
** 'IntrLongIntExpr' is the action to interpret a long literal integer
** expression whose digits are stored in a string GAP object.
*/
void IntrLongIntExpr(Obj string)
{
if ( STATE(IntrReturning) > 0 ) { return; }
if ( STATE(IntrIgnoring) > 0 ) { return; }

Obj val = IntStringInternal(string, 0);
GAP_ASSERT(val != Fail);

if (STATE(IntrCoding) > 0) {
CodeIntExpr(val);
}
else {
// push the integer value
PushObj(val);
}
}

/****************************************************************************
**
*F IntrFloatExpr(<str>) . . . . . . . . interpret literal float expression
Expand Down Expand Up @@ -1803,39 +1779,25 @@ static Obj ConvertFloatLiteralEager(Obj str)
return res;
}

void IntrFloatExpr (
Char * str )
void IntrFloatExpr(Obj string, Char * str)
{
Obj val;

/* ignore or code */
if ( STATE(IntrReturning) > 0 ) { return; }
if ( STATE(IntrIgnoring) > 0 ) { return; }
if ( STATE(IntrCoding) > 0 ) { CodeFloatExpr( str ); return; }

val = MakeString(str);
PushObj(ConvertFloatLiteralEager(val));
}


/****************************************************************************
**
*F IntrLongFloatExpr(<str>) . . interpret literal long float expression
**
** 'IntrLongFloatExpr' is the action to interpret a long literal float
** expression whose digits are stored in a string GAP object.
*/
void IntrLongFloatExpr (
Obj string )
{
/* ignore or code */
if ( STATE(IntrReturning) > 0 ) { return; }
if ( STATE(IntrIgnoring) > 0 ) { return; }
if ( STATE(IntrCoding) > 0 ) { CodeLongFloatExpr( string ); return; }
if ( STATE(IntrCoding) > 0 ) {
if (string)
CodeLongFloatExpr(string);
else
CodeFloatExpr( str );
return;
}

if (string == 0)
string = MakeString(str);
PushObj(ConvertFloatLiteralEager(string));
}


/****************************************************************************
**
*F IntrIntObjExpr() . . . . . . . 'interpret' a GAP small integer
Expand Down
19 changes: 10 additions & 9 deletions src/intrprtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,19 +540,22 @@ extern void IntrMod ( void );
extern void IntrPow ( void );


/****************************************************************************
**
*F IntrIntObjExpr(<val>)
*/
extern void IntrIntObjExpr(Obj val);


/****************************************************************************
**
*F IntrIntExpr(<str>) . . . . . . . . interpret literal integer expression
**
** 'IntrIntExpr' is the action to interpret a literal integer expression.
** <str> is the integer as a (null terminated) C character string.
*/
extern void IntrIntExpr(Obj string, Char * str);

extern void IntrIntObjExpr(Obj val);
extern void IntrIntExpr (
Char * str );
extern void IntrLongIntExpr (
Obj string );

/****************************************************************************
**
Expand All @@ -561,10 +564,8 @@ extern void IntrLongIntExpr (
** 'IntrFloatExpr' is the action to interpret a literal float expression.
** <str> is the float as a (null terminated) C character string.
*/
extern void IntrFloatExpr (
Char * str );
extern void IntrLongFloatExpr (
Obj string );
extern void IntrFloatExpr(Obj string, Char * str);


/****************************************************************************
**
Expand Down
Loading