npc

nanohard parser compiler
git clone git://git.kocotian.pl/npc.git
Log | Files | Refs

commit f3aa4973ba06aca983e959d3154d430c02e1f194
parent 6178541d4c140ac14f3b109e104efe7d3290137b
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri,  9 Apr 2021 23:04:55 +0200

Prettier functions in npc syntax

Diffstat:
Mnpc.npc | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/npc.npc b/npc.npc @@ -2,11 +2,11 @@ ;; >>> Functions <<< -define function char(c) => condition: $ichr == c; -define function charFrom(c) => condition: $ichr >= c; -define function charTo(c) => condition: $ichr <= c; -define function charAny() => condition: $ichr; -define function charBetween(c1, c2) => condition: @charFrom(c1) && @charTo(c2); +define function char(c) => ($ichr == c); +define function charFrom(c) => ($ichr >= c); +define function charTo(c) => ($ichr <= c); +define function charAny() => ($ichr); +define function charBetween(c1, c2) => (@charFrom(c1) && @charTo(c2)); ;; >>> Tokens <<<