Browse Source

renamed `source_code` -> `source_grammar`

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.0
MegaIng1 4 years ago
parent
commit
5f7a5d428a
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      lark-stubs/lark.pyi
  2. +1
    -1
      lark/lark.py

+ 2
- 2
lark-stubs/lark.pyi View File

@@ -50,7 +50,7 @@ class FromPackageLoader:

class Lark:
source_path: str
source_code: str
source_grammar: str
options: LarkOptions
lexer: Lexer
terminals: List[TerminalDef]
@@ -75,7 +75,7 @@ class Lark:
g_regex_flags: int = ...,
use_bytes: bool = False,
import_paths: List[Union[str, Callable[[Union[None, str, PackageResource], str], Tuple[str, str]]]] = ...,
source_path: Optional[str],
source_path: Optional[str]=None,
):
...



+ 1
- 1
lark/lark.py View File

@@ -213,7 +213,7 @@ class Lark(Serialize):
grammar = read()

assert isinstance(grammar, STRING_TYPE)
self.source_code = grammar
self.source_grammar = grammar
if self.options.use_bytes:
if not isascii(grammar):
raise ValueError("Grammar must be ascii only, when use_bytes=True")


Loading…
Cancel
Save