Permalink
Browse files
Make 'typeset' a synonym for 'declare' for now.
- Loading branch information...
Showing
with
5 additions
and
2 deletions.
-
+2
−1
core/cmd_exec.py
-
+1
−1
core/id_kind.py
-
+1
−0
osh/lex.py
-
+1
−0
osh/osh.asdl
|
|
@@ -672,7 +672,8 @@ def _Dispatch(self, node, fork_external): |
|
|
if node.keyword == Id.Assign_Local:
|
|
|
lookup_mode = scope.LocalOnly
|
|
|
flags = ()
|
|
|
elif node.keyword == Id.Assign_Declare:
|
|
|
# typeset and declare are synonyms? I see typeset -a a=() the most.
|
|
|
elif node.keyword in (Id.Assign_Declare, Id.Assign_Typeset):
|
|
|
# declare is like local, except it can also be used outside functions?
|
|
|
lookup_mode = scope.LocalOnly
|
|
|
# TODO: Respect flags. -r and -x matter, but -a and -A might be
|
|
|
|
|
|
@@ -366,7 +366,7 @@ def _AddKinds(spec): |
|
|
# "None" could either be a global variable or assignment to a local.
|
|
|
# NOTE: We're not parsing export here. Although it sets a global variable,
|
|
|
# and has the same syntax, too many scripts use it in a dynamic fashion.
|
|
|
spec.AddKind('Assign', ['Declare', 'Local', 'Readonly', 'None'])
|
|
|
spec.AddKind('Assign', ['Declare', 'Typeset', 'Local', 'Readonly', 'None'])
|
|
|
|
|
|
# Unlike bash, we parse control flow statically. They're not
|
|
|
# dynamically-resolved builtins.
|
|
|
|
|
|
@@ -187,6 +187,7 @@ |
|
|
# main compatibility with bash for the 'type' builtin.
|
|
|
_MORE_KEYWORDS = [
|
|
|
C('declare', Id.Assign_Declare),
|
|
|
C('typeset', Id.Assign_Typeset),
|
|
|
C('local', Id.Assign_Local),
|
|
|
C('readonly', Id.Assign_Readonly),
|
|
|
|
|
|
|
|
|
@@ -14,6 +14,7 @@ |
|
|
-- * select block
|
|
|
-- * &> redirect both stdout and stderr
|
|
|
-- * 1>&2- to close redirect
|
|
|
-- * case fallthrough ;& and ;;&
|
|
|
|
|
|
-- Represented but Not Parsed:
|
|
|
-- * LeftIndex -- LHS of assignment
|
|
|
|
0 comments on commit
08622d4