File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -123,15 +123,15 @@ func (p *Parser) Parse() []Command {
123
123
p .nextToken ()
124
124
continue
125
125
}
126
- cmds = append (cmds , p .parseCommand ())
126
+ cmds = append (cmds , p .parseCommand (cmds ))
127
127
p .nextToken ()
128
128
}
129
129
130
130
return cmds
131
131
}
132
132
133
133
// parseCommand parses a command.
134
- func (p * Parser ) parseCommand () Command {
134
+ func (p * Parser ) parseCommand (cmds [] Command ) Command {
135
135
switch p .cur .Type {
136
136
case token .SPACE ,
137
137
token .BACKSPACE ,
@@ -170,7 +170,7 @@ func (p *Parser) parseCommand() Command {
170
170
case token .WAIT :
171
171
return p .parseWait ()
172
172
case token .SOURCE :
173
- return p .parseSource ()
173
+ return p .parseSource (cmds )
174
174
case token .SCREENSHOT :
175
175
return p .parseScreenshot ()
176
176
case token .COPY :
@@ -652,7 +652,7 @@ func (p *Parser) parseEnv() Command {
652
652
// Source command takes a tape path to include in current tape.
653
653
//
654
654
// Source <path>
655
- func (p * Parser ) parseSource () Command {
655
+ func (p * Parser ) parseSource (cmds [] Command ) Command {
656
656
cmd := Command {Type : token .SOURCE }
657
657
658
658
if p .peek .Type != token .STRING {
@@ -718,6 +718,10 @@ func (p *Parser) parseSource() Command {
718
718
return cmd
719
719
}
720
720
721
+
722
+ for _ , cmd := range srcCmds {
723
+ cmds = append (cmds , cmd )
724
+ }
721
725
cmd .Args = p .peek .Literal
722
726
p .nextToken ()
723
727
return cmd
You can’t perform that action at this time.
0 commit comments