Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[translation] Move TDOP spec to a different module.
Start plugging a C++ version in. Down to 6 errors.
- Loading branch information
Andy Chu
committed
Nov 20, 2019
1 parent
ebb1528
commit e1f994f
Showing
6 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Replacement for osh/arith_spec | ||
|
||
#ifndef ARITH_SPEC_H | ||
#define ARITH_SPEC_H | ||
|
||
namespace tdop { // forward declare | ||
class ParserSpec; | ||
} | ||
|
||
namespace arith_spec { | ||
|
||
tdop::ParserSpec* Spec(); | ||
|
||
} // arith_spec | ||
|
||
#endif // ARITH_SPEC_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,5 +175,3 @@ def MakeShellSpec(): | |
spec.Left(1, tdop.LeftBinaryOp, [Id.Arith_Comma]) | ||
|
||
return spec | ||
|
||
SPEC = MakeShellSpec() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python2 | ||
""" | ||
arith_spec.py | ||
""" | ||
from __future__ import print_function | ||
|
||
from osh import arith_parse | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from frontend.tdop import ParserSpec | ||
|
||
_SPEC = arith_parse.MakeShellSpec() | ||
|
||
def Spec(): | ||
# type: () -> ParserSpec | ||
return _SPEC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters