@@ -455,16 +455,16 @@ rb_class_new_instance_freeze(int argc, const VALUE *argv, VALUE klass, bool free
455455 * Create a new Location instance from the given parser and bounds.
456456 */
457457static inline VALUE
458- parser_location (const pm_parser_t * parser , VALUE source , bool freeze , const uint8_t * start , size_t length ) {
459- VALUE argv [] = { source , LONG2FIX (start - parser -> start ), LONG2FIX (length ) };
458+ parser_location (const pm_parser_t * parser , VALUE source , bool freeze , uint32_t start , uint32_t length ) {
459+ VALUE argv [] = { source , LONG2FIX (start ), LONG2FIX (length ) };
460460 return rb_class_new_instance_freeze (3 , argv , rb_cPrismLocation , freeze );
461461}
462462
463463/**
464464 * Create a new Location instance from the given parser and location.
465465 */
466466#define PARSER_LOCATION_LOC (parser , source , freeze , loc ) \
467- parser_location(parser, source, freeze, loc.start, (size_t ) (loc.end - loc.start))
467+ parser_location(parser, source, freeze, (uint32_t) ( loc.start - parser->start) , (uint32_t ) (loc.end - loc.start))
468468
469469/**
470470 * Build a new Comment instance from the given parser and comment.
@@ -501,8 +501,8 @@ parser_comments(const pm_parser_t *parser, VALUE source, bool freeze) {
501501 */
502502static inline VALUE
503503parser_magic_comment (const pm_parser_t * parser , VALUE source , bool freeze , const pm_magic_comment_t * magic_comment ) {
504- VALUE key_loc = parser_location (parser , source , freeze , magic_comment -> key_start , magic_comment -> key_length );
505- VALUE value_loc = parser_location (parser , source , freeze , magic_comment -> value_start , magic_comment -> value_length );
504+ VALUE key_loc = parser_location (parser , source , freeze , magic_comment -> key . start , magic_comment -> key . length );
505+ VALUE value_loc = parser_location (parser , source , freeze , magic_comment -> value . start , magic_comment -> value . length );
506506 VALUE argv [] = { key_loc , value_loc };
507507 return rb_class_new_instance_freeze (2 , argv , rb_cPrismMagicComment , freeze );
508508}
0 commit comments