Skip to content
This repository
Browse code

add the JSON values "true" and "false"

  • Loading branch information...
commit 0cf3ffac966827f06b75ea99b5725ae269af1765 1 parent 872e2cc
Gerd Pokorra authored

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 compilers/data_json/JSON.nqp
12 compilers/data_json/JSON.nqp
@@ -66,6 +66,14 @@ grammar JSON::Grammar is HLL::Grammar {
66 66 '}'
67 67 }
68 68
  69 + rule value:sym<true> {
  70 + 'true'
  71 + }
  72 +
  73 + rule value:sym<false> {
  74 + 'false'
  75 + }
  76 +
69 77 token string {
70 78 <?["]> <quote_EXPR: ':qq'>
71 79 }
@@ -108,6 +116,10 @@ class JSON::Actions is HLL::Actions {
108 116 make $past;
109 117 }
110 118
  119 + method value:sym<true>($/) { make 1; }
  120 +
  121 + method value:sym<false>($/) { make 0; }
  122 +
111 123 method string($/) { make $<quote_EXPR>.ast; }
112 124 }
113 125

0 comments on commit 0cf3ffa

Please sign in to comment.
Something went wrong with that request. Please try again.