-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This parser doesn't have its own kinds. Instead, this parser emits Terraform parser's "variable" kind tags with "assigned" role. ref. https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files Signed-off-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information
Showing
13 changed files
with
109 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
--sort=no | ||
--extras=+r | ||
--fields=+rl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
aws input.tf /^provider "aws" {$/;" p | ||
events_bus_name input.tf /^variable "events_bus_name" {$/;" v | ||
example_events_bus input.tf /^resource "aws_cloudwatch_event_bus" "example_events_bus" {$/;" r | ||
database input.tf /^module "database" {$/;" m | ||
example_database_password input.tf /^data "aws_ssm_parameter" "example_database_password" {$/;" d | ||
password input.tf /^output "password" {$/;" o | ||
aws input.tf /^provider "aws" {$/;" p language:Terraform roles:def | ||
events_bus_name input.tf /^variable "events_bus_name" {$/;" v language:Terraform roles:def | ||
example_events_bus input.tf /^resource "aws_cloudwatch_event_bus" "example_events_bus" {$/;" r language:Terraform roles:def | ||
database input.tf /^module "database" {$/;" m language:Terraform roles:def | ||
example_database_password input.tf /^data "aws_ssm_parameter" "example_database_password" {$/;" d language:Terraform roles:def | ||
password input.tf /^output "password" {$/;" o language:Terraform roles:def | ||
events_bus_name input-0.tfvars /^events_bus_name = "hyper-connector"$/;" v language:Terraform roles:assigned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Generated by ./misc/optlib2c from optlib/terraformvariables.ctags, Don't edit this manually. | ||
*/ | ||
#include "general.h" | ||
#include "parse.h" | ||
#include "routines.h" | ||
#include "field.h" | ||
#include "xtag.h" | ||
#include "dependency.h" | ||
|
||
|
||
static void initializeTerraformVariablesParser (const langType language CTAGS_ATTR_UNUSED) | ||
{ | ||
} | ||
|
||
extern parserDefinition* TerraformVariablesParser (void) | ||
{ | ||
static const char *const extensions [] = { | ||
"tfvars", | ||
NULL | ||
}; | ||
|
||
static const char *const aliases [] = { | ||
NULL | ||
}; | ||
|
||
static const char *const patterns [] = { | ||
NULL | ||
}; | ||
|
||
static tagRegexTable TerraformVariablesTagRegexTable [] = { | ||
{"^([a-z0-9_]+)[[:space:]]*=", "\\1", | ||
"v", "{_role=assigned}{_language=Terraform}", NULL, false}, | ||
}; | ||
|
||
static parserDependency TerraformVariablesDependencies [] = { | ||
[0] = { DEPTYPE_FOREIGNER, "Terraform", NULL }, | ||
}; | ||
|
||
parserDefinition* const def = parserNew ("TerraformVariables"); | ||
|
||
def->versionCurrent= 0; | ||
def->versionAge = 0; | ||
def->enabled = true; | ||
def->extensions = extensions; | ||
def->patterns = patterns; | ||
def->aliases = aliases; | ||
def->method = METHOD_NOT_CRAFTED|METHOD_REGEX; | ||
def->tagRegexTable = TerraformVariablesTagRegexTable; | ||
def->tagRegexCount = ARRAY_SIZE(TerraformVariablesTagRegexTable); | ||
def->dependencies = TerraformVariablesDependencies; | ||
def->dependencyCount = ARRAY_SIZE(TerraformVariablesDependencies); | ||
def->initialize = initializeTerraformVariablesParser; | ||
|
||
return def; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (c) 2021, Julio Tain Sueiras | ||
# Copyright (c) 2023 Masatake YAMATO | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# | ||
# This source code is released for free distribution under the terms of the | ||
# GNU General Public License version 2 or (at your option) any later version. | ||
# | ||
# The regex pattern is derrived from | ||
# - https://github.com/juliosueiras/vim-terraform-completion/blob/master/ctags/terraform.ctags | ||
# | ||
# This module contains functions to extract language objects for Terraform from | ||
# Terraform Variable Definitions (.tfvars) files. | ||
# See: https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files | ||
# | ||
--langdef=TerraformVariables{_foreignLanguage=Terraform} | ||
|
||
--map-TerraformVariables=+.tfvars | ||
|
||
--regex-TerraformVariables=/^([a-z0-9_]+)[[:space:]]*=/\1/v/{_role=assigned}{_language=Terraform} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters