We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ba26c4 commit 34c8ef6Copy full SHA for 34c8ef6
1 file changed
sifter/parser.py
@@ -1,5 +1,6 @@
1
from typing import (
2
cast,
3
+ Text,
4
TextIO
5
)
6
@@ -13,4 +14,9 @@
13
14
15
16
def parse_file(filehandle: TextIO) -> CommandList:
- return cast(CommandList, grammar.parser().parse(filehandle.read(), lexer=lexer.lexer()))
17
+ return parse_string(filehandle.read())
18
+
19
20
+def parse_string(rules: Text) -> CommandList:
21
+ r_value = grammar.parser().parse(rules, lexer=lexer.lexer())
22
+ return cast(CommandList, r_value)
0 commit comments