hcl/hclsyntax
Martin Atkins 90676d47a0 hclsyntax: Tailored error for "curly quotes"
It seems to be somewhat common for someone to share HCL code via a forum
or a document and have the well-meaning word processor or CMS replace the
straight quotes with curly quotes, which then lead to confusing errors
when someone copies the result and tries to use it as valid HCL
configuration.

Here we add a special hint for that, giving a tailored error message
instead of the generic "This character is not used within the language"
error message.

HCL has always had some of these special hints implemented here, and they
were originally implemented with special token types to allow the parser
handle them. However, we later refactored to do the check all at once
inside the Lex* family of functions, prior to parsing, so it's now
relatively straightforward to handle it as a special case of TokenInvalid
rather than an entirely new token type. Perhaps later we'll rework the
existing ones to also just use TokenInvalid, but that's a decision for
another day.
2020-08-24 11:35:03 -07:00
..
fuzz Update other fuzz docs for consistency 2020-05-14 15:03:29 -04:00
diagnostics.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
doc.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_ops.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_static_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_template_test.go hclsyntax: Additional tests for template sequence escapes 2019-10-01 15:59:10 -07:00
expression_template.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_test.go hclsyntax: return cty.DynamicVal when encountering (...) and unknown 2020-06-03 09:33:38 -04:00
expression_vars_gen.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_vars.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression.go pr feedback: check for null first argument 2020-06-03 09:50:50 -04:00
file.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
generate.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
keywords.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
navigation_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
navigation.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
node.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parse_traversal_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser_template.go Use Unicode 12.0.0 grapheme cluster segmentation rules 2020-03-09 09:16:33 -07:00
parser_test.go hclsyntax: Source range of IndexExpr must cover whole expression 2019-12-06 09:09:18 -08:00
parser_traversal.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser.go hclwrite: Fix panic for dotted full splat (foo.*) 2020-05-13 16:23:21 -04:00
peeker_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
peeker.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
public_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
public.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
spec.md hclsyntax: Correct spec to allow colons as object element delimiter 2020-03-05 09:51:26 -08:00
structure_at_pos_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure_at_pos.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
token_test.go hclsyntax: Tailored error for "curly quotes" 2020-08-24 11:35:03 -07:00
token_type_string.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
token.go hclsyntax: Tailored error for "curly quotes" 2020-08-24 11:35:03 -07:00
unicode2ragel.rb Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
unicode_derived.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
variables_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
variables.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
walk_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
walk.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00