Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bare-bones
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin
bare-bones
Commits
61b7fc5e
Verified
Commit
61b7fc5e
authored
8 months ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
fix subtle bug where a line was skipped after every block
parent
820a28b7
Branches
JulioWithHashTable
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bare.sh
+4
-2
4 additions, 2 deletions
bare.sh
example.bb
+10
-0
10 additions, 0 deletions
example.bb
example2.bb
+25
-0
25 additions, 0 deletions
example2.bb
with
39 additions
and
2 deletions
bare.sh
+
4
−
2
View file @
61b7fc5e
...
...
@@ -497,7 +497,6 @@ read_block() {
# Check if we can exit the block
if
[
"
$depth
"
-lt
0
]
;
then
next_line
# consume "end;"
interpreter_debug
"Finished block section, consuming target '
$pattern
'"
return
0
elif
[
"
$depth
"
-le
0
]
&&
echo
"
$block_line
"
|
grep
"
$pattern
"
>
/dev/null
;
then
# Don't consume custom targets
...
...
@@ -553,6 +552,7 @@ interpret() {
while
test_predicate
"
$predicate
"
;
do
call_self
"
$path
"
done
interpret
&&
return
;;
"if "
*
)
path
=
"
$(
get_block_name
"if"
)
"
...
...
@@ -582,11 +582,13 @@ interpret() {
done
# Delete last generated executable if it's blank
[
-z
"
$(
cat
"
$path
"
)
"
]
&&
rm
"
$path
"
interpret
&&
return
;;
"function "
*
)
name
=
"
$(
echo
"
$line
"
| trim_line |
sed
's/function \(.*\) do/\1/'
)
"
[
-z
"
$name
"
]
&&
interpreter_die
"Invalid function name '
$name
'"
read_block
>
"
$FULL_PATH
/
$name
.
$EXTENSION
"
interpret
&&
return
;;
"set "
*
)
set_var
"
$(
echo
"
$line
"
| nth_arg 2
)
"
"
$(
evaluate_format
"
$(
echo
"
$line
"
| nth_arg 3-
)
"
)
"
...
...
@@ -614,7 +616,7 @@ interpret() {
# Start
if
[
"
$TIME_EXECUTION
"
-eq
0
]
;
then
interpret
debug
"Done"
interpreter_
debug
"Done"
else
start
=
"
$(
get_millis
)
"
interpret
...
...
This diff is collapsed.
Click to expand it.
example.bb
0 → 100644
+
10
−
0
View file @
61b7fc5e
clear X;
incr X;
incr X;
incr X;
while X not 0 do;
decr X;
end;
debug X;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
example2.bb
0 → 100644
+
25
−
0
View file @
61b7fc5e
clear X;
incr X;
incr X;
clear Y;
incr Y;
incr Y;
incr Y;
clear Z;
while X not 0 do;
clear W;
while Y not 0 do;
incr Z;
incr W;
decr Y;
end;
while W not 0 do;
incr Y;
decr W;
end;
decr X;
end;
debug X;
debug Y;
debug Z;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment