// pest. The Elegant Parser // Copyright (c) 2018 DragoČ™ Tiselice // // Licensed under the Apache License, Version 2.0 // or the MIT // license , at your // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. // Modified by Boyi Huang (@TheVeryDarkness) when upgrading to pest3. string = "abc" insensitive = i"abc" range = '0'..'9' ident = string pos_pred = &string neg_pred = !string double_neg_pred = !!string sequence_atomic = string - string sequence_optional_trivia = string ~ string sequence_mandatory_trivia = string ^ string sequence_nested = string ~ string sequence_compound_nested = sequence_nested choice = string | range choice_prefix = | string | range optional = string? repeat = string~* repeat_atomic = string* repeat_once = string~+ repeat_once_atomic = string+ repeat_min_max = string~{2..3} repeat_min_max_atomic = string{2..3} repeat_exact = string~{2} repeat_min = string~{2..} repeat_min_atomic = string{2..} repeat_max = string~{..2} repeat_max_atomic = string{..2} soi_at_start = pest::SOI - string repeat_mutate_stack = (pest::stack::push('a'..'c') - ",")* - pest::stack::pop - pest::stack::pop - pest::stack::pop repeat_mutate_stack_pop_all = (pest::stack::push('a'..'c') - ",")* - pest::stack::pop_all will_fail = repeat_mutate_stack_pop_all - "FAIL" stack_resume_after_fail = will_fail | repeat_mutate_stack_pop_all peek_ = pest::stack::push(range) - pest::stack::push(range) - pest::stack::peek - pest::stack::peek peek_all = pest::stack::push(range) - pest::stack::push(range) - pest::stack::peek_all peek_slice_23 = pest::stack::push(range) - pest::stack::push(range) - pest::stack::push(range) ~ pest::stack::push(range) ~ pest::stack::push(range) ~ pest::stack::peek[1..-2] pop_ = pest::stack::push(range) - pest::stack::push(range) - pest::stack::pop - pest::stack::pop pop_all = pest::stack::push(range) - pest::stack::push(range) - pest::stack::pop_all pop_fail = pest::stack::push(range) - !pest::stack::pop - range - pest::stack::pop checkpoint_restore = pest::stack::push("") - (pest::stack::push("a") - "b" - pest::stack::pop | pest::stack::drop - "b" | pest::stack::pop - "a") - pest::EOI /* ascii_digits = ASCII_DIGIT+ ascii_nonzero_digits = ASCII_NONZERO_DIGIT+ ascii_bin_digits = ASCII_BIN_DIGIT+ ascii_oct_digits = ASCII_OCT_DIGIT+ ascii_hex_digits = ASCII_HEX_DIGIT+ ascii_alpha_lowers = ASCII_ALPHA_LOWER+ ascii_alpha_uppers = ASCII_ALPHA_UPPER+ ascii_alphas = ASCII_ALPHA+ ascii_alphanumerics = ASCII_ALPHANUMERIC+ asciis = ASCII+ newline = NEWLINE+ unicode = XID_START - XID_CONTINUE* SYMBOL = "shadows builtin" han = HAN+ hangul = HANGUL+ hiragana = HIRAGANA+ arabic = ARABIC+ emoji = EMOJI+ */ ~ = (" " | "$")* ^ = (" " | "$")+ // Line comment /* 1-line multiline comment */ /* N-line multiline comment */ /* // Line comment inside multiline /* (Multiline inside) multiline */ Invalid segment of grammar below (repeated rule) WHITESPACE = _"hi" */