Skip to content
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

Unexpected token for ~ #159

Open
pzalews opened this issue Apr 10, 2024 · 0 comments
Open

Unexpected token for ~ #159

pzalews opened this issue Apr 10, 2024 · 0 comments

Comments

@pzalews
Copy link

pzalews commented Apr 10, 2024

With latest version 4.3.3:

File "/home/piotrzal/SRC/DEVOPS/modules-manager/docs_venv/lib/python3.8/site-packages/lark/lexer.py", line 598, in next_token
    raise UnexpectedCharacters(lex_state.text, line_ctr.char_pos, line_ctr.line, line_ctr.column,
lark.exceptions.UnexpectedCharacters: No terminal matches '~' in the current parser context, at line 65 col 34

%{for role in var.ADMIN_ROLES_ARN~}
                                 ^
Expected one of:
        * /[a-zA-Z_][a-zA-Z0-9_-]*/
        * "=="
        * QMARK
        * /#.*\n/
        * COMMA
        * LPAR
        * MORETHAN
        * "<="
        * "[*]"
        * LESSTHAN
        * RBRACE
        * ">="
        * RPAR
        * STRING_LIT
        * PLUS
        * LBRACE
        * RSQB
        * /\/\/.*\n/
        * "..."
        * "!="
        * LSQB
        * COLON
        * SLASH
        * PERCENT
        * MINUS
        * /\n/
        * "||"
        * "&&"
        * EQUAL
        * STAR
        * DOT
        * "=>"
        * ".*"

Previous tokens: Token('__ANON_3', '_ARN')

Example terraform code:

name = <<EOT
%{for role in var.ADMIN_ROLES_ARN~}
- rolearn: ${role}
  username: ${join("-", slice(split("/", role), 1, length(split("/", role))))}
  groups:
    - system:masters
%{endfor}
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant