From cac847b163ccfb6f0d643b6671041922c5231dc3 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sun, 4 Jun 2017 16:00:40 -0700 Subject: [PATCH] zclsyntax: separate tokens for assign = and equality test == --- zcl/zclsyntax/expression_ops.go | 2 +- zcl/zclsyntax/scan_tokens.go | 785 +++++++++++++++-------------- zcl/zclsyntax/scan_tokens.rl | 2 + zcl/zclsyntax/token.go | 1 + zcl/zclsyntax/token_type_string.go | 19 +- 5 files changed, 411 insertions(+), 398 deletions(-) diff --git a/zcl/zclsyntax/expression_ops.go b/zcl/zclsyntax/expression_ops.go index 4bfc7d2..ef64ccd 100644 --- a/zcl/zclsyntax/expression_ops.go +++ b/zcl/zclsyntax/expression_ops.go @@ -45,7 +45,7 @@ func init() { TokenAnd: OpLogicalAnd, }, { - TokenEqual: OpEqual, + TokenEqualOp: OpEqual, TokenNotEqual: OpNotEqual, }, { diff --git a/zcl/zclsyntax/scan_tokens.go b/zcl/zclsyntax/scan_tokens.go index 75dfaaf..ac89994 100644 --- a/zcl/zclsyntax/scan_tokens.go +++ b/zcl/zclsyntax/scan_tokens.go @@ -26,11 +26,11 @@ var _zcltok_actions []byte = []byte{ 1, 58, 1, 59, 1, 60, 1, 61, 1, 62, 1, 63, 1, 64, 1, 65, 1, 66, 1, 67, 1, 68, 1, 69, - 1, 70, 1, 71, 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, 70, 1, 71, 1, 72, 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{ @@ -152,17 +152,17 @@ var _zcltok_key_offsets []int16 = []int16{ 5910, 5915, 5919, 5921, 5928, 5932, 5940, 5944, 5945, 5947, 5949, 5951, 5953, 5955, 5956, 5957, 5959, 5961, 5963, 5964, 5965, 5966, 5967, 5969, - 5971, 5973, 5974, 5975, 6048, 6049, 6050, 6051, - 6052, 6053, 6054, 6056, 6057, 6062, 6064, 6065, - 6108, 6109, 6110, 6112, 6117, 6121, 6121, 6123, - 6125, 6136, 6146, 6154, 6155, 6157, 6158, 6162, - 6166, 6176, 6180, 6187, 6198, 6205, 6209, 6215, - 6226, 6258, 6307, 6322, 6337, 6342, 6344, 6349, - 6381, 6389, 6391, 6413, 6435, 6437, 6453, 6469, - 6484, 6493, 6507, 6521, 6537, 6538, 6539, 6540, - 6541, 6543, 6545, 6547, 6561, 6575, 6576, 6577, - 6579, 6581, 6583, 6597, 6611, 6612, 6613, 6615, - 6617, + 5971, 5973, 5974, 5975, 6049, 6050, 6051, 6052, + 6053, 6054, 6055, 6057, 6058, 6063, 6065, 6066, + 6067, 6110, 6111, 6112, 6114, 6119, 6123, 6123, + 6125, 6127, 6138, 6148, 6156, 6157, 6159, 6160, + 6164, 6168, 6178, 6182, 6189, 6200, 6207, 6211, + 6217, 6228, 6260, 6309, 6324, 6339, 6344, 6346, + 6351, 6383, 6391, 6393, 6415, 6437, 6439, 6455, + 6471, 6486, 6495, 6509, 6523, 6539, 6540, 6541, + 6542, 6543, 6545, 6547, 6549, 6563, 6577, 6578, + 6579, 6581, 6583, 6585, 6599, 6613, 6614, 6615, + 6617, 6619, } var _zcltok_trans_keys []byte = []byte{ @@ -184,7 +184,7 @@ var _zcltok_trans_keys []byte = []byte{ 233, 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, + 182, 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, @@ -914,86 +914,86 @@ var _zcltok_trans_keys []byte = []byte{ 191, 128, 191, 123, 123, 10, 123, 128, 191, 128, 191, 128, 191, 123, 123, 9, 10, 13, 32, 33, 34, 35, 38, 47, - 60, 62, 64, 92, 95, 123, 124, 125, - 126, 127, 194, 195, 198, 199, 203, 204, - 205, 206, 207, 210, 212, 213, 214, 215, - 216, 217, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 233, 234, 237, 238, - 239, 240, 0, 39, 40, 46, 48, 57, - 58, 63, 65, 90, 91, 96, 97, 122, - 192, 193, 196, 218, 229, 236, 241, 247, - 9, 10, 32, 61, 10, 38, 42, 47, - 42, 46, 69, 101, 48, 57, 60, 61, - 61, 95, 194, 195, 198, 199, 203, 204, - 205, 206, 207, 210, 212, 213, 214, 215, - 216, 217, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 233, 234, 237, 239, - 240, 243, 48, 57, 65, 90, 97, 122, - 196, 218, 229, 236, 124, 125, 128, 191, - 170, 181, 186, 128, 191, 151, 183, 128, - 255, 192, 255, 0, 127, 173, 130, 133, - 146, 159, 165, 171, 175, 191, 192, 255, - 181, 190, 128, 175, 176, 183, 184, 185, - 186, 191, 134, 139, 141, 162, 128, 135, - 136, 255, 182, 130, 137, 176, 151, 152, - 154, 160, 136, 191, 192, 255, 128, 143, - 144, 170, 171, 175, 176, 178, 179, 191, - 128, 159, 160, 191, 176, 128, 138, 139, - 173, 174, 255, 148, 150, 164, 167, 173, - 176, 185, 189, 190, 192, 255, 144, 128, - 145, 146, 175, 176, 191, 128, 140, 141, - 255, 166, 176, 178, 191, 192, 255, 186, - 128, 137, 138, 170, 171, 179, 180, 181, - 182, 191, 160, 161, 162, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, - 128, 191, 128, 129, 130, 131, 137, 138, - 139, 140, 141, 142, 143, 144, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 182, 183, 184, 188, 189, 190, - 191, 132, 187, 129, 130, 132, 133, 134, - 176, 177, 178, 179, 180, 181, 182, 183, - 128, 191, 128, 129, 130, 131, 132, 133, - 134, 135, 144, 136, 143, 145, 191, 192, - 255, 182, 183, 184, 128, 191, 128, 191, - 191, 128, 190, 192, 255, 128, 146, 147, - 148, 152, 153, 154, 155, 156, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, - 176, 129, 191, 192, 255, 158, 159, 128, - 157, 160, 191, 192, 255, 128, 191, 164, - 169, 171, 172, 173, 174, 175, 180, 181, - 182, 183, 184, 185, 187, 188, 189, 190, - 191, 128, 163, 165, 186, 144, 145, 146, - 147, 148, 150, 151, 152, 155, 157, 158, - 160, 170, 171, 172, 175, 128, 159, 161, - 169, 173, 191, 128, 191, 10, 13, 33, - 34, 36, 92, 128, 191, 192, 223, 224, + 60, 61, 62, 64, 92, 95, 123, 124, + 125, 126, 127, 194, 195, 198, 199, 203, + 204, 205, 206, 207, 210, 212, 213, 214, + 215, 216, 217, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 233, 234, 237, + 238, 239, 240, 0, 39, 40, 46, 48, + 57, 58, 63, 65, 90, 91, 96, 97, + 122, 192, 193, 196, 218, 229, 236, 241, + 247, 9, 10, 32, 61, 10, 38, 42, + 47, 42, 46, 69, 101, 48, 57, 60, + 61, 61, 61, 95, 194, 195, 198, 199, + 203, 204, 205, 206, 207, 210, 212, 213, + 214, 215, 216, 217, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 233, 234, + 237, 239, 240, 243, 48, 57, 65, 90, + 97, 122, 196, 218, 229, 236, 124, 125, + 128, 191, 170, 181, 186, 128, 191, 151, + 183, 128, 255, 192, 255, 0, 127, 173, + 130, 133, 146, 159, 165, 171, 175, 191, + 192, 255, 181, 190, 128, 175, 176, 183, + 184, 185, 186, 191, 134, 139, 141, 162, + 128, 135, 136, 255, 182, 130, 137, 176, + 151, 152, 154, 160, 136, 191, 192, 255, + 128, 143, 144, 170, 171, 175, 176, 178, + 179, 191, 128, 159, 160, 191, 176, 128, + 138, 139, 173, 174, 255, 148, 150, 164, + 167, 173, 176, 185, 189, 190, 192, 255, + 144, 128, 145, 146, 175, 176, 191, 128, + 140, 141, 255, 166, 176, 178, 191, 192, + 255, 186, 128, 137, 138, 170, 171, 179, + 180, 181, 182, 191, 160, 161, 162, 164, + 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 128, 191, 128, 129, 130, 131, + 137, 138, 139, 140, 141, 142, 143, 144, + 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 182, 183, 184, 188, + 189, 190, 191, 132, 187, 129, 130, 132, + 133, 134, 176, 177, 178, 179, 180, 181, + 182, 183, 128, 191, 128, 129, 130, 131, + 132, 133, 134, 135, 144, 136, 143, 145, + 191, 192, 255, 182, 183, 184, 128, 191, + 128, 191, 191, 128, 190, 192, 255, 128, + 146, 147, 148, 152, 153, 154, 155, 156, + 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 129, 191, 192, 255, 158, + 159, 128, 157, 160, 191, 192, 255, 128, + 191, 164, 169, 171, 172, 173, 174, 175, + 180, 181, 182, 183, 184, 185, 187, 188, + 189, 190, 191, 128, 163, 165, 186, 144, + 145, 146, 147, 148, 150, 151, 152, 155, + 157, 158, 160, 170, 171, 172, 175, 128, + 159, 161, 169, 173, 191, 128, 191, 10, + 13, 33, 34, 36, 92, 128, 191, 192, + 223, 224, 239, 240, 247, 248, 255, 10, + 13, 33, 34, 36, 92, 128, 191, 192, + 223, 224, 239, 240, 247, 248, 255, 10, + 13, 33, 36, 92, 128, 191, 192, 223, + 224, 239, 240, 247, 248, 255, 33, 36, + 92, 192, 223, 224, 239, 240, 247, 10, + 13, 33, 34, 36, 92, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 33, - 34, 36, 92, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 10, 13, 33, - 36, 92, 128, 191, 192, 223, 224, 239, - 240, 247, 248, 255, 33, 36, 92, 192, - 223, 224, 239, 240, 247, 10, 13, 33, - 34, 36, 92, 192, 223, 224, 239, 240, + 34, 36, 92, 128, 223, 224, 239, 240, 247, 248, 255, 10, 13, 33, 34, 36, - 92, 128, 223, 224, 239, 240, 247, 248, - 255, 10, 13, 33, 34, 36, 92, 128, - 191, 192, 223, 224, 239, 240, 247, 248, - 255, 123, 126, 123, 126, 128, 191, 128, - 191, 128, 191, 10, 13, 33, 36, 128, - 191, 192, 223, 224, 239, 240, 247, 248, - 255, 10, 13, 33, 36, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 126, - 126, 128, 191, 128, 191, 128, 191, 10, - 13, 33, 36, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 10, 13, 33, + 92, 128, 191, 192, 223, 224, 239, 240, + 247, 248, 255, 123, 126, 123, 126, 128, + 191, 128, 191, 128, 191, 10, 13, 33, 36, 128, 191, 192, 223, 224, 239, 240, - 247, 248, 255, 126, 126, 128, 191, 128, - 191, 128, 191, + 247, 248, 255, 10, 13, 33, 36, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 126, 126, 128, 191, 128, 191, 128, + 191, 10, 13, 33, 36, 128, 191, 192, + 223, 224, 239, 240, 247, 248, 255, 10, + 13, 33, 36, 128, 191, 192, 223, 224, + 239, 240, 247, 248, 255, 126, 126, 128, + 191, 128, 191, 128, 191, } var _zcltok_single_lengths []byte = []byte{ @@ -1115,17 +1115,17 @@ var _zcltok_single_lengths []byte = []byte{ 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, 51, 1, 1, 1, 1, - 1, 1, 2, 1, 3, 2, 1, 33, - 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, 6, 5, - 3, 6, 6, 6, 1, 1, 1, 1, + 0, 1, 1, 52, 1, 1, 1, 1, + 1, 1, 2, 1, 3, 2, 1, 1, + 33, 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, 6, + 5, 3, 6, 6, 6, 1, 1, 1, + 1, 0, 0, 0, 4, 4, 1, 1, 0, 0, 0, 4, 4, 1, 1, 0, - 0, 0, 4, 4, 1, 1, 0, 0, - 0, + 0, 0, } var _zcltok_range_lengths []byte = []byte{ @@ -1248,16 +1248,16 @@ var _zcltok_range_lengths []byte = []byte{ 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, 1, 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, 5, 5, - 3, 4, 4, 5, 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, 5, + 5, 3, 4, 4, 5, 0, 0, 0, + 0, 1, 1, 1, 5, 5, 0, 0, 1, 1, 1, 5, 5, 0, 0, 1, - 1, 1, 5, 5, 0, 0, 1, 1, - 1, + 1, 1, } var _zcltok_index_offsets []int16 = []int16{ @@ -1379,17 +1379,17 @@ var _zcltok_index_offsets []int16 = []int16{ 4691, 4696, 4699, 4701, 4706, 4709, 4715, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4740, 4742, 4744, 4746, 4748, 4750, - 4752, 4754, 4756, 4758, 4821, 4823, 4825, 4827, - 4829, 4831, 4833, 4836, 4838, 4843, 4846, 4848, - 4887, 4889, 4891, 4893, 4898, 4902, 4903, 4905, - 4907, 4914, 4921, 4928, 4930, 4932, 4934, 4937, - 4940, 4946, 4949, 4954, 4961, 4966, 4969, 4973, - 4980, 5012, 5061, 5076, 5089, 5094, 5096, 5100, - 5131, 5137, 5139, 5160, 5180, 5182, 5194, 5206, - 5217, 5224, 5235, 5246, 5258, 5260, 5262, 5264, - 5266, 5268, 5270, 5272, 5282, 5292, 5294, 5296, - 5298, 5300, 5302, 5312, 5322, 5324, 5326, 5328, - 5330, + 4752, 4754, 4756, 4758, 4822, 4824, 4826, 4828, + 4830, 4832, 4834, 4837, 4839, 4844, 4847, 4849, + 4851, 4890, 4892, 4894, 4896, 4901, 4905, 4906, + 4908, 4910, 4917, 4924, 4931, 4933, 4935, 4937, + 4940, 4943, 4949, 4952, 4957, 4964, 4969, 4972, + 4976, 4983, 5015, 5064, 5079, 5092, 5097, 5099, + 5103, 5134, 5140, 5142, 5163, 5183, 5185, 5197, + 5209, 5220, 5227, 5238, 5249, 5261, 5263, 5265, + 5267, 5269, 5271, 5273, 5275, 5285, 5295, 5297, + 5299, 5301, 5303, 5305, 5315, 5325, 5327, 5329, + 5331, 5333, } var _zcltok_indicies []int16 = []int16{ @@ -1410,7 +1410,7 @@ var _zcltok_indicies []int16 = []int16{ 61, 62, 37, 39, 63, 41, 64, 65, 66, 11, 11, 11, 14, 38, 9, 44, 9, 11, 11, 11, 11, 9, 11, 11, - 11, 9, 11, 9, 11, 9, 11, 9, + 11, 9, 11, 9, 11, 11, 9, 9, 9, 9, 9, 9, 11, 9, 9, 9, 9, 11, 11, 11, 11, 11, 9, 9, 11, 9, 9, 11, 9, 11, 9, 9, @@ -1989,77 +1989,77 @@ var _zcltok_indicies []int16 = []int16{ 780, 779, 781, 782, 782, 779, 783, 779, 784, 781, 785, 782, 786, 782, 787, 788, 789, 790, 791, 792, 793, 794, 796, 797, - 798, 669, 669, 669, 799, 800, 801, 802, - 669, 805, 806, 808, 809, 810, 804, 811, + 798, 799, 669, 669, 669, 800, 801, 802, + 803, 669, 806, 807, 809, 810, 811, 805, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 832, 833, 834, 835, 836, - 837, 669, 795, 8, 795, 419, 795, 419, - 804, 807, 831, 838, 803, 787, 839, 788, - 840, 790, 841, 843, 842, 2, 1, 844, - 842, 3, 1, 842, 4, 3, 8, 847, - 847, 8, 846, 848, 849, 842, 850, 842, - 419, 852, 853, 488, 469, 854, 469, 855, - 856, 857, 858, 859, 860, 861, 862, 863, - 864, 865, 543, 866, 519, 867, 868, 869, - 870, 871, 872, 873, 874, 875, 876, 877, - 878, 419, 419, 419, 424, 564, 851, 879, - 842, 880, 842, 669, 881, 419, 419, 419, - 669, 881, 669, 669, 419, 881, 419, 881, - 419, 881, 419, 669, 669, 669, 669, 669, - 881, 419, 669, 669, 669, 419, 669, 419, - 881, 419, 669, 669, 669, 669, 419, 881, - 669, 419, 669, 419, 669, 419, 669, 669, - 419, 669, 881, 419, 669, 419, 669, 419, - 669, 881, 669, 419, 881, 669, 419, 669, - 419, 881, 669, 669, 669, 669, 669, 881, - 419, 419, 669, 419, 669, 881, 669, 419, - 881, 669, 669, 881, 419, 419, 669, 419, - 669, 419, 669, 881, 882, 883, 884, 885, - 886, 887, 888, 889, 890, 891, 892, 714, - 893, 894, 895, 896, 897, 898, 899, 900, - 901, 902, 903, 904, 903, 905, 906, 907, - 908, 909, 670, 881, 910, 911, 912, 913, - 914, 915, 916, 917, 918, 919, 920, 921, - 922, 923, 924, 925, 926, 927, 928, 724, - 929, 930, 931, 691, 932, 933, 934, 935, - 936, 937, 670, 938, 939, 940, 941, 942, - 943, 944, 945, 673, 946, 670, 673, 947, - 948, 949, 950, 682, 881, 951, 952, 953, - 954, 702, 955, 956, 682, 957, 958, 959, - 960, 961, 670, 881, 962, 921, 963, 964, - 965, 682, 966, 967, 673, 670, 682, 424, - 881, 931, 670, 673, 682, 424, 682, 424, - 968, 682, 881, 424, 673, 969, 970, 673, - 971, 972, 680, 973, 974, 975, 976, 977, - 927, 978, 979, 980, 981, 982, 983, 984, - 985, 986, 987, 988, 989, 946, 990, 673, - 682, 424, 881, 991, 992, 682, 670, 881, - 424, 670, 881, 673, 993, 730, 994, 995, - 996, 997, 998, 999, 1000, 1001, 670, 1002, - 1003, 1004, 1005, 1006, 1007, 670, 682, 881, - 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, - 1017, 1018, 1019, 1015, 1021, 1022, 1023, 1024, - 1008, 1020, 1008, 881, 1008, 881, 1025, 1025, - 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, - 1030, 766, 1034, 1034, 1035, 1034, 1035, 1029, - 1034, 767, 768, 1036, 1034, 766, 1034, 1034, - 1037, 1037, 1029, 1034, 767, 768, 1036, 1034, - 766, 1037, 1037, 1029, 1038, 1039, 1040, 766, - 1034, 1034, 1035, 1034, 1035, 1029, 767, 768, - 1036, 1034, 766, 1034, 1034, 1035, 1034, 1035, - 1029, 767, 768, 1036, 1034, 766, 1034, 1034, - 1035, 1034, 1035, 1029, 768, 767, 768, 1036, - 1034, 766, 1042, 766, 1044, 1043, 1045, 766, - 1047, 1046, 766, 1048, 770, 1048, 1049, 1048, - 772, 1050, 1051, 1052, 1053, 1054, 1055, 1056, - 1053, 774, 772, 1050, 1058, 1058, 1057, 775, - 776, 1059, 1057, 774, 1061, 1060, 1063, 1062, - 774, 1064, 775, 1064, 776, 1064, 780, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1068, 782, - 780, 1065, 1073, 1073, 1072, 783, 784, 1074, - 1072, 782, 1076, 1075, 1078, 1077, 782, 1079, - 783, 1079, 784, 1079, + 828, 829, 830, 831, 833, 834, 835, 836, + 837, 838, 669, 795, 8, 795, 419, 795, + 419, 805, 808, 832, 839, 804, 787, 840, + 788, 841, 790, 842, 844, 843, 2, 1, + 845, 843, 3, 1, 843, 4, 3, 8, + 848, 848, 8, 847, 849, 850, 843, 851, + 843, 852, 843, 419, 854, 855, 488, 469, + 856, 469, 857, 858, 859, 860, 861, 862, + 863, 864, 865, 866, 867, 543, 868, 519, + 869, 870, 871, 872, 873, 874, 875, 876, + 877, 878, 879, 880, 419, 419, 419, 424, + 564, 853, 881, 843, 882, 843, 669, 883, + 419, 419, 419, 669, 883, 669, 669, 419, + 883, 419, 883, 419, 883, 419, 669, 669, + 669, 669, 669, 883, 419, 669, 669, 669, + 419, 669, 419, 883, 419, 669, 669, 669, + 669, 419, 883, 669, 419, 669, 419, 669, + 419, 669, 669, 419, 669, 883, 419, 669, + 419, 669, 419, 669, 883, 669, 419, 883, + 669, 419, 669, 419, 883, 669, 669, 669, + 669, 669, 883, 419, 419, 669, 419, 669, + 883, 669, 419, 883, 669, 669, 883, 419, + 419, 669, 419, 669, 419, 669, 883, 884, + 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 714, 895, 896, 897, 898, 899, + 900, 901, 902, 903, 904, 905, 906, 905, + 907, 908, 909, 910, 911, 670, 883, 912, + 913, 914, 915, 916, 917, 918, 919, 920, + 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 724, 931, 932, 933, 691, 934, + 935, 936, 937, 938, 939, 670, 940, 941, + 942, 943, 944, 945, 946, 947, 673, 948, + 670, 673, 949, 950, 951, 952, 682, 883, + 953, 954, 955, 956, 702, 957, 958, 682, + 959, 960, 961, 962, 963, 670, 883, 964, + 923, 965, 966, 967, 682, 968, 969, 673, + 670, 682, 424, 883, 933, 670, 673, 682, + 424, 682, 424, 970, 682, 883, 424, 673, + 971, 972, 673, 973, 974, 680, 975, 976, + 977, 978, 979, 929, 980, 981, 982, 983, + 984, 985, 986, 987, 988, 989, 990, 991, + 948, 992, 673, 682, 424, 883, 993, 994, + 682, 670, 883, 424, 670, 883, 673, 995, + 730, 996, 997, 998, 999, 1000, 1001, 1002, + 1003, 670, 1004, 1005, 1006, 1007, 1008, 1009, + 670, 682, 883, 1011, 1012, 1013, 1014, 1015, + 1016, 1017, 1018, 1019, 1020, 1021, 1017, 1023, + 1024, 1025, 1026, 1010, 1022, 1010, 883, 1010, + 883, 1027, 1027, 1028, 1029, 1030, 1031, 1032, + 1033, 1034, 1035, 1032, 766, 1036, 1036, 1037, + 1036, 1037, 1031, 1036, 767, 768, 1038, 1036, + 766, 1036, 1036, 1039, 1039, 1031, 1036, 767, + 768, 1038, 1036, 766, 1039, 1039, 1031, 1040, + 1041, 1042, 766, 1036, 1036, 1037, 1036, 1037, + 1031, 767, 768, 1038, 1036, 766, 1036, 1036, + 1037, 1036, 1037, 1031, 767, 768, 1038, 1036, + 766, 1036, 1036, 1037, 1036, 1037, 1031, 768, + 767, 768, 1038, 1036, 766, 1044, 766, 1046, + 1045, 1047, 766, 1049, 1048, 766, 1050, 770, + 1050, 1051, 1050, 772, 1052, 1053, 1054, 1055, + 1056, 1057, 1058, 1055, 774, 772, 1052, 1060, + 1060, 1059, 775, 776, 1061, 1059, 774, 1063, + 1062, 1065, 1064, 774, 1066, 775, 1066, 776, + 1066, 780, 1067, 1068, 1069, 1070, 1071, 1072, + 1073, 1070, 782, 780, 1067, 1075, 1075, 1074, + 783, 784, 1076, 1074, 782, 1078, 1077, 1080, + 1079, 782, 1081, 783, 1081, 784, 1081, } var _zcltok_trans_targs []int16 = []int16{ @@ -2115,7 +2115,7 @@ var _zcltok_trans_targs []int16 = []int16{ 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 404, 405, 406, 407, 409, - 411, 413, 947, 959, 436, 437, 438, 439, + 411, 413, 947, 960, 436, 437, 438, 439, 416, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, @@ -2158,55 +2158,56 @@ var _zcltok_trans_targs []int16 = []int16{ 888, 889, 890, 891, 894, 895, 897, 898, 899, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 913, 914, 915, 916, - 919, 921, 922, 924, 926, 997, 998, 928, - 929, 997, 931, 1011, 1011, 1011, 1012, 935, - 936, 1013, 1014, 1018, 1018, 1018, 1019, 942, - 943, 1020, 1021, 948, 947, 949, 950, 951, - 947, 952, 953, 947, 954, 957, 958, 947, - 960, 947, 961, 947, 962, 963, 964, 965, + 919, 921, 922, 924, 926, 998, 999, 928, + 929, 998, 931, 1012, 1012, 1012, 1013, 935, + 936, 1014, 1015, 1019, 1019, 1019, 1020, 942, + 943, 1021, 1022, 948, 947, 949, 950, 951, + 947, 952, 953, 947, 954, 957, 958, 959, + 947, 961, 947, 962, 947, 963, 964, 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, 947, - 947, 947, 947, 947, 947, 947, 947, 4, - 6, 947, 947, 947, 414, 415, 419, 420, - 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 432, 434, 435, 467, 508, 523, - 530, 532, 534, 554, 557, 573, 686, 947, - 947, 947, 690, 691, 692, 693, 694, 695, - 696, 697, 698, 699, 700, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, - 721, 722, 724, 725, 726, 727, 728, 729, - 730, 731, 732, 733, 734, 735, 736, 737, - 738, 740, 741, 742, 744, 745, 746, 747, - 748, 749, 750, 751, 752, 753, 754, 755, - 756, 757, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 769, 770, 771, 772, 773, - 774, 775, 776, 777, 778, 779, 780, 781, - 782, 783, 784, 785, 786, 788, 789, 790, - 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, - 807, 808, 810, 811, 812, 813, 814, 815, - 816, 817, 818, 819, 820, 821, 822, 823, - 824, 825, 854, 879, 882, 883, 885, 892, - 893, 896, 900, 912, 917, 918, 920, 923, - 925, 997, 1004, 997, 1006, 999, 997, 1008, - 1009, 1010, 997, 927, 930, 1000, 1001, 1002, - 1003, 997, 1005, 997, 997, 1007, 997, 997, - 997, 932, 933, 938, 939, 1011, 1015, 1016, - 1017, 1011, 934, 937, 1011, 1011, 1011, 1011, - 1011, 940, 945, 946, 1018, 1022, 1023, 1024, - 1018, 941, 944, 1018, 1018, 1018, 1018, 1018, + 990, 991, 992, 993, 994, 995, 996, 997, + 947, 947, 947, 947, 947, 947, 947, 947, + 4, 6, 947, 947, 947, 947, 414, 415, + 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 432, 434, 435, 467, + 508, 523, 530, 532, 534, 554, 557, 573, + 686, 947, 947, 947, 690, 691, 692, 693, + 694, 695, 696, 697, 698, 699, 700, 702, + 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, + 736, 737, 738, 740, 741, 742, 744, 745, + 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 769, 770, 771, + 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 788, + 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, + 805, 806, 807, 808, 810, 811, 812, 813, + 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 854, 879, 882, 883, + 885, 892, 893, 896, 900, 912, 917, 918, + 920, 923, 925, 998, 1005, 998, 1007, 1000, + 998, 1009, 1010, 1011, 998, 927, 930, 1001, + 1002, 1003, 1004, 998, 1006, 998, 998, 1008, + 998, 998, 998, 932, 933, 938, 939, 1012, + 1016, 1017, 1018, 1012, 934, 937, 1012, 1012, + 1012, 1012, 1012, 940, 945, 946, 1019, 1023, + 1024, 1025, 1019, 941, 944, 1019, 1019, 1019, + 1019, 1019, } var _zcltok_trans_actions []byte = []byte{ - 123, 0, 143, 0, 0, 143, 115, 0, - 5, 119, 0, 0, 0, 0, 0, 0, + 125, 0, 145, 0, 0, 145, 117, 0, + 5, 121, 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, 0, 0, 0, 93, 0, 0, 0, + 0, 0, 0, 0, 95, 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, @@ -2253,7 +2254,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, 117, 140, 0, 0, 0, 0, + 0, 0, 119, 142, 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, @@ -2284,7 +2285,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, 121, 97, 0, 0, + 0, 0, 0, 0, 123, 99, 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, @@ -2297,21 +2298,21 @@ 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, 27, 5, 0, - 0, 29, 0, 49, 35, 47, 128, 0, - 0, 0, 0, 69, 55, 67, 134, 0, + 0, 29, 0, 49, 35, 47, 130, 0, + 0, 0, 0, 69, 55, 67, 136, 0, 0, 0, 0, 0, 71, 0, 0, 0, - 91, 152, 0, 83, 146, 5, 0, 85, - 0, 87, 0, 95, 0, 0, 0, 0, + 93, 154, 0, 85, 148, 5, 0, 0, + 87, 0, 89, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5, 5, 5, 149, 149, 149, - 149, 149, 149, 5, 5, 149, 5, 109, - 113, 99, 107, 73, 79, 105, 101, 0, - 0, 77, 75, 103, 0, 0, 0, 0, + 0, 0, 0, 5, 5, 5, 151, 151, + 151, 151, 151, 151, 5, 5, 151, 5, + 111, 115, 101, 109, 75, 81, 107, 103, + 0, 0, 79, 73, 77, 105, 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, 81, - 89, 111, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 83, 91, 113, 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, @@ -2329,13 +2330,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, - 0, 13, 0, 11, 0, 5, 15, 0, - 5, 5, 21, 0, 0, 0, 5, 5, - 5, 23, 0, 19, 9, 0, 17, 7, - 25, 0, 0, 0, 0, 37, 0, 131, - 131, 43, 0, 0, 41, 33, 39, 31, - 45, 0, 0, 0, 57, 0, 137, 137, - 63, 0, 0, 61, 53, 59, 51, 65, + 0, 0, 0, 13, 0, 11, 0, 5, + 15, 0, 5, 5, 21, 0, 0, 0, + 5, 5, 5, 23, 0, 19, 9, 0, + 17, 7, 25, 0, 0, 0, 0, 37, + 0, 133, 133, 43, 0, 0, 41, 33, + 39, 31, 45, 0, 0, 0, 57, 0, + 139, 139, 63, 0, 0, 61, 53, 59, + 51, 65, } var _zcltok_to_state_actions []byte = []byte{ @@ -2463,11 +2465,11 @@ 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, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 125, 0, 0, 0, 0, - 0, 0, 125, 0, 0, 0, 0, 0, - 0, + 0, 0, 0, 0, 127, 0, 0, 0, + 0, 0, 0, 127, 0, 0, 0, 0, + 0, 0, } var _zcltok_from_state_actions []byte = []byte{ @@ -2595,11 +2597,11 @@ 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, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, + 0, 0, } var _zcltok_eof_trans []int16 = []int16{ @@ -2721,26 +2723,26 @@ var _zcltok_eof_trans []int16 = []int16{ 669, 669, 669, 669, 669, 669, 669, 766, 766, 766, 766, 770, 770, 772, 774, 772, 772, 774, 0, 0, 780, 782, 780, 780, - 782, 0, 0, 0, 840, 841, 842, 843, - 1, 843, 843, 846, 847, 843, 843, 852, - 843, 843, 882, 882, 882, 882, 882, 882, - 882, 882, 882, 882, 882, 882, 882, 882, - 882, 882, 882, 882, 882, 882, 882, 882, - 882, 882, 882, 882, 882, 882, 882, 882, - 882, 882, 882, 882, 882, 0, 1035, 1035, - 1035, 1035, 1035, 1035, 1042, 1044, 1042, 1047, - 1049, 1049, 1049, 0, 1058, 1061, 1063, 1065, - 1065, 1065, 0, 1073, 1076, 1078, 1080, 1080, - 1080, + 782, 0, 0, 0, 841, 842, 843, 844, + 1, 844, 844, 847, 848, 844, 844, 844, + 854, 844, 844, 884, 884, 884, 884, 884, + 884, 884, 884, 884, 884, 884, 884, 884, + 884, 884, 884, 884, 884, 884, 884, 884, + 884, 884, 884, 884, 884, 884, 884, 884, + 884, 884, 884, 884, 884, 884, 0, 1037, + 1037, 1037, 1037, 1037, 1037, 1044, 1046, 1044, + 1049, 1051, 1051, 1051, 0, 1060, 1063, 1065, + 1067, 1067, 1067, 0, 1075, 1078, 1080, 1082, + 1082, 1082, } const zcltok_start int = 947 const zcltok_first_final int = 947 const zcltok_error int = 0 -const zcltok_en_stringTemplate int = 997 -const zcltok_en_heredocTemplate int = 1011 -const zcltok_en_bareTemplate int = 1018 +const zcltok_en_stringTemplate int = 998 +const zcltok_en_heredocTemplate int = 1012 +const zcltok_en_bareTemplate int = 1019 const zcltok_en_main int = 947 // line 15 "scan_tokens.rl" @@ -2752,7 +2754,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To Pos: start, } - // line 264 "scan_tokens.rl" + // line 266 "scan_tokens.rl" // Ragel state p := 0 // "Pointer" into data @@ -2778,7 +2780,7 @@ func scanTokens(data []byte, filename string, start zcl.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 297 "scan_tokens.rl" + // line 299 "scan_tokens.rl" // Make Go compiler happy _ = ts @@ -2798,7 +2800,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To f.emitToken(TokenType(b[0]), ts, te) } - // line 2810 "scan_tokens.go" + // line 2812 "scan_tokens.go" { top = 0 ts = 0 @@ -2806,7 +2808,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To act = 0 } - // line 2818 "scan_tokens.go" + // line 2820 "scan_tokens.go" { var _klen int var _trans int @@ -2831,7 +2833,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To ts = p - // line 2842 "scan_tokens.go" + // line 2844 "scan_tokens.go" } } @@ -2908,7 +2910,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To te = p + 1 case 4: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p + 1 { @@ -2927,7 +2929,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 5: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p + 1 { @@ -2946,7 +2948,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 6: - // line 75 "scan_tokens.rl" + // line 76 "scan_tokens.rl" te = p + 1 { @@ -2960,21 +2962,21 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } case 7: - // line 217 "scan_tokens.rl" + // line 218 "scan_tokens.rl" te = p + 1 { token(TokenInvalid) } case 8: - // line 218 "scan_tokens.rl" + // line 219 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 9: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p p-- @@ -2994,7 +2996,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 10: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p p-- @@ -3014,7 +3016,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 11: - // line 216 "scan_tokens.rl" + // line 217 "scan_tokens.rl" te = p p-- @@ -3022,7 +3024,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenQuotedLit) } case 12: - // line 217 "scan_tokens.rl" + // line 218 "scan_tokens.rl" te = p p-- @@ -3030,7 +3032,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenInvalid) } case 13: - // line 218 "scan_tokens.rl" + // line 219 "scan_tokens.rl" te = p p-- @@ -3038,29 +3040,29 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 14: - // line 216 "scan_tokens.rl" + // line 217 "scan_tokens.rl" p = (te) - 1 { token(TokenQuotedLit) } case 15: - // line 218 "scan_tokens.rl" + // line 219 "scan_tokens.rl" p = (te) - 1 { token(TokenBadUTF8) } case 16: - // line 121 "scan_tokens.rl" + // line 122 "scan_tokens.rl" act = 10 case 17: - // line 226 "scan_tokens.rl" + // line 227 "scan_tokens.rl" act = 11 case 18: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p + 1 { @@ -3079,7 +3081,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 19: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p + 1 { @@ -3098,7 +3100,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 20: - // line 102 "scan_tokens.rl" + // line 103 "scan_tokens.rl" te = p + 1 { @@ -3126,14 +3128,14 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenStringLit) } case 21: - // line 226 "scan_tokens.rl" + // line 227 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 22: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p p-- @@ -3153,7 +3155,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 23: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p p-- @@ -3173,7 +3175,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 24: - // line 121 "scan_tokens.rl" + // line 122 "scan_tokens.rl" te = p p-- @@ -3185,7 +3187,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenStringLit) } case 25: - // line 226 "scan_tokens.rl" + // line 227 "scan_tokens.rl" te = p p-- @@ -3193,7 +3195,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 26: - // line 121 "scan_tokens.rl" + // line 122 "scan_tokens.rl" p = (te) - 1 { @@ -3230,15 +3232,15 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } case 28: - // line 129 "scan_tokens.rl" + // line 130 "scan_tokens.rl" act = 14 case 29: - // line 233 "scan_tokens.rl" + // line 234 "scan_tokens.rl" act = 15 case 30: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p + 1 { @@ -3257,7 +3259,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 31: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p + 1 { @@ -3276,21 +3278,21 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 32: - // line 129 "scan_tokens.rl" + // line 130 "scan_tokens.rl" te = p + 1 { token(TokenStringLit) } case 33: - // line 233 "scan_tokens.rl" + // line 234 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } case 34: - // line 133 "scan_tokens.rl" + // line 134 "scan_tokens.rl" te = p p-- @@ -3310,7 +3312,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 35: - // line 143 "scan_tokens.rl" + // line 144 "scan_tokens.rl" te = p p-- @@ -3330,7 +3332,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } case 36: - // line 129 "scan_tokens.rl" + // line 130 "scan_tokens.rl" te = p p-- @@ -3338,7 +3340,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenStringLit) } case 37: - // line 233 "scan_tokens.rl" + // line 234 "scan_tokens.rl" te = p p-- @@ -3346,7 +3348,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To token(TokenBadUTF8) } case 38: - // line 129 "scan_tokens.rl" + // line 130 "scan_tokens.rl" p = (te) - 1 { @@ -3375,84 +3377,91 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } case 40: - // line 239 "scan_tokens.rl" + // line 240 "scan_tokens.rl" act = 18 case 41: - // line 241 "scan_tokens.rl" + // line 242 "scan_tokens.rl" act = 19 case 42: - // line 249 "scan_tokens.rl" + // line 251 "scan_tokens.rl" - act = 26 + act = 27 case 43: - // line 260 "scan_tokens.rl" - - act = 33 - case 44: - // line 261 "scan_tokens.rl" + // line 262 "scan_tokens.rl" act = 34 + case 44: + // line 263 "scan_tokens.rl" + + act = 35 case 45: - // line 242 "scan_tokens.rl" + // line 243 "scan_tokens.rl" te = p + 1 { token(TokenNewline) } case 46: - // line 244 "scan_tokens.rl" + // line 245 "scan_tokens.rl" + + te = p + 1 + { + token(TokenEqualOp) + } + case 47: + // line 246 "scan_tokens.rl" te = p + 1 { token(TokenNotEqual) } - case 47: - // line 245 "scan_tokens.rl" + case 48: + // line 247 "scan_tokens.rl" te = p + 1 { token(TokenGreaterThanEq) } - case 48: - // line 246 "scan_tokens.rl" + case 49: + // line 248 "scan_tokens.rl" te = p + 1 { token(TokenLessThanEq) } - case 49: - // line 247 "scan_tokens.rl" + case 50: + // line 249 "scan_tokens.rl" te = p + 1 { token(TokenAnd) } - case 50: - // line 248 "scan_tokens.rl" + case 51: + // line 250 "scan_tokens.rl" te = p + 1 { token(TokenOr) } - case 51: - // line 249 "scan_tokens.rl" + case 52: + // line 251 "scan_tokens.rl" te = p + 1 { selfToken() } - case 52: - // line 153 "scan_tokens.rl" + case 53: + // line 154 "scan_tokens.rl" te = p + 1 { token(TokenOBrace) braces++ } - case 53: - // line 158 "scan_tokens.rl" + case 54: + // line 159 "scan_tokens.rl" te = p + 1 { @@ -3472,8 +3481,8 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To braces-- } } - case 54: - // line 170 "scan_tokens.rl" + case 55: + // line 171 "scan_tokens.rl" te = p + 1 { @@ -3502,8 +3511,8 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To braces-- } } - case 55: - // line 70 "scan_tokens.rl" + case 56: + // line 71 "scan_tokens.rl" te = p + 1 { @@ -3512,12 +3521,12 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 997 + cs = 998 goto _again } } - case 56: - // line 80 "scan_tokens.rl" + case 57: + // line 81 "scan_tokens.rl" te = p + 1 { @@ -3543,115 +3552,115 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1011 + cs = 1012 goto _again } } - case 57: - // line 260 "scan_tokens.rl" + case 58: + // line 262 "scan_tokens.rl" te = p + 1 { token(TokenBadUTF8) } - case 58: - // line 261 "scan_tokens.rl" + case 59: + // line 263 "scan_tokens.rl" te = p + 1 { token(TokenInvalid) } - case 59: - // line 237 "scan_tokens.rl" - - te = p - p-- - case 60: // line 238 "scan_tokens.rl" te = p p-- - { - token(TokenNumberLit) - } + case 61: // line 239 "scan_tokens.rl" te = p p-- { - token(TokenIdent) + token(TokenNumberLit) } case 62: - // line 241 "scan_tokens.rl" + // line 240 "scan_tokens.rl" + + te = p + p-- + { + token(TokenIdent) + } + case 63: + // line 242 "scan_tokens.rl" te = p p-- { token(TokenComment) } - case 63: - // line 249 "scan_tokens.rl" + case 64: + // line 251 "scan_tokens.rl" te = p p-- { selfToken() } - case 64: - // line 259 "scan_tokens.rl" + case 65: + // line 261 "scan_tokens.rl" te = p p-- { token(TokenTabs) } - case 65: - // line 260 "scan_tokens.rl" + case 66: + // line 262 "scan_tokens.rl" te = p p-- { token(TokenBadUTF8) } - case 66: - // line 261 "scan_tokens.rl" + case 67: + // line 263 "scan_tokens.rl" te = p p-- { token(TokenInvalid) } - case 67: - // line 238 "scan_tokens.rl" - - p = (te) - 1 - { - token(TokenNumberLit) - } case 68: // line 239 "scan_tokens.rl" p = (te) - 1 { - token(TokenIdent) + token(TokenNumberLit) } case 69: - // line 249 "scan_tokens.rl" + // line 240 "scan_tokens.rl" + + p = (te) - 1 + { + token(TokenIdent) + } + case 70: + // line 251 "scan_tokens.rl" p = (te) - 1 { selfToken() } - case 70: - // line 260 "scan_tokens.rl" + case 71: + // line 262 "scan_tokens.rl" p = (te) - 1 { token(TokenBadUTF8) } - case 71: + case 72: // line 1 "NONE" switch act { @@ -3665,24 +3674,24 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To p = (te) - 1 token(TokenComment) } - case 26: + case 27: { p = (te) - 1 selfToken() } - case 33: + case 34: { p = (te) - 1 token(TokenBadUTF8) } - case 34: + case 35: { p = (te) - 1 token(TokenInvalid) } } - // line 3566 "scan_tokens.go" + // line 3573 "scan_tokens.go" } } @@ -3703,7 +3712,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To act = 0 - // line 3586 "scan_tokens.go" + // line 3593 "scan_tokens.go" } } @@ -3729,7 +3738,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To } } - // line 320 "scan_tokens.rl" + // line 322 "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/zcl/zclsyntax/scan_tokens.rl b/zcl/zclsyntax/scan_tokens.rl index e43a8e9..c058ad0 100644 --- a/zcl/zclsyntax/scan_tokens.rl +++ b/zcl/zclsyntax/scan_tokens.rl @@ -39,6 +39,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To # Symbols that just represent themselves are handled as a single rule. SelfToken = "[" | "]" | "(" | ")" | "." | "," | "*" | "/" | "+" | "-" | "=" | "<" | ">" | "!" | "?" | ":" | "\n" | "&" | "|" | "~" | "^" | ";" | "`"; + EqualOp = "=="; NotEqual = "!="; GreaterThanEqual = ">="; LessThanEqual = "<="; @@ -241,6 +242,7 @@ func scanTokens(data []byte, filename string, start zcl.Pos, mode scanMode) []To Comment => { token(TokenComment) }; Newline => { token(TokenNewline) }; + EqualOp => { token(TokenEqualOp); }; NotEqual => { token(TokenNotEqual); }; GreaterThanEqual => { token(TokenGreaterThanEq); }; LessThanEqual => { token(TokenLessThanEq); }; diff --git a/zcl/zclsyntax/token.go b/zcl/zclsyntax/token.go index f8b6dcc..ae62808 100644 --- a/zcl/zclsyntax/token.go +++ b/zcl/zclsyntax/token.go @@ -47,6 +47,7 @@ const ( TokenPercent TokenType = '%' TokenEqual TokenType = '=' + TokenEqualOp TokenType = '≔' TokenNotEqual TokenType = '≠' TokenLessThan TokenType = '<' TokenLessThanEq TokenType = '≤' diff --git a/zcl/zclsyntax/token_type_string.go b/zcl/zclsyntax/token_type_string.go index b05324a..6611f27 100644 --- a/zcl/zclsyntax/token_type_string.go +++ b/zcl/zclsyntax/token_type_string.go @@ -4,7 +4,7 @@ package zclsyntax import "fmt" -const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenStarStarTokenInvalidTokenBadUTF8" +const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenStarStarTokenInvalidTokenBadUTF8" var _TokenType_map = map[TokenType]string{ 0: _TokenType_name[0:8], @@ -48,14 +48,15 @@ var _TokenType_map = map[TokenType]string{ 8743: _TokenType_name[462:470], 8744: _TokenType_name[470:477], 8747: _TokenType_name[477:496], - 8800: _TokenType_name[496:509], - 8804: _TokenType_name[509:524], - 8805: _TokenType_name[524:542], - 9220: _TokenType_name[542:550], - 9225: _TokenType_name[550:559], - 10138: _TokenType_name[559:572], - 65533: _TokenType_name[572:584], - 128169: _TokenType_name[584:596], + 8788: _TokenType_name[496:508], + 8800: _TokenType_name[508:521], + 8804: _TokenType_name[521:536], + 8805: _TokenType_name[536:554], + 9220: _TokenType_name[554:562], + 9225: _TokenType_name[562:571], + 10138: _TokenType_name[571:584], + 65533: _TokenType_name[584:596], + 128169: _TokenType_name[596:608], } func (i TokenType) String() string {