Commit 9c6045d1 authored by Chris Müller's avatar Chris Müller
Browse files

Fix bugs in float- and fixnum scanner

parent 761c68fa
......@@ -150,7 +150,8 @@ lex_float(struct CyContext* context)
state = FP_EXPONENT;
else if(ch == '.')
state = FP_DOT;
assert(0);
else
assert(0);
break;
case FP_EXPONENT:
......@@ -251,7 +252,6 @@ lex_number(struct CyContext* context)
state = INT_BIN_WAIT;
} else if('0' <= ch && ch <= '7') {
state = INT_OCT_READ;
cry_array_clear(buffer);
break;
} else if(ch == '.' || ch == 'e' || ch == 'E') {
context->src = p;
......@@ -344,7 +344,7 @@ cy_lex(struct CyContext* context)
byte_t* p = context->src;
while(1) {
cy_array_clear(context->buffer);
cry_array_clear(context->buffer);
unicode_t ch = cry_utf8_get(p);
......@@ -379,4 +379,20 @@ cy_lex(struct CyContext* context)
return TOK_EOF;
}
byte_t*
cy_token_string(struct CyContext* context)
{
assert(context->buffer != 0);
(byte_t*) cry_array_get(context->buffer, 0);
}
size_t
cy_token_length(struct CyContext* context)
{
assert(context->buffer != 0);
cry_array_size(context->buffer);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment