diff --git a/README.md b/README.md index 9a8fd12..77ce244 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ dependencies { ## What's New +* **0.7.7** HCL Periods in attribute names referenced from Unicodes ID_Continue, fixed. * **0.7.6** SLF4j 1.7.36 upgrade to reduce CVE's * **0.7.5** For Tuple with boolean conditionals as value expression did not work before * **0.7.4** Fixing Array Access via tree traversal i.e. local.my_array.0 vs local.my_array[0] diff --git a/build.gradle b/build.gradle index 08d57f8..06208b8 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ ext { group = 'com.bertramlabs.plugins' -version = '0.7.6' +version = '0.7.7' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") sourceCompatibility = "1.8" diff --git a/src/main/jflex/com/bertramlabs/plugins/hcl4j/HCLLexer.jflex b/src/main/jflex/com/bertramlabs/plugins/hcl4j/HCLLexer.jflex index 7d20000..6b7383e 100644 --- a/src/main/jflex/com/bertramlabs/plugins/hcl4j/HCLLexer.jflex +++ b/src/main/jflex/com/bertramlabs/plugins/hcl4j/HCLLexer.jflex @@ -352,7 +352,7 @@ ForInExpression = in DigitValue = [0-9\.\-]+ WholeNumber = [0-9]+ -HCLAttributeName = [:jletter:] [a-zA-Z0-9\-\_]* +HCLAttributeName = [:jletter:] [a-zA-Z0-9\-\_\.]* HCLQuotedPropertyName = [\"] [^\r\n]+ [\"] HCLBlock = {HCLAttributeName} {HCLBlockAttribute}* "{" [^]* "}" | {HCLAttributeName} {WhiteSpaceOpt} "{" [^]* "}" diff --git a/src/test/groovy/com/bertramlabs/plugins/hcl4j/HCLParserSpec.groovy b/src/test/groovy/com/bertramlabs/plugins/hcl4j/HCLParserSpec.groovy index 0b8fb7e..63801f5 100644 --- a/src/test/groovy/com/bertramlabs/plugins/hcl4j/HCLParserSpec.groovy +++ b/src/test/groovy/com/bertramlabs/plugins/hcl4j/HCLParserSpec.groovy @@ -188,6 +188,7 @@ test = {"list": [1,2,3,[4,5,6]], name: "David Estes", info: { firstName: "David" def hcl = ''' resource xxx "images" { default = "empty.jpg" + default.withperiod = "period.jpg" } ''' HCLParser parser = new HCLParser(); @@ -195,6 +196,7 @@ resource xxx "images" { def results = parser.parse(hcl) then: results.resource.xxx.images.default == "empty.jpg" + results.resource.xxx.images["default.withperiod"] == "period.jpg" }