Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit361d261

Browse files
committed
Fix#31
1 parent04d769a commit361d261

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎pyformlang/cfg/cfg.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,16 +1081,16 @@ def _read_line(cls, line, productions, terminals, variables):
10811081
body_component=body_component[5:-1]
10821082
else:
10831083
type_component=""
1084-
ifbody_component[0]instring.ascii_uppercaseor \
1084+
ifbody_componentnotinEPSILON_SYMBOLSortype_component \
1085+
=="TER":
1086+
body_ter=Terminal(body_component)
1087+
terminals.add(body_ter)
1088+
body.append(body_ter)
1089+
elifbody_component[0]instring.ascii_uppercaseor \
10851090
type_component=="VAR":
10861091
body_var=Variable(body_component)
10871092
variables.add(body_var)
10881093
body.append(body_var)
1089-
elifbody_componentnotinEPSILON_SYMBOLSortype_component \
1090-
=="TER":
1091-
body_ter=Terminal(body_component)
1092-
terminals.add(body_ter)
1093-
body.append(body_ter)
10941094
productions.add(Production(head,body))
10951095

10961096
defis_normal_form(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp