Skip to content

Instantly share code, notes, and snippets.

@Master-Poiku
Created May 5, 2018 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Master-Poiku/c2d46cef9dc0bfe1a5e9bf62a1aff535 to your computer and use it in GitHub Desktop.
Save Master-Poiku/c2d46cef9dc0bfe1a5e9bf62a1aff535 to your computer and use it in GitHub Desktop.
say "-- Ori docu";
my token non-space-y { 'once' 'upon' 'a' 'time' }
my rule space-y { 'once' 'upon' 'a' 'time' }
say so 'onceuponatime' ~~ &non-space-y; # OUTPUT: «True␤»
say so 'once upon a time' ~~ &non-space-y; # OUTPUT: «False␤»
say so 'onceuponatime' ~~ &space-y; # OUTPUT: «False␤»
say so 'once upon a time' ~~ &space-y; # OUTPUT: «True␤»
say "-- Differ to docu:";
my token non-space-x { 'a' ':=' '1' }
my rule space-x { 'a' ':=' '1' }
say so 'a:=1' ~~ &non-space-x; # OUTPUT: True
say so 'a := 1' ~~ &non-space-x; # OUTPUT: False
say so 'a:=1' ~~ &space-x; # OUTPUT: True <<<<<<<<<<<<< Why this line differ ?
say so 'a := 1' ~~ &space-x; # OUTPUT: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment