Skip to content

Commit

Permalink
🚨 : rename antlr expression to better code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Nov 12, 2019
1 parent 812fe04 commit f077694
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/antlr4/io/codeka/gaia/hcl/antlr/hcl.g4
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ variableDirective
;

variableBlock
: '{' type? variableDescription? r_default? '}'
: '{' variableType? variableDescription? variableDefault? '}'
;

outputDirective
: 'output' identifier outputBlock
;

outputBlock
: '{' outputValue? outputDescription? sensitive? '}'
: '{' outputValue? outputDescription? outputSensitive? '}'
;

outputValue
Expand All @@ -33,19 +33,19 @@ outputDescription
: 'description' '=' STRING
;

sensitive
outputSensitive
: 'sensitive' '=' BOOLEAN
;

type
variableType
: 'type' '=' TYPE
;

variableDescription
: 'description' '=' STRING
;

r_default
variableDefault
: 'default' '=' expression
;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/codeka/gaia/hcl/HclTreeListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class HclTreeListener : hclBaseListener() {
this.variables.add(this.currentVariable)
}

override fun enterType(ctx: hclParser.TypeContext) {
override fun enterVariableType(ctx: hclParser.VariableTypeContext) {
this.currentVariable.type = ctx.TYPE().text
}

override fun enterVariableDescription(ctx: hclParser.VariableDescriptionContext) {
this.currentVariable.description = ctx.STRING().text
}

override fun enterR_default(ctx: hclParser.R_defaultContext) {
override fun enterVariableDefault(ctx: hclParser.VariableDefaultContext) {
this.currentVariable.default = ctx.expression().text
}

Expand All @@ -49,7 +49,7 @@ class HclTreeListener : hclBaseListener() {
this.currentOutput.description = ctx.STRING().text
}

override fun enterSensitive(ctx: hclParser.SensitiveContext) {
override fun enterOutputSensitive(ctx: hclParser.OutputSensitiveContext) {
this.currentOutput.sensitive = ctx.BOOLEAN().text
}

Expand Down

0 comments on commit f077694

Please sign in to comment.