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