Lines Matching +full:rules +full:- +full:anchors
3 # STREAM-START
4 # STREAM-END
6 # DOCUMENT-START
7 # DOCUMENT-END
8 # BLOCK-SEQUENCE-START
9 # BLOCK-MAPPING-START
10 # BLOCK-END
11 # FLOW-SEQUENCE-START
12 # FLOW-MAPPING-START
13 # FLOW-SEQUENCE-END
14 # FLOW-MAPPING-END
15 # BLOCK-ENTRY
16 # FLOW-ENTRY
55 # self.peek(i=0) # peek the next i-th character
69 # Add the STREAM-START token.
76 self.indent = -1
85 # ---
95 # - at the beginning of the line, not counting indentation spaces
97 # - after '{', '[', ',' (in the flow context),
98 # - after '?', ':', '-' (in the block context).
180 if ch == '-' and self.check_document_start():
189 # return self.fetch_bom() <-- issue BOMToken
214 if ch == '-' and self.check_block_entry():
282 # - should be limited to a single line,
283 # - should be no longer than 1024 characters.
289 or self.index-key.index > 1024:
343 # In block context, we may need to issue the BLOCK-END tokens.
360 # We always add STREAM-START as the first token and STREAM-END as the
366 # Add STREAM-START.
373 # Set the current indentation to -1.
374 self.unwind_indent(-1)
384 # Add STREAM-END.
392 # Set the current indentation to -1.
393 self.unwind_indent(-1)
410 # Set the current indentation to -1.
411 self.unwind_indent(-1)
414 # after '---'.
418 # Add DOCUMENT-START or DOCUMENT-END.
441 # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START.
459 self.flow_level -= 1
464 # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END.
478 # Add FLOW-ENTRY.
495 # We may need to add BLOCK-SEQUENCE-START.
505 # Simple keys are allowed after '-'.
511 # Add BLOCK-ENTRY.
528 # We may need to add BLOCK-MAPPING-START.
553 self.tokens.insert(key.token_number-self.tokens_taken,
557 # BLOCK-MAPPING-START.
560 self.tokens.insert(key.token_number-self.tokens_taken,
582 # BLOCK-MAPPING-START. It will be detected as an error later by
692 # DOCUMENT-START: ^ '---' (' '|'\n')
694 if self.prefix(3) == '---' \
700 # DOCUMENT-END: ^ '...' (' '|'\n')
708 # BLOCK-ENTRY: '-' (' '|'\n')
733 # A plain scalar may start with any non-space character except:
734 # '-', '?', ':', ',', '[', ']', '{', '}',
739 # '-', '?', ':'
740 # if it is followed by a non-space character.
743 # '-' character) because we want the flow context to be space
746 return ch not in '\0 \t\r\n\x85\u2028\u2029-?:,[]{}#&*!|>\'\"%@`' \
748 and (ch == '-' or (not self.flow_level and ch in '?:')))
761 # TODO: We need to make tab handling rules more sane. A good rule is
763 # BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END,
764 # KEY(block), VALUE(block), BLOCK-ENTRY
769 # `unwind_indent` before issuing BLOCK-END.
811 or ch in '-_':
900 # The specification does not restrict characters for anchors and
918 or ch in '-_':
992 # Determine the indentation level and go to the first non-empty line.
1000 indent = min_indent+increment-1
1017 # Unfortunately, folding rules are ambiguous.
1057 if ch in '+-':
1068 "expected indentation indicator in the range 1-9, but found 0",
1075 "expected indentation indicator in the range 1-9, but found 0",
1079 if ch in '+-':
1136 # Note that we loose indentation rules for quoted scalars. Quoted
1213 raise ScannerError("while scanning a double-quoted scalar", start_mark,
1223 raise ScannerError("while scanning a double-quoted scalar", start_mark,
1259 if (prefix == '---' or prefix == '...') \
1275 # Indentation rules are loosed for the flow context.
1326 if (prefix == '---' or prefix == '...') \
1336 if (prefix == '---' or prefix == '...') \
1360 or ch in '-_':
1374 # Note: we do not check if URI is well-formed.
1379 or ch in '-;/?:@&=+$,_.!~*\'()[]%':
1411 value = bytes(codes).decode('utf-8')