Skip to content

feat: allow underscores in variable names #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ module DynamoDBFilterExpr {
true
else if '0' <= ch <= '9' then
true
else if ch == '_' then
true
else
false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module TestDynamoDBFilterExpr {
expect_equal(ParseExpr("and"), [And]);
expect_equal(ParseExpr(" AnD "), [And]);
expect_equal(ParseExpr(" A AnD B "), [MakeAttr("A"), And, MakeAttr("B")]);
expect_equal(ParseExpr(" A_B AnD B_C "), [MakeAttr("A_B"), And, MakeAttr("B_C")]);

var input := [Not, MakeAttr("A"), In, Open, MakeAttr("B"), Comma, MakeAttr("C"), Close, Or];
expect IsIN(input[1..]);
Expand Down Expand Up @@ -95,13 +96,13 @@ module TestDynamoDBFilterExpr {
method {:test} TestBasicParse() {
var context := ExprContext (
None,
Some("std2 = :A AND #Field4 = :B"),
Some("std2 = :A AND #Field_4 = :B"),
Some(map[
":A" := DDB.AttributeValue.N("1.23"),
":B" := DDB.AttributeValue.S("abc")
]),
Some(map[
"#Field4" := "std4"
"#Field_4" := "std4"
])
);
var version := GetLotsaBeacons();
Expand All @@ -117,7 +118,7 @@ module TestDynamoDBFilterExpr {

var newContext :- expect BeaconizeParsedExpr(beaconVersion, parsed, 0, context.values.value, context.names, DontUseKeys, map[]);
var exprString := ParsedExprToString(newContext.expr);
expect exprString == "aws_dbe_b_std2 = :A AND #Field4 = :B";
expect exprString == "aws_dbe_b_std2 = :A AND #Field_4 = :B";
}

method {:test} TestNoBeaconFail() {
Expand Down