Agents/ascii piet interpreter commands#12
Merged
Conversation
Adds optional 'language: LanguageType.PietPlusPlus' parameter to [GeneratePietMethod] attribute (mirrors codelSize), and full runtime support for the Piet++ esolang extension. Changes: - Parser: add LanguageType enum, PietPlusPlusColor helper, and TryParse overload that maps pixels to Piet++ colors - Processor: add PietPlusPlusExecutor with correct command table (cmd = DG*16 + DR*4 + DB), stack-of-stacks semantics, and all 32 Piet++ commands; PietProcessor routes to it when language == LanguageType.PietPlusPlus - Generator: emit LanguageType enum in the generated attribute type so callers can write 'language: LanguageType.PietPlusPlus'; read language from attribute arg[2]; dispatch to ScanPietPlusPlusIoCommands and PietPlusPlusRuntime in EmitBody; generate PietPlusPlusRuntime.g.cs (sync, async, enumerable, async- enumerable variants) when needed All 464 existing tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a new ascii-piet2 text encoding for Piet++ programs (analogous to ascii-piet for standard Piet), with full parser, formatter, PietParser integration, and Generator MIME type support. Character mapping (64 Piet++ color indices): ' ' → 0 (Black) '0'-'9' → 1-10 'a'-'z' → 11-36 'A'-'Z' → 37-62 '~' → 63 (White) '|' → end-of-line marker (actual \r\n are ignored) New files: - Parser/AsciiPietPlusPlusParser.cs — TryParse / Parse with codelSize and LooksLikeAsciiPietPlusPlus auto-detection - Parser/AsciiPietPlusPlusFormatter.cs — Format(PietProgram) → string - Parser.Tests/AsciiPietPlusPlusParserTests.cs — parser and formatter tests Updated: - Parser/PietParser.cs — TryParse(language: PietPlusPlus) now routes .txt2 / .ascii-piet2 extensions to AsciiPietPlusPlusParser and falls back to auto-detection before image parsing - Generator/MethodGenerator.cs — TryResolveImagePath recognises MIME types text/ascii-piet2 and text/ascii-piet-plus-plus → .txt2 All 521 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Generator MIME: text/ascii-piet2 -> .appp, text/ascii-piet -> .ap - Add text/ascii-piet++ and text/appp MIME aliases for ascii-piet++ format - Update doc comments in AsciiPietPlusPlusParser/Formatter: ascii-piet2 -> ascii-piet++ - Update test comments to reflect ascii-piet++ naming Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ormatters Both AsciiPietFormatter and AsciiPietPlusPlusFormatter now omit trailing Black (index 0 / PietColor.Black) codels at the end of each row, producing irregular- width output consistent with the parser's padding-on-read behaviour. - AsciiPietPlusPlusFormatter: skip trailing ' ' chars; all-Black row emits just '|' - AsciiPietFormatter: use EOL char variant on last non-Black codel; all-Black row emits '@' (Black EndOfLine) - Added 7 new tests covering trimming, all-Black rows, and round-trip behaviour Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ribute args Roslyn includes default parameter values in ConstructorArguments, so the default LanguageType.Piet (0) always overrode the header-based PietPlusPlus detection from the .piet.txt PIET_LANGUAGE comment. Fix: only override language from attribute arg when the value is non-default (non-Piet), i.e. langVal != 0. This ensures that header-based language detection (PIET_LANGUAGE=PietPlusPlus) takes effect when no explicit non-default language is specified in the attribute. Also: - Fix InternalsVisibleTo assembly name (Piet.Generator.Tests) - Add TryGetLanguageInt internal helper for testability - Add dot.appp sample and conformance vector test - Add diagnostic tests for TryGetLanguageInt and explicit language attribute Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s/piet-plus-plus-support-implementation
…f nupkg and snupkg uploads
…scii-piet++ support - Add dotnet-piet colors command to display ascii-piet color table - Add dotnet-piet colors --piet-plus-plus for ascii-piet++ color table - Add --piet-plus-plus flag to parse command and root command - Support .appp/.txt2 extension auto-detection in PietParser.TryParse/Parse - Add 8 integration tests covering new commands and flags Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Version: 2.0.1 - FileVersion: 2.0.1.7 (incremented build number) - AssemblyVersion: 2.0.0.0 (unchanged, major-only policy) - CHANGELOG: move [Unreleased] to [2.0.1] with Piet++ and interpreter additions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.