Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename built-in rules to be all lowercase #9

Open
tomtau opened this issue Jun 3, 2024 · 6 comments · May be fixed by #21
Open

Rename built-in rules to be all lowercase #9

tomtau opened this issue Jun 3, 2024 · 6 comments · May be fixed by #21
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tomtau
Copy link
Contributor

tomtau commented Jun 3, 2024

to make it consistent, since they are not separated by the pest:: module

@tomtau tomtau moved this to Todo in pest3 near-term Jun 3, 2024
@tomtau tomtau added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 3, 2024
@chriskrycho
Copy link

I’d be happy to do this. To make sure I don’t waste either of our time, though: these, and the others like them in this file?

pub type ASCII_DIGIT = CharRange<'0', '9'>;
/// Non-zero ASCII Digit. `'1'..'9'`
#[allow(non_camel_case_types)]
pub type ASCII_NONZERO_DIGIT = CharRange<'1', '9'>;
/// Binary ASCII Digit. `'0'..'1'`
#[allow(non_camel_case_types)]
pub type ASCII_BIN_DIGIT = CharRange<'0', '1'>;
/// Octal ASCII Digit. `'0'..'7'`
#[allow(non_camel_case_types)]
pub type ASCII_OCT_DIGIT = CharRange<'0', '7'>;
use crate::choice::{Choice2, Choice3};
/// Hexadecimal ASCII Digit. `'0'..'9' | 'a'..'f' | 'A'..'F'`
#[allow(non_camel_case_types)]
pub type ASCII_HEX_DIGIT = Choice3<ASCII_DIGIT, CharRange<'a', 'f'>, CharRange<'A', 'F'>>;
/// Lower case ASCII alphabet.
#[allow(non_camel_case_types)]
pub type ASCII_ALPHA_LOWER = CharRange<'a', 'z'>;
/// Upper case ASCII alphabet.
#[allow(non_camel_case_types)]
pub type ASCII_ALPHA_UPPER = CharRange<'A', 'Z'>;
/// ASCII alphabet.
#[allow(non_camel_case_types)]
pub type ASCII_ALPHA = Choice2<ASCII_ALPHA_LOWER, ASCII_ALPHA_UPPER>;
/// ASCII alphabet or digit.
#[allow(non_camel_case_types)]
pub type ASCII_ALPHANUMERIC = Choice2<ASCII_ALPHA, ASCII_DIGIT>;
/// ASCII alphabet.
#[allow(non_camel_case_types)]
pub type ASCII = CharRange<'\x00', '\x7f'>;

Or something somewhere else?

@tomtau
Copy link
Contributor Author

tomtau commented Jun 14, 2024

Yes, I think that. Off the top of my head, I'm not sure if other place needs patching (maybe somewhere in the generator @TheVeryDarkness ?) as well

@TheVeryDarkness
Copy link
Contributor

TheVeryDarkness commented Jun 14, 2024

@chriskrycho Yes, and you could also update the generated imports here:

Positive, Negative,
CharRange, Str, Insens,
Rep, RepOnce, RepMin, RepMax, RepMinMax,
SOI, EOI,
SOI as soi,
EOI as eoi,
ANY as any,
PEEK as peek,
PeekSlice1, PeekSlice2,
PEEK_ALL as peek_all,
DROP as drop,
PUSH as push,
POP as pop,
POP_ALL as pop_all,
ASCII_DIGIT as ascii_digit,
ASCII_NONZERO_DIGIT as ascii_nonzero_digit,
ASCII_BIN_DIGIT as ascii_bin_digit,
ASCII_OCT_DIGIT as ascii_oct_digit,
ASCII_HEX_DIGIT as ascii_hex_digit,
ASCII_ALPHA_LOWER as ascii_alpha_lower,
ASCII_ALPHA_UPPER as ascii_alpha_upper,
ASCII_ALPHA as ascii_alpha,
ASCII_ALPHANUMERIC as ascii_alphanumeric,
ASCII as ascii,
NEWLINE as newline,

Maybe you could also remove these two lines:

pest_builtin!(SOI {}),
pest_builtin!(EOI {}),

@tomtau
Copy link
Contributor Author

tomtau commented Jun 15, 2024

@chriskrycho plus adjusting the inline or .pest file tests and samples

@tomtau
Copy link
Contributor Author

tomtau commented Jul 9, 2024

@chriskrycho would it be ok if I assigned this issue to you?

@chriskrycho
Copy link

@tomtau feel free! I will carve out some time later this week or early next to knock it out. Have been enjoying Pest v2 for working on a small programming language… and also feeling very keenly the value that the new stuff in v3 would add!

tomtau added a commit that referenced this issue Oct 21, 2024
@tomtau tomtau linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants