File tree 3 files changed +34
-2
lines changed
3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ period: DATETIME "/" DATETIME
109
109
110
110
envelope : " ENVELOPE" " (" number number number number " )"
111
111
112
- BOOLEAN : ( " TRUE" | " FALSE" )
112
+ BOOLEAN . 2 : ( " TRUE" i | " FALSE" i )
113
113
114
114
DOUBLE_QUOTED : " \" " / . *? / " \" "
115
115
SINGLE_QUOTED : " '" / . *? / " '"
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ def FLOAT(self, value):
181
181
return float (value )
182
182
183
183
def BOOLEAN (self , value ):
184
- return value == "TRUE "
184
+ return value . lower () == "true "
185
185
186
186
def DOUBLE_QUOTED (self , token ):
187
187
return token [1 :- 1 ]
Original file line number Diff line number Diff line change @@ -597,3 +597,35 @@ def test_function_attr_string_arg():
597
597
],
598
598
),
599
599
)
600
+
601
+
602
+ def test_attribute_eq_true_uppercase ():
603
+ result = parse ("attr = TRUE" )
604
+ assert result == ast .Equal (
605
+ ast .Attribute ("attr" ),
606
+ True ,
607
+ )
608
+
609
+
610
+ def test_attribute_eq_true_lowercase ():
611
+ result = parse ("attr = true" )
612
+ assert result == ast .Equal (
613
+ ast .Attribute ("attr" ),
614
+ True ,
615
+ )
616
+
617
+
618
+ def test_attribute_eq_false_uppercase ():
619
+ result = parse ("attr = FALSE" )
620
+ assert result == ast .Equal (
621
+ ast .Attribute ("attr" ),
622
+ False ,
623
+ )
624
+
625
+
626
+ def test_attribute_eq_false_lowercase ():
627
+ result = parse ("attr = false" )
628
+ assert result == ast .Equal (
629
+ ast .Attribute ("attr" ),
630
+ False ,
631
+ )
You can’t perform that action at this time.
0 commit comments