-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to #FOREACH for the 'POKEname' special variable
- Loading branch information
Showing
6 changed files
with
111 additions
and
8 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright 2008-2023 Richard Dymond ([email protected]) | ||
# Copyright 2008-2024 Richard Dymond ([email protected]) | ||
# | ||
# This file is part of SkoolKit. | ||
# | ||
|
@@ -14,6 +14,7 @@ | |
# You should have received a copy of the GNU General Public License along with | ||
# SkoolKit. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from collections import defaultdict | ||
import re | ||
|
||
from skoolkit import (CASE_LOWER, skoolmacro, SkoolKitError, SkoolParsingError, | ||
|
@@ -95,6 +96,7 @@ def __init__(self, parser, properties, templates, config): | |
|
||
self.snapshot = self.parser.snapshot | ||
self._snapshots = [(self.snapshot, '')] | ||
self.pokes = defaultdict(list) | ||
|
||
self.list_parser = ListParser(properties.get('bullet', '*')) | ||
|
||
|
@@ -227,6 +229,10 @@ def push_snapshot(self, name=''): | |
:param name: An optional name for the snapshot. | ||
""" | ||
self._snapshots.append((self.snapshot.copy(), name)) | ||
self.pokes[name].clear() | ||
|
||
def save_pokes(self, addr, byte, length, step): | ||
self.pokes[self._snapshots[-1][1]].append((addr, byte, length, step)) | ||
|
||
def expand_audio(self, text, index): | ||
if self.handle_unsupported_macros: | ||
|
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
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