From 3143e53c8a2d6b5b0ec4150b291e33005dd4704d Mon Sep 17 00:00:00 2001 From: Michael Specht Date: Fri, 16 Feb 2018 15:24:02 +0100 Subject: [PATCH] Comment out champ directives with a ; => @;Au --- README.md | 8 ++++++++ champ.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 07f9492..a372c53 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,14 @@ This will plot FOO against X: ![FOO against A at PC 0x6015](doc/example03_3.gif?raw=true) +### Disabling watches + +To disable a watch, add a `;` right behind the `@`: + +``` + ADC FOO ; @;Au(post) +``` + ## Did you know? By the way, there's a full-fledged, incremental, standalone, no-dependencies GIF encoder in [pgif.c](pgif.c) that writes animated GIFs and uses some optimizations to further minimize space. It's stream-friendly and as you feed pixels in via `stdin`, it dutifully writes GIF data to `stdout` until `stdin` gets closed. diff --git a/champ.rb b/champ.rb index 6618b7d..ac47b6f 100755 --- a/champ.rb +++ b/champ.rb @@ -631,7 +631,7 @@ class Champ champ_directives = [] if code.include?(';') comment = code[code.index(';') + 1, code.size].strip - comment.scan(/@[^\s]+/).each do |match| + comment.scan(/@[^;][^\s]+/).each do |match| champ_directives << match.to_s end end