diff options
author | ptmcg <ptmcg@austin.rr.com> | 2022-06-16 07:39:35 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2022-06-16 07:39:35 -0500 |
commit | 6dcf9aad746d0f3ca873fa1c023f36819bf0b6df (patch) | |
tree | bfede886d757be277118fb8bcfa6fc887b93e87b /pyparsing/core.py | |
parent | 9c39a15cb42486bbbee828268d80cef3fe362df3 (diff) | |
download | pyparsing-git-6dcf9aad746d0f3ca873fa1c023f36819bf0b6df.tar.gz |
Clean up docstrings to use new PEP8 names instead of old camelCase names
Diffstat (limited to 'pyparsing/core.py')
-rw-r--r-- | pyparsing/core.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py index 861548b..d35923f 100644 --- a/pyparsing/core.py +++ b/pyparsing/core.py @@ -485,7 +485,7 @@ class ParserElement(ABC): base.suppress_warning(Diagnostics.warn_on_parse_using_empty_Forward) # statement would normally raise a warning, but is now suppressed - print(base.parseString("x")) + print(base.parse_string("x")) """ self.suppress_warnings_.append(warning_type) @@ -2368,7 +2368,7 @@ class Keyword(Token): Accepts two optional constructor arguments in addition to the keyword string: - - ``identChars`` is a string of characters that would be valid + - ``ident_chars`` is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - ``caseless`` allows case-insensitive matching, default is ``False``. @@ -3028,10 +3028,10 @@ class Regex(Token): # prints "<h1>main title</h1>" """ if self.asGroupList: - raise TypeError("cannot use sub() with Regex(asGroupList=True)") + raise TypeError("cannot use sub() with Regex(as_group_list=True)") if self.asMatch and callable(repl): - raise TypeError("cannot use sub() with a callable with Regex(asMatch=True)") + raise TypeError("cannot use sub() with a callable with Regex(as_match=True)") if self.asMatch: @@ -3124,7 +3124,7 @@ class QuotedString(Token): else: endQuoteChar = endQuoteChar.strip() if not endQuoteChar: - raise ValueError("endQuoteChar cannot be the empty string") + raise ValueError("end_quote_char cannot be the empty string") self.quoteChar = quote_char self.quoteCharLen = len(quote_char) @@ -3441,7 +3441,7 @@ class LineStart(PositionToken): B AAA and definitely not this one ''' - for t in (LineStart() + 'AAA' + restOfLine).search_string(test): + for t in (LineStart() + 'AAA' + rest_of_line).search_string(test): print(t) prints:: @@ -4531,7 +4531,7 @@ class AtLineStart(ParseElementEnhance): B AAA and definitely not this one ''' - for t in (AtLineStart('AAA') + restOfLine).search_string(test): + for t in (AtLineStart('AAA') + rest_of_line).search_string(test): print(t) prints:: @@ -5787,7 +5787,7 @@ sgl_quoted_string = Combine( quoted_string = Combine( Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*') + '"' | Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*") + "'" -).set_name("quotedString using single or double quotes") +).set_name("quoted string using single or double quotes") unicode_string = Combine("u" + quoted_string.copy()).set_name("unicode string literal") |