@@ -291,7 +291,6 @@ typedef struct yp_scope {
291
291
// it's considering.
292
292
struct yp_parser {
293
293
yp_lex_state_t lex_state ; // the current state of the lexer
294
- bool command_start ; // whether or not we're at the beginning of a command
295
294
int enclosure_nesting ; // tracks the current nesting of (), [], and {}
296
295
297
296
// Used to temporarily track the nesting of enclosures to determine if a {
@@ -338,17 +337,11 @@ struct yp_parser {
338
337
yp_scope_t * current_scope ; // the current local scope
339
338
340
339
yp_context_node_t * current_context ; // the current parsing context
341
- bool recovering ; // whether or not we're currently recovering from a syntax error
342
340
343
341
// The encoding functions for the current file is attached to the parser as
344
342
// it's parsing so that it can change with a magic comment.
345
343
yp_encoding_t encoding ;
346
344
347
- // Whether or not the encoding has been changed by a magic comment. We use
348
- // this to provide a fast path for the lexer instead of going through the
349
- // function pointer.
350
- bool encoding_changed ;
351
-
352
345
// When the encoding that is being used to parse the source is changed by
353
346
// YARP, we provide the ability here to call out to a user-defined function.
354
347
yp_encoding_changed_callback_t encoding_changed_callback ;
@@ -367,13 +360,6 @@ struct yp_parser {
367
360
// be called whenever a new token is lexed by the parser.
368
361
yp_lex_callback_t * lex_callback ;
369
362
370
- // This flag indicates that we are currently parsing a pattern matching
371
- // expression and impacts that calculation of newlines.
372
- bool pattern_matching_newlines ;
373
-
374
- // This flag indicates that we are currently parsing a keyword argument.
375
- bool in_keyword_arg ;
376
-
377
363
// This is the path of the file being parsed
378
364
// We use the filepath when constructing SourceFileNodes
379
365
yp_string_t filepath_string ;
@@ -390,6 +376,24 @@ struct yp_parser {
390
376
// communicate this information. So we store it here and pass it through
391
377
// when we find tokens that we need it for.
392
378
yp_node_flags_t integer_base ;
379
+
380
+ // Whether or not we're at the beginning of a command
381
+ unsigned int command_start : 1 ;
382
+
383
+ // Whether or not we're currently recovering from a syntax error
384
+ unsigned int recovering : 1 ;
385
+
386
+ // Whether or not the encoding has been changed by a magic comment. We use
387
+ // this to provide a fast path for the lexer instead of going through the
388
+ // function pointer.
389
+ unsigned int encoding_changed : 1 ;
390
+
391
+ // This flag indicates that we are currently parsing a pattern matching
392
+ // expression and impacts that calculation of newlines.
393
+ unsigned int pattern_matching_newlines : 1 ;
394
+
395
+ // This flag indicates that we are currently parsing a keyword argument.
396
+ unsigned int in_keyword_arg : 1 ;
393
397
};
394
398
395
399
#endif // YARP_PARSER_H
0 commit comments