From f0bf2b15ae8cdfab7aca1535368b5f851a9ff8b9 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sat, 27 Jan 2018 09:30:36 -0800 Subject: [PATCH] hclsyntax: permit tabs and treat them like spaces We inherited a restriction from an early zcl prototype here, but it's far too strict to prohibit tabs entirely and so we'll accept them and just treat them as spaces for column-counting purposes. Tabs are still not _advised_, since they add extra complexity for problems like generating annotated source code snippets (can't necessarily know how large the tab stop is going to be) or doing surgical updates to existing source files. The canonical formatting applied by hclwrite's Format function will still eliminate all tabs, imposing the canonical style of two spaces per indent level. This fixes #2. --- hcl/hclsyntax/parser_test.go | 4 +- hcl/hclsyntax/scan_tokens.go | 601 +++++++++++++++--------------- hcl/hclsyntax/scan_tokens_test.go | 8 - 3 files changed, 298 insertions(+), 315 deletions(-) diff --git a/hcl/hclsyntax/parser_test.go b/hcl/hclsyntax/parser_test.go index ee16c6d..4fe023c 100644 --- a/hcl/hclsyntax/parser_test.go +++ b/hcl/hclsyntax/parser_test.go @@ -1010,12 +1010,12 @@ block "valid" {} { ` `, - 2, // tabs not allowed, and body item is required here + 0, // the tab character is treated as a single whitespace character &Body{ Attributes: Attributes{}, Blocks: Blocks{}, SrcRange: hcl.Range{ - Start: hcl.Pos{Line: 1, Column: 1, Byte: 0}, + Start: hcl.Pos{Line: 1, Column: 2, Byte: 1}, End: hcl.Pos{Line: 1, Column: 2, Byte: 1}, }, EndRange: hcl.Range{ diff --git a/hcl/hclsyntax/scan_tokens.go b/hcl/hclsyntax/scan_tokens.go index a8ab57c..de23b3c 100644 --- a/hcl/hclsyntax/scan_tokens.go +++ b/hcl/hclsyntax/scan_tokens.go @@ -27,11 +27,10 @@ var _zcltok_actions []byte = []byte{ 1, 62, 1, 63, 1, 64, 1, 65, 1, 66, 1, 67, 1, 68, 1, 69, 1, 70, 1, 71, 1, 72, 1, 73, - 1, 74, 1, 75, 2, 0, 1, 2, - 3, 16, 2, 3, 17, 2, 3, 28, - 2, 3, 29, 2, 3, 40, 2, 3, - 41, 2, 3, 42, 2, 3, 43, 2, - 3, 44, + 1, 74, 2, 0, 1, 2, 3, 16, + 2, 3, 17, 2, 3, 28, 2, 3, + 29, 2, 3, 40, 2, 3, 41, 2, + 3, 42, 2, 3, 43, 2, 3, 44, } var _zcltok_key_offsets []int16 = []int16{ @@ -153,17 +152,17 @@ var _zcltok_key_offsets []int16 = []int16{ 5909, 5913, 5917, 5922, 5926, 5928, 5935, 5939, 5947, 5951, 5952, 5954, 5956, 5958, 5960, 5962, 5963, 5964, 5966, 5968, 5970, 5971, 5972, 5973, - 5974, 5976, 5978, 5980, 5981, 5982, 6057, 6058, - 6059, 6060, 6061, 6062, 6063, 6064, 6066, 6067, - 6072, 6074, 6076, 6077, 6121, 6122, 6123, 6125, - 6130, 6134, 6134, 6136, 6138, 6149, 6159, 6167, - 6168, 6170, 6171, 6175, 6179, 6189, 6193, 6200, - 6211, 6218, 6222, 6228, 6239, 6271, 6320, 6335, - 6350, 6355, 6357, 6362, 6394, 6402, 6404, 6426, - 6448, 6450, 6466, 6482, 6497, 6506, 6520, 6534, - 6550, 6551, 6552, 6553, 6554, 6556, 6558, 6560, - 6574, 6588, 6589, 6590, 6592, 6594, 6596, 6610, - 6624, 6625, 6626, 6628, 6630, + 5974, 5976, 5978, 5980, 5981, 5982, 6057, 6059, + 6060, 6061, 6062, 6063, 6064, 6066, 6067, 6072, + 6074, 6076, 6077, 6121, 6122, 6123, 6125, 6130, + 6134, 6134, 6136, 6138, 6149, 6159, 6167, 6168, + 6170, 6171, 6175, 6179, 6189, 6193, 6200, 6211, + 6218, 6222, 6228, 6239, 6271, 6320, 6335, 6350, + 6355, 6357, 6362, 6394, 6402, 6404, 6426, 6448, + 6450, 6466, 6482, 6497, 6506, 6520, 6534, 6550, + 6551, 6552, 6553, 6554, 6556, 6558, 6560, 6574, + 6588, 6589, 6590, 6592, 6594, 6596, 6610, 6624, + 6625, 6626, 6628, 6630, } var _zcltok_trans_keys []byte = []byte{ @@ -186,7 +185,7 @@ var _zcltok_trans_keys []byte = []byte{ 234, 237, 239, 240, 243, 48, 57, 65, 90, 97, 122, 196, 218, 229, 236, 10, 170, 181, 183, 186, 128, 150, 152, 182, - 184, 255, 192, 255, 0, 127, 173, 130, + 184, 255, 192, 255, 128, 255, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, 137, @@ -924,7 +923,7 @@ var _zcltok_trans_keys []byte = []byte{ 238, 239, 240, 0, 39, 40, 45, 48, 57, 58, 63, 65, 90, 91, 96, 97, 122, 192, 193, 196, 218, 229, 236, 241, - 247, 9, 10, 32, 61, 10, 38, 46, + 247, 9, 32, 10, 61, 10, 38, 46, 42, 47, 42, 46, 69, 101, 48, 57, 60, 61, 61, 62, 61, 45, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, @@ -1117,17 +1116,17 @@ var _zcltok_single_lengths []byte = []byte{ 2, 0, 3, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, - 0, 0, 0, 1, 1, 53, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 3, - 2, 2, 1, 34, 1, 1, 0, 3, - 2, 0, 0, 0, 1, 2, 4, 1, - 0, 1, 0, 0, 0, 0, 1, 1, - 1, 0, 0, 1, 30, 47, 13, 9, - 3, 0, 1, 28, 2, 0, 18, 16, - 0, 6, 4, 3, 1, 4, 4, 4, - 1, 1, 1, 1, 0, 0, 0, 4, - 2, 1, 1, 0, 0, 0, 4, 2, - 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 53, 2, 1, + 1, 1, 1, 1, 2, 1, 3, 2, + 2, 1, 34, 1, 1, 0, 3, 2, + 0, 0, 0, 1, 2, 4, 1, 0, + 1, 0, 0, 0, 0, 1, 1, 1, + 0, 0, 1, 30, 47, 13, 9, 3, + 0, 1, 28, 2, 0, 18, 16, 0, + 6, 4, 3, 1, 4, 4, 4, 1, + 1, 1, 1, 0, 0, 0, 4, 2, + 1, 1, 0, 0, 0, 4, 2, 1, + 1, 0, 0, 0, } var _zcltok_range_lengths []byte = []byte{ @@ -1250,16 +1249,16 @@ var _zcltok_range_lengths []byte = []byte{ 2, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 5, 0, 0, 1, 1, - 1, 0, 1, 1, 5, 4, 2, 0, - 1, 0, 2, 2, 5, 2, 3, 5, - 3, 2, 3, 5, 1, 1, 1, 3, - 1, 1, 2, 2, 3, 1, 2, 3, - 1, 5, 6, 6, 4, 5, 5, 6, - 0, 0, 0, 0, 1, 1, 1, 5, - 6, 0, 0, 1, 1, 1, 5, 6, - 0, 0, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 5, 0, 0, 1, 1, 1, + 0, 1, 1, 5, 4, 2, 0, 1, + 0, 2, 2, 5, 2, 3, 5, 3, + 2, 3, 5, 1, 1, 1, 3, 1, + 1, 2, 2, 3, 1, 2, 3, 1, + 5, 6, 6, 4, 5, 5, 6, 0, + 0, 0, 0, 1, 1, 1, 5, 6, + 0, 0, 1, 1, 1, 5, 6, 0, + 0, 1, 1, 1, } var _zcltok_index_offsets []int16 = []int16{ @@ -1381,17 +1380,17 @@ var _zcltok_index_offsets []int16 = []int16{ 4692, 4696, 4699, 4704, 4707, 4709, 4714, 4717, 4723, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4740, 4742, 4744, 4746, 4748, 4750, 4752, 4754, - 4756, 4758, 4760, 4762, 4764, 4766, 4831, 4833, - 4835, 4837, 4839, 4841, 4843, 4845, 4848, 4850, - 4855, 4858, 4861, 4863, 4903, 4905, 4907, 4909, - 4914, 4918, 4919, 4921, 4923, 4930, 4937, 4944, - 4946, 4948, 4950, 4953, 4956, 4962, 4965, 4970, - 4977, 4982, 4985, 4989, 4996, 5028, 5077, 5092, - 5105, 5110, 5112, 5116, 5147, 5153, 5155, 5176, - 5196, 5198, 5210, 5221, 5231, 5237, 5247, 5257, - 5268, 5270, 5272, 5274, 5276, 5278, 5280, 5282, - 5292, 5301, 5303, 5305, 5307, 5309, 5311, 5321, - 5330, 5332, 5334, 5336, 5338, + 4756, 4758, 4760, 4762, 4764, 4766, 4831, 4834, + 4836, 4838, 4840, 4842, 4844, 4847, 4849, 4854, + 4857, 4860, 4862, 4902, 4904, 4906, 4908, 4913, + 4917, 4918, 4920, 4922, 4929, 4936, 4943, 4945, + 4947, 4949, 4952, 4955, 4961, 4964, 4969, 4976, + 4981, 4984, 4988, 4995, 5027, 5076, 5091, 5104, + 5109, 5111, 5115, 5146, 5152, 5154, 5175, 5195, + 5197, 5209, 5220, 5230, 5236, 5246, 5256, 5267, + 5269, 5271, 5273, 5275, 5277, 5279, 5281, 5291, + 5300, 5302, 5304, 5306, 5308, 5310, 5320, 5329, + 5331, 5333, 5335, 5337, } var _zcltok_indicies []int16 = []int16{ @@ -1413,7 +1412,7 @@ var _zcltok_indicies []int16 = []int16{ 64, 65, 40, 42, 66, 44, 67, 68, 69, 14, 14, 14, 17, 41, 3, 47, 3, 14, 14, 14, 14, 3, 14, 14, - 14, 3, 14, 3, 14, 3, 14, 3, + 14, 3, 14, 3, 14, 14, 3, 3, 3, 3, 3, 3, 14, 3, 3, 3, 3, 14, 14, 14, 14, 14, 3, 3, 14, 3, 3, 14, 3, 14, 3, 3, @@ -1991,83 +1990,83 @@ var _zcltok_indicies []int16 = []int16{ 778, 774, 779, 776, 780, 777, 781, 777, 783, 782, 784, 785, 785, 782, 786, 782, 787, 784, 788, 785, 789, 785, 790, 791, - 792, 793, 794, 795, 796, 797, 799, 800, - 801, 802, 803, 672, 672, 672, 804, 805, - 806, 807, 672, 810, 811, 813, 814, 815, - 809, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, - 831, 832, 833, 834, 835, 837, 838, 839, - 840, 841, 842, 672, 798, 10, 798, 422, - 798, 422, 809, 812, 836, 843, 808, 790, - 844, 791, 845, 793, 846, 848, 847, 2, - 1, 849, 847, 850, 847, 5, 1, 847, - 6, 5, 9, 11, 11, 10, 852, 853, - 854, 847, 855, 856, 847, 857, 847, 422, - 422, 859, 860, 491, 472, 861, 472, 862, - 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 546, 873, 522, 874, 875, 876, - 877, 878, 879, 880, 881, 882, 883, 884, - 885, 422, 422, 422, 427, 567, 858, 886, - 847, 887, 847, 672, 888, 422, 422, 422, - 672, 888, 672, 672, 422, 888, 422, 888, - 422, 888, 422, 672, 672, 672, 672, 672, - 888, 422, 672, 672, 672, 422, 672, 422, - 888, 422, 672, 672, 672, 672, 422, 888, - 672, 422, 672, 422, 672, 422, 672, 672, - 422, 672, 888, 422, 672, 422, 672, 422, - 672, 888, 672, 422, 888, 672, 422, 672, - 422, 888, 672, 672, 672, 672, 672, 888, - 422, 422, 672, 422, 672, 888, 672, 422, - 888, 672, 672, 888, 422, 422, 672, 422, - 672, 422, 672, 888, 889, 890, 891, 892, - 893, 894, 895, 896, 897, 898, 899, 717, - 900, 901, 902, 903, 904, 905, 906, 907, - 908, 909, 910, 911, 910, 912, 913, 914, - 915, 916, 673, 888, 917, 918, 919, 920, - 921, 922, 923, 924, 925, 926, 927, 928, - 929, 930, 931, 932, 933, 934, 935, 727, - 936, 937, 938, 694, 939, 940, 941, 942, - 943, 944, 673, 945, 946, 947, 948, 949, - 950, 951, 952, 676, 953, 673, 676, 954, - 955, 956, 957, 685, 888, 958, 959, 960, - 961, 705, 962, 963, 685, 964, 965, 966, - 967, 968, 673, 888, 969, 928, 970, 971, - 972, 685, 973, 974, 676, 673, 685, 427, - 888, 938, 673, 676, 685, 427, 685, 427, - 975, 685, 888, 427, 676, 976, 977, 676, - 978, 979, 683, 980, 981, 982, 983, 984, - 934, 985, 986, 987, 988, 989, 990, 991, - 992, 993, 994, 995, 996, 953, 997, 676, - 685, 427, 888, 998, 999, 685, 673, 888, - 427, 673, 888, 676, 1000, 733, 1001, 1002, - 1003, 1004, 1005, 1006, 1007, 1008, 673, 1009, - 1010, 1011, 1012, 1013, 1014, 673, 685, 888, - 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, - 1024, 1025, 1026, 1022, 1028, 1029, 1030, 1031, - 1015, 1027, 1015, 888, 1015, 888, 1032, 1032, - 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, - 1037, 769, 1041, 1041, 1041, 1036, 1042, 1041, - 770, 771, 1043, 1041, 769, 1041, 1041, 1036, - 1044, 1041, 770, 771, 1043, 1041, 769, 1036, - 1044, 1045, 1046, 1047, 769, 1041, 1041, 1041, - 1036, 1042, 770, 771, 1043, 1041, 769, 1041, - 1041, 1041, 1036, 1042, 770, 771, 1043, 1041, - 769, 1041, 1041, 1041, 1036, 1042, 771, 770, - 771, 1043, 1041, 769, 1049, 769, 1051, 1050, - 1052, 769, 1054, 1053, 769, 1055, 773, 1055, - 1056, 1055, 775, 1057, 1058, 1059, 1060, 1061, - 1062, 1063, 1060, 777, 775, 1057, 1065, 1064, - 778, 779, 1066, 1064, 777, 1068, 1067, 1070, - 1069, 777, 1071, 778, 1071, 779, 1071, 783, - 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1075, - 785, 783, 1072, 1080, 1079, 786, 787, 1081, - 1079, 785, 1083, 1082, 1085, 1084, 785, 1086, - 786, 1086, 787, 1086, + 792, 790, 793, 794, 795, 796, 798, 799, + 800, 801, 802, 672, 672, 672, 803, 804, + 805, 806, 672, 809, 810, 812, 813, 814, + 808, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, + 830, 831, 832, 833, 834, 836, 837, 838, + 839, 840, 841, 672, 797, 10, 797, 422, + 797, 422, 808, 811, 835, 842, 807, 790, + 790, 843, 791, 844, 846, 845, 2, 1, + 847, 845, 848, 845, 5, 1, 845, 6, + 5, 9, 11, 11, 10, 850, 851, 852, + 845, 853, 854, 845, 855, 845, 422, 422, + 857, 858, 491, 472, 859, 472, 860, 861, + 862, 863, 864, 865, 866, 867, 868, 869, + 870, 546, 871, 522, 872, 873, 874, 875, + 876, 877, 878, 879, 880, 881, 882, 883, + 422, 422, 422, 427, 567, 856, 884, 845, + 885, 845, 672, 886, 422, 422, 422, 672, + 886, 672, 672, 422, 886, 422, 886, 422, + 886, 422, 672, 672, 672, 672, 672, 886, + 422, 672, 672, 672, 422, 672, 422, 886, + 422, 672, 672, 672, 672, 422, 886, 672, + 422, 672, 422, 672, 422, 672, 672, 422, + 672, 886, 422, 672, 422, 672, 422, 672, + 886, 672, 422, 886, 672, 422, 672, 422, + 886, 672, 672, 672, 672, 672, 886, 422, + 422, 672, 422, 672, 886, 672, 422, 886, + 672, 672, 886, 422, 422, 672, 422, 672, + 422, 672, 886, 887, 888, 889, 890, 891, + 892, 893, 894, 895, 896, 897, 717, 898, + 899, 900, 901, 902, 903, 904, 905, 906, + 907, 908, 909, 908, 910, 911, 912, 913, + 914, 673, 886, 915, 916, 917, 918, 919, + 920, 921, 922, 923, 924, 925, 926, 927, + 928, 929, 930, 931, 932, 933, 727, 934, + 935, 936, 694, 937, 938, 939, 940, 941, + 942, 673, 943, 944, 945, 946, 947, 948, + 949, 950, 676, 951, 673, 676, 952, 953, + 954, 955, 685, 886, 956, 957, 958, 959, + 705, 960, 961, 685, 962, 963, 964, 965, + 966, 673, 886, 967, 926, 968, 969, 970, + 685, 971, 972, 676, 673, 685, 427, 886, + 936, 673, 676, 685, 427, 685, 427, 973, + 685, 886, 427, 676, 974, 975, 676, 976, + 977, 683, 978, 979, 980, 981, 982, 932, + 983, 984, 985, 986, 987, 988, 989, 990, + 991, 992, 993, 994, 951, 995, 676, 685, + 427, 886, 996, 997, 685, 673, 886, 427, + 673, 886, 676, 998, 733, 999, 1000, 1001, + 1002, 1003, 1004, 1005, 1006, 673, 1007, 1008, + 1009, 1010, 1011, 1012, 673, 685, 886, 1014, + 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, + 1023, 1024, 1020, 1026, 1027, 1028, 1029, 1013, + 1025, 1013, 886, 1013, 886, 1030, 1030, 1031, + 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1035, + 769, 1039, 1039, 1039, 1034, 1040, 1039, 770, + 771, 1041, 1039, 769, 1039, 1039, 1034, 1042, + 1039, 770, 771, 1041, 1039, 769, 1034, 1042, + 1043, 1044, 1045, 769, 1039, 1039, 1039, 1034, + 1040, 770, 771, 1041, 1039, 769, 1039, 1039, + 1039, 1034, 1040, 770, 771, 1041, 1039, 769, + 1039, 1039, 1039, 1034, 1040, 771, 770, 771, + 1041, 1039, 769, 1047, 769, 1049, 1048, 1050, + 769, 1052, 1051, 769, 1053, 773, 1053, 1054, + 1053, 775, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1058, 777, 775, 1055, 1063, 1062, 778, + 779, 1064, 1062, 777, 1066, 1065, 1068, 1067, + 777, 1069, 778, 1069, 779, 1069, 783, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1073, 785, + 783, 1070, 1078, 1077, 786, 787, 1079, 1077, + 785, 1081, 1080, 1083, 1082, 785, 1084, 786, + 1084, 787, 1084, } var _zcltok_trans_targs []int16 = []int16{ - 949, 1, 949, 949, 949, 3, 4, 958, - 949, 5, 959, 6, 7, 9, 10, 287, + 949, 1, 949, 949, 949, 3, 4, 957, + 949, 5, 958, 6, 7, 9, 10, 287, 13, 14, 15, 16, 17, 288, 289, 20, 290, 22, 23, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 329, 349, 354, @@ -2118,7 +2117,7 @@ var _zcltok_trans_targs []int16 = []int16{ 382, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 406, 407, - 408, 409, 411, 413, 415, 949, 963, 438, + 408, 409, 411, 413, 415, 949, 962, 438, 439, 440, 441, 418, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, @@ -2162,51 +2161,51 @@ var _zcltok_trans_targs []int16 = []int16{ 897, 899, 900, 901, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 915, 916, 917, 918, 921, 923, 924, 926, 928, - 1001, 1002, 930, 931, 1001, 933, 1015, 1015, - 1015, 1016, 937, 938, 1017, 1018, 1022, 1022, - 1022, 1023, 944, 945, 1024, 1025, 950, 949, - 951, 952, 953, 949, 954, 955, 949, 956, - 957, 960, 961, 962, 949, 964, 949, 965, - 949, 966, 967, 968, 969, 970, 971, 972, + 1000, 1001, 930, 931, 1000, 933, 1014, 1014, + 1014, 1015, 937, 938, 1016, 1017, 1021, 1021, + 1021, 1022, 944, 945, 1023, 1024, 950, 949, + 951, 952, 949, 953, 954, 949, 955, 956, + 959, 960, 961, 949, 963, 949, 964, 949, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, - 997, 998, 999, 1000, 949, 949, 949, 949, - 949, 949, 2, 949, 949, 8, 949, 949, - 949, 949, 949, 416, 417, 421, 422, 423, - 424, 425, 426, 427, 428, 429, 430, 431, - 432, 434, 436, 437, 469, 510, 525, 532, - 534, 536, 556, 559, 575, 688, 949, 949, - 949, 692, 693, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 704, 705, 706, 707, - 708, 709, 710, 711, 712, 713, 714, 715, - 716, 717, 718, 719, 720, 721, 722, 723, - 724, 726, 727, 728, 729, 730, 731, 732, - 733, 734, 735, 736, 737, 738, 739, 740, - 742, 743, 744, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, - 759, 761, 762, 763, 764, 765, 766, 767, - 768, 769, 771, 772, 773, 774, 775, 776, - 777, 778, 779, 780, 781, 782, 783, 784, - 785, 786, 787, 788, 790, 791, 792, 793, - 794, 795, 796, 797, 798, 799, 800, 801, - 802, 803, 804, 805, 806, 807, 808, 809, - 810, 812, 813, 814, 815, 816, 817, 818, - 819, 820, 821, 822, 823, 824, 825, 826, - 827, 856, 881, 884, 885, 887, 894, 895, - 898, 902, 914, 919, 920, 922, 925, 927, - 1001, 1001, 1008, 1010, 1003, 1001, 1012, 1013, - 1014, 1001, 929, 932, 1004, 1005, 1006, 1007, - 1001, 1009, 1001, 1001, 1011, 1001, 1001, 1001, - 934, 935, 940, 941, 1015, 1019, 1020, 1021, - 1015, 936, 939, 1015, 1015, 1015, 1015, 1015, - 942, 947, 948, 1022, 1026, 1027, 1028, 1022, - 943, 946, 1022, 1022, 1022, 1022, 1022, + 997, 998, 999, 949, 949, 949, 949, 949, + 2, 949, 949, 8, 949, 949, 949, 949, + 949, 416, 417, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 434, + 436, 437, 469, 510, 525, 532, 534, 536, + 556, 559, 575, 688, 949, 949, 949, 692, + 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 704, 705, 706, 707, 708, 709, + 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 726, + 727, 728, 729, 730, 731, 732, 733, 734, + 735, 736, 737, 738, 739, 740, 742, 743, + 744, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 761, + 762, 763, 764, 765, 766, 767, 768, 769, + 771, 772, 773, 774, 775, 776, 777, 778, + 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, + 804, 805, 806, 807, 808, 809, 810, 812, + 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 856, + 881, 884, 885, 887, 894, 895, 898, 902, + 914, 919, 920, 922, 925, 927, 1000, 1000, + 1007, 1009, 1002, 1000, 1011, 1012, 1013, 1000, + 929, 932, 1003, 1004, 1005, 1006, 1000, 1008, + 1000, 1000, 1010, 1000, 1000, 1000, 934, 935, + 940, 941, 1014, 1018, 1019, 1020, 1014, 936, + 939, 1014, 1014, 1014, 1014, 1014, 942, 947, + 948, 1021, 1025, 1026, 1027, 1021, 943, 946, + 1021, 1021, 1021, 1021, 1021, } var _zcltok_trans_actions []byte = []byte{ - 131, 0, 71, 127, 87, 0, 0, 151, - 123, 0, 5, 0, 0, 0, 0, 0, + 129, 0, 71, 125, 87, 0, 0, 149, + 121, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2257,7 +2256,7 @@ var _zcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 125, 148, 0, + 0, 0, 0, 0, 0, 123, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2288,7 +2287,7 @@ var _zcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 129, + 0, 0, 0, 0, 0, 0, 0, 127, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2302,21 +2301,20 @@ var _zcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 5, 0, 0, 29, 0, 49, 35, - 47, 136, 0, 0, 0, 0, 69, 55, - 67, 142, 0, 0, 0, 0, 0, 73, - 0, 0, 0, 99, 160, 0, 91, 5, - 154, 5, 0, 0, 93, 0, 95, 0, - 103, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 5, - 5, 5, 157, 157, 157, 157, 157, 157, - 5, 5, 157, 5, 117, 121, 107, 115, - 77, 83, 0, 113, 109, 0, 81, 75, - 89, 79, 111, 0, 0, 0, 0, 0, + 47, 134, 0, 0, 0, 0, 69, 55, + 67, 140, 0, 0, 0, 0, 0, 73, + 0, 0, 99, 158, 0, 91, 5, 152, + 5, 0, 0, 93, 0, 95, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 85, 97, - 119, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 5, 5, + 5, 155, 155, 155, 155, 155, 155, 5, + 5, 155, 5, 107, 119, 115, 77, 83, + 0, 113, 109, 0, 81, 75, 89, 79, + 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 85, 97, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2334,13 +2332,14 @@ var _zcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 11, 0, 0, 5, 15, 0, 5, - 5, 21, 0, 0, 0, 5, 5, 5, - 23, 0, 17, 7, 0, 19, 9, 25, - 0, 0, 0, 0, 37, 0, 139, 139, - 43, 0, 0, 39, 31, 41, 33, 45, - 0, 0, 0, 57, 0, 145, 145, 63, - 0, 0, 59, 51, 61, 53, 65, + 0, 0, 0, 0, 0, 0, 13, 11, + 0, 0, 5, 15, 0, 5, 5, 21, + 0, 0, 0, 5, 5, 5, 23, 0, + 17, 7, 0, 19, 9, 25, 0, 0, + 0, 0, 37, 0, 137, 137, 43, 0, + 0, 39, 31, 41, 33, 45, 0, 0, + 0, 57, 0, 143, 143, 63, 0, 0, + 59, 51, 61, 53, 65, } var _zcltok_to_state_actions []byte = []byte{ @@ -2469,10 +2468,10 @@ var _zcltok_to_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 133, - 0, 0, 0, 0, 0, 0, 133, 0, - 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 131, 0, + 0, 0, 0, 0, 0, 131, 0, 0, + 0, 0, 0, 0, } var _zcltok_from_state_actions []byte = []byte{ @@ -2601,10 +2600,10 @@ var _zcltok_from_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, + 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, } var _zcltok_eof_trans []int16 = []int16{ @@ -2726,26 +2725,26 @@ var _zcltok_eof_trans []int16 = []int16{ 672, 672, 672, 672, 672, 672, 672, 672, 672, 769, 769, 769, 769, 773, 773, 775, 777, 775, 775, 777, 0, 0, 783, 785, - 783, 783, 785, 0, 0, 0, 845, 846, - 847, 848, 846, 848, 848, 848, 852, 853, - 848, 848, 848, 859, 848, 848, 889, 889, - 889, 889, 889, 889, 889, 889, 889, 889, - 889, 889, 889, 889, 889, 889, 889, 889, - 889, 889, 889, 889, 889, 889, 889, 889, - 889, 889, 889, 889, 889, 889, 889, 889, - 889, 0, 1042, 1042, 1042, 1042, 1042, 1042, - 1049, 1051, 1049, 1054, 1056, 1056, 1056, 0, - 1065, 1068, 1070, 1072, 1072, 1072, 0, 1080, - 1083, 1085, 1087, 1087, 1087, + 783, 783, 785, 0, 0, 0, 844, 845, + 846, 845, 846, 846, 846, 850, 851, 846, + 846, 846, 857, 846, 846, 887, 887, 887, + 887, 887, 887, 887, 887, 887, 887, 887, + 887, 887, 887, 887, 887, 887, 887, 887, + 887, 887, 887, 887, 887, 887, 887, 887, + 887, 887, 887, 887, 887, 887, 887, 887, + 0, 1040, 1040, 1040, 1040, 1040, 1040, 1047, + 1049, 1047, 1052, 1054, 1054, 1054, 0, 1063, + 1066, 1068, 1070, 1070, 1070, 0, 1078, 1081, + 1083, 1085, 1085, 1085, } const zcltok_start int = 949 const zcltok_first_final int = 949 const zcltok_error int = 0 -const zcltok_en_stringTemplate int = 1001 -const zcltok_en_heredocTemplate int = 1015 -const zcltok_en_bareTemplate int = 1022 +const zcltok_en_stringTemplate int = 1000 +const zcltok_en_heredocTemplate int = 1014 +const zcltok_en_bareTemplate int = 1021 const zcltok_en_main int = 949 // line 15 "scan_tokens.rl" @@ -2757,7 +2756,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To Pos: start, } - // line 272 "scan_tokens.rl" + // line 269 "scan_tokens.rl" // Ragel state p := 0 // "Pointer" into data @@ -2783,7 +2782,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To var retBraces []int // stack of brace levels that cause us to use fret var heredocs []heredocInProgress // stack of heredocs we're currently processing - // line 305 "scan_tokens.rl" + // line 302 "scan_tokens.rl" // Make Go compiler happy _ = ts @@ -2803,7 +2802,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To f.emitToken(TokenType(b[0]), ts, te) } - // line 2816 "scan_tokens.go" + // line 2815 "scan_tokens.go" { top = 0 ts = 0 @@ -2811,7 +2810,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To act = 0 } - // line 2824 "scan_tokens.go" + // line 2823 "scan_tokens.go" { var _klen int var _trans int @@ -2836,7 +2835,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To ts = p - // line 2848 "scan_tokens.go" + // line 2847 "scan_tokens.go" } } @@ -2913,7 +2912,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To te = p + 1 case 4: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p + 1 { @@ -2932,7 +2931,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 5: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p + 1 { @@ -2951,7 +2950,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 6: - // line 80 "scan_tokens.rl" + // line 78 "scan_tokens.rl" te = p + 1 { @@ -2965,21 +2964,21 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 7: - // line 222 "scan_tokens.rl" + // line 220 "scan_tokens.rl" te = p + 1 { token(TokenInvalid) } case 8: - // line 223 "scan_tokens.rl" + // line 221 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 9: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p p-- @@ -2999,7 +2998,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 10: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p p-- @@ -3019,7 +3018,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 11: - // line 221 "scan_tokens.rl" + // line 219 "scan_tokens.rl" te = p p-- @@ -3027,7 +3026,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenQuotedLit) } case 12: - // line 222 "scan_tokens.rl" + // line 220 "scan_tokens.rl" te = p p-- @@ -3035,7 +3034,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenInvalid) } case 13: - // line 223 "scan_tokens.rl" + // line 221 "scan_tokens.rl" te = p p-- @@ -3043,29 +3042,29 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 14: - // line 221 "scan_tokens.rl" + // line 219 "scan_tokens.rl" p = (te) - 1 { token(TokenQuotedLit) } case 15: - // line 223 "scan_tokens.rl" + // line 221 "scan_tokens.rl" p = (te) - 1 { token(TokenBadUTF8) } case 16: - // line 126 "scan_tokens.rl" + // line 124 "scan_tokens.rl" act = 10 case 17: - // line 231 "scan_tokens.rl" + // line 229 "scan_tokens.rl" act = 11 case 18: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p + 1 { @@ -3084,7 +3083,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 19: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p + 1 { @@ -3103,7 +3102,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 20: - // line 107 "scan_tokens.rl" + // line 105 "scan_tokens.rl" te = p + 1 { @@ -3131,14 +3130,14 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 21: - // line 231 "scan_tokens.rl" + // line 229 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 22: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p p-- @@ -3158,7 +3157,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 23: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p p-- @@ -3178,7 +3177,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 24: - // line 126 "scan_tokens.rl" + // line 124 "scan_tokens.rl" te = p p-- @@ -3190,7 +3189,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 25: - // line 231 "scan_tokens.rl" + // line 229 "scan_tokens.rl" te = p p-- @@ -3198,7 +3197,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 26: - // line 126 "scan_tokens.rl" + // line 124 "scan_tokens.rl" p = (te) - 1 { @@ -3235,15 +3234,15 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 28: - // line 134 "scan_tokens.rl" + // line 132 "scan_tokens.rl" act = 14 case 29: - // line 238 "scan_tokens.rl" + // line 236 "scan_tokens.rl" act = 15 case 30: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p + 1 { @@ -3262,7 +3261,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 31: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p + 1 { @@ -3281,21 +3280,21 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 32: - // line 134 "scan_tokens.rl" + // line 132 "scan_tokens.rl" te = p + 1 { token(TokenStringLit) } case 33: - // line 238 "scan_tokens.rl" + // line 236 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 34: - // line 138 "scan_tokens.rl" + // line 136 "scan_tokens.rl" te = p p-- @@ -3315,7 +3314,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 35: - // line 148 "scan_tokens.rl" + // line 146 "scan_tokens.rl" te = p p-- @@ -3335,7 +3334,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 36: - // line 134 "scan_tokens.rl" + // line 132 "scan_tokens.rl" te = p p-- @@ -3343,7 +3342,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 37: - // line 238 "scan_tokens.rl" + // line 236 "scan_tokens.rl" te = p p-- @@ -3351,7 +3350,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 38: - // line 134 "scan_tokens.rl" + // line 132 "scan_tokens.rl" p = (te) - 1 { @@ -3380,104 +3379,104 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 40: - // line 244 "scan_tokens.rl" + // line 242 "scan_tokens.rl" act = 18 case 41: - // line 246 "scan_tokens.rl" + // line 244 "scan_tokens.rl" act = 19 case 42: - // line 257 "scan_tokens.rl" + // line 255 "scan_tokens.rl" act = 29 case 43: - // line 268 "scan_tokens.rl" + // line 265 "scan_tokens.rl" + + act = 35 + case 44: + // line 266 "scan_tokens.rl" act = 36 - case 44: - // line 269 "scan_tokens.rl" - - act = 37 case 45: - // line 246 "scan_tokens.rl" + // line 244 "scan_tokens.rl" te = p + 1 { token(TokenComment) } case 46: - // line 247 "scan_tokens.rl" + // line 245 "scan_tokens.rl" te = p + 1 { token(TokenNewline) } case 47: - // line 249 "scan_tokens.rl" + // line 247 "scan_tokens.rl" te = p + 1 { token(TokenEqualOp) } case 48: - // line 250 "scan_tokens.rl" + // line 248 "scan_tokens.rl" te = p + 1 { token(TokenNotEqual) } case 49: - // line 251 "scan_tokens.rl" + // line 249 "scan_tokens.rl" te = p + 1 { token(TokenGreaterThanEq) } case 50: - // line 252 "scan_tokens.rl" + // line 250 "scan_tokens.rl" te = p + 1 { token(TokenLessThanEq) } case 51: - // line 253 "scan_tokens.rl" + // line 251 "scan_tokens.rl" te = p + 1 { token(TokenAnd) } case 52: - // line 254 "scan_tokens.rl" + // line 252 "scan_tokens.rl" te = p + 1 { token(TokenOr) } case 53: - // line 255 "scan_tokens.rl" + // line 253 "scan_tokens.rl" te = p + 1 { token(TokenEllipsis) } case 54: - // line 256 "scan_tokens.rl" + // line 254 "scan_tokens.rl" te = p + 1 { token(TokenFatArrow) } case 55: - // line 257 "scan_tokens.rl" + // line 255 "scan_tokens.rl" te = p + 1 { selfToken() } case 56: - // line 158 "scan_tokens.rl" + // line 156 "scan_tokens.rl" te = p + 1 { @@ -3485,7 +3484,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To braces++ } case 57: - // line 163 "scan_tokens.rl" + // line 161 "scan_tokens.rl" te = p + 1 { @@ -3506,7 +3505,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 58: - // line 175 "scan_tokens.rl" + // line 173 "scan_tokens.rl" te = p + 1 { @@ -3536,7 +3535,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 59: - // line 75 "scan_tokens.rl" + // line 73 "scan_tokens.rl" te = p + 1 { @@ -3545,12 +3544,12 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1001 + cs = 1000 goto _again } } case 60: - // line 85 "scan_tokens.rl" + // line 83 "scan_tokens.rl" te = p + 1 { @@ -3576,32 +3575,32 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1015 + cs = 1014 goto _again } } case 61: - // line 268 "scan_tokens.rl" + // line 265 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 62: - // line 269 "scan_tokens.rl" + // line 266 "scan_tokens.rl" te = p + 1 { token(TokenInvalid) } case 63: - // line 242 "scan_tokens.rl" + // line 240 "scan_tokens.rl" te = p p-- case 64: - // line 243 "scan_tokens.rl" + // line 241 "scan_tokens.rl" te = p p-- @@ -3609,7 +3608,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenNumberLit) } case 65: - // line 244 "scan_tokens.rl" + // line 242 "scan_tokens.rl" te = p p-- @@ -3617,7 +3616,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenIdent) } case 66: - // line 246 "scan_tokens.rl" + // line 244 "scan_tokens.rl" te = p p-- @@ -3625,7 +3624,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenComment) } case 67: - // line 257 "scan_tokens.rl" + // line 255 "scan_tokens.rl" te = p p-- @@ -3633,58 +3632,50 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To selfToken() } case 68: - // line 267 "scan_tokens.rl" - - te = p - p-- - { - token(TokenTabs) - } - case 69: - // line 268 "scan_tokens.rl" + // line 265 "scan_tokens.rl" te = p p-- { token(TokenBadUTF8) } - case 70: - // line 269 "scan_tokens.rl" + case 69: + // line 266 "scan_tokens.rl" te = p p-- { token(TokenInvalid) } - case 71: - // line 243 "scan_tokens.rl" + case 70: + // line 241 "scan_tokens.rl" p = (te) - 1 { token(TokenNumberLit) } - case 72: - // line 244 "scan_tokens.rl" + case 71: + // line 242 "scan_tokens.rl" p = (te) - 1 { token(TokenIdent) } - case 73: - // line 257 "scan_tokens.rl" + case 72: + // line 255 "scan_tokens.rl" p = (te) - 1 { selfToken() } - case 74: - // line 268 "scan_tokens.rl" + case 73: + // line 265 "scan_tokens.rl" p = (te) - 1 { token(TokenBadUTF8) } - case 75: + case 74: // line 1 "NONE" switch act { @@ -3703,19 +3694,19 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To p = (te) - 1 selfToken() } - case 36: + case 35: { p = (te) - 1 token(TokenBadUTF8) } - case 37: + case 36: { p = (te) - 1 token(TokenInvalid) } } - // line 3592 "scan_tokens.go" + // line 3585 "scan_tokens.go" } } @@ -3736,7 +3727,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To act = 0 - // line 3612 "scan_tokens.go" + // line 3605 "scan_tokens.go" } } @@ -3762,7 +3753,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } - // line 328 "scan_tokens.rl" + // line 325 "scan_tokens.rl" // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which we'll diff --git a/hcl/hclsyntax/scan_tokens_test.go b/hcl/hclsyntax/scan_tokens_test.go index 0fd4c64..c87b0b9 100644 --- a/hcl/hclsyntax/scan_tokens_test.go +++ b/hcl/hclsyntax/scan_tokens_test.go @@ -1264,14 +1264,6 @@ EOF { "\t\t", []Token{ - { - Type: TokenTabs, - Bytes: []byte{0x09, 0x09}, - Range: hcl.Range{ - Start: hcl.Pos{Byte: 0, Line: 1, Column: 1}, - End: hcl.Pos{Byte: 2, Line: 1, Column: 3}, - }, - }, { Type: TokenEOF, Bytes: []byte{},