simon-git: bob (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun May 21 21:39:42 BST 2017
TL;DR:
ba85414 Separate script parsing from script execution.
8f1abe0 Improve error handling for nonsense delegate host types.
e7f575b Support multi-line control structures.
Repository: https://git.tartarus.org/simon/bob.git
On the web: https://git.tartarus.org/?p=simon/bob.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2017-05-21 21:39:42
commit ba8541487fdab666b2e4bb5ae9998b1b9ef292f8
web diff https://git.tartarus.org/?p=simon/bob.git;a=commitdiff;h=ba8541487fdab666b2e4bb5ae9998b1b9ef292f8;hp=99cf3770164f4ac42d44113a56178bf78a857cfa
Author: Simon Tatham <anakin at pobox.com>
Date: Sun May 21 09:28:19 2017 +0100
Separate script parsing from script execution.
What was previously a combined function to parse and run a line of a
build script is now just the parse function; it still contains a lot
of the code to do the actual running of commands, but now it returns
that code in the form of a list of Python functions to be run later.
This involves major restructuring. lexer.py and script.py have both
been removed, and in their place is parse.py and execute.py, which
approximately correspond to compile time and run time. That's not
quite accurate, because parse.py still contains a lot of runtime code
inside the functions it returns; but execute.py contains all the code
that maintains runtime _state_, both in the form of the current set of
variables (all the functions like get_multicharvar previously in
lexer.py) and the current state of delegation (previously in
script.py). Meanwhile, the actual _lexing_ part of lexer.py has moved
into parse.py, because now there doesn't seem much point in having a
module boundary between them any more.
There should be no functional change from this refactoring yet. It's
intended to allow me to introduce multi-line control structures later,
because those require a parse/execute separation so that you can parse
every sub-block (including further sub-blocks nested inside it) to
find its end, without also executing it if it's an untaken branch.
bob | 33 ++--
bob-delegate-server | 29 +--
checkout.py | 53 +++---
execute.py | 247 ++++++++++++++++++++++++
lexer.py | 227 ----------------------
log.py | 7 +-
parse.py | 531 ++++++++++++++++++++++++++++++++++++++++++++++++++++
script.py | 431 ------------------------------------------
8 files changed, 844 insertions(+), 714 deletions(-)
commit 8f1abe066f22eb7b191c755197cf8aab181f702f
web diff https://git.tartarus.org/?p=simon/bob.git;a=commitdiff;h=8f1abe066f22eb7b191c755197cf8aab181f702f;hp=ba8541487fdab666b2e4bb5ae9998b1b9ef292f8
Author: Simon Tatham <anakin at pobox.com>
Date: Sun May 21 17:03:21 2017 +0100
Improve error handling for nonsense delegate host types.
The test of 'host' not being set should be moved inside the clause
that actually needs it to be set, _and_ should check for None as well
as "". (Or possibly instead of, but this is safest in the absence of a
proper understanding of that code, ahem.)
execute.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit e7f575bb93fceba06c840c6cf2c85b0005f87a64
web diff https://git.tartarus.org/?p=simon/bob.git;a=commitdiff;h=e7f575bb93fceba06c840c6cf2c85b0005f87a64;hp=8f1abe066f22eb7b191c755197cf8aab181f702f
Author: Simon Tatham <anakin at pobox.com>
Date: Sun May 21 17:05:49 2017 +0100
Support multi-line control structures.
We maintain a parse stack showing the things currently nested inside
each other, and vary which array we append each statement parsed to as
we push and pop that stack.
This change also enforces that delegate/enddelegate is treated as a
block-structured pair of control statements, so you can't interleave
them with if/else in twisty ways - meaning that it's always possible
to statically determine whether a delegation is active, so the error
checks should work again.
parse.py | 160 +++++++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 105 insertions(+), 55 deletions(-)
More information about the tartarus-commits
mailing list