Skip to content

Improve parsing/storage of warrior metadata #38

@ian-h-chamberlain

Description

@ian-h-chamberlain

It seems to be common practice to describe warrior strategy on multiple lines, e.g.

;redcode-94
;name Blur 2
;author Anton Marsden
;assert CORESIZE==8000
;strategy 0.5c scan, 0.25c SPL carpet -> DAT/DJN clear
;strategy Final version (for a while)
;kill Blur

This should be supported for all fields that may span multiple lines, which is probably really just strategy.


Various redcode standards exist in different warriors, e.g. recode-88, redcode-koth, plain ;redcode, etc. These should be handled and preserved by the metadata parser as well.


The kill directive seems to be koth specific, most likely to "obsolete" or replace an existing warrior? Up for debate whether this needs support. Preserving it is probably good though.


pMARS appears to support some debug directives:

;trace [off]            (*) toggle trace bit for following instructions
;break                  (*) set trace bit for next instruction
;debug [static|off]     (*) enable/disable setting [static] trace bits

Even if not implemented yet, these should probably be stored in the metadata and preserved in a load file.


Side note: Benj'sRevenge.red has an interesting question which appears to use the second name directive

;name Benj's Revenge 1.0
...
; Name obvious to those who know my son :-)
; (oops -- classic "Name" bug, but I like the new one too:)

It seems like, then, the canonical implementation uses the second one. What this means is probably that the TextMate grammar for syntax highlighting should also highlight the second one (use whitespace), and the metadata parser should warn for this kind of "bug" as the comment references.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions