fix: hanging parser on trailing comment

This commit is contained in:
Michael Hoffmann
2023-04-08 20:13:43 +02:00
parent 486488948b
commit 3cf33b40d4
16 changed files with 14076 additions and 14411 deletions

View File

@@ -283,6 +283,9 @@ private:
skip(lexer);
while (lexer->lookahead != '\n') {
skip(lexer);
if (lexer->eof(lexer)) {
return false;
}
}
return true;
}

View File

@@ -1,41 +0,0 @@
{
"tectonic_admin_email": "admin@example.com",
"tectonic_admin_password": "password",
"tectonic_aws_etcd_ec2_type": "t2.medium",
"tectonic_aws_etcd_root_volume_size": 30,
"tectonic_aws_etcd_root_volume_type": "gp2",
"tectonic_aws_extra_tags": {
"test_tag": "testing"
},
"tectonic_aws_master_custom_subnets": {
"us-west-1a": "10.0.0.0/19",
"us-west-1c": "10.0.32.0/19"
},
"tectonic_aws_master_ec2_type": "t2.medium",
"tectonic_aws_master_root_volume_size": 30,
"tectonic_aws_master_root_volume_type": "gp2",
"tectonic_aws_private_endpoints": false,
"tectonic_aws_region": "us-west-1",
"tectonic_aws_ssh_key": "tectonic-jenkins",
"tectonic_aws_vpc_cidr_block": "10.0.0.0/16",
"tectonic_aws_worker_custom_subnets": {
"us-west-1a": "10.0.64.0/19",
"us-west-1c": "10.0.96.0/19"
},
"tectonic_aws_worker_ec2_type": "t2.medium",
"tectonic_aws_worker_root_volume_size": 30,
"tectonic_aws_worker_root_volume_type": "gp2",
"tectonic_base_domain": "tectonic.dev.coreos.systems",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_cluster_name": "test",
"tectonic_dns_name": "test",
"tectonic_etcd_count": 3,
"tectonic_kube_apiserver_service_ip": "10.3.0.1",
"tectonic_kube_dns_service_ip": "10.3.0.10",
"tectonic_kube_etcd_service_ip": "10.3.0.15",
"tectonic_license_path": "./license.txt",
"tectonic_master_count": 3,
"tectonic_pull_secret_path": "./pull_secret.json",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_worker_count": 3
}

View File

@@ -1,44 +0,0 @@
{
"tectonic_admin_email": "admin@example.com",
"tectonic_admin_password": "password",
"tectonic_base_domain": "unused",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_cluster_name": "my-cluster",
"tectonic_container_linux_version": "1353.8.0",
"tectonic_dns_name": "",
"tectonic_kube_apiserver_service_ip": "10.3.0.1",
"tectonic_kube_dns_service_ip": "10.3.0.10",
"tectonic_kube_etcd_service_ip": "10.3.0.15",
"tectonic_license_path": "./license.txt",
"tectonic_metal_controller_domain": "cluster.example.com",
"tectonic_metal_controller_domains": [
"node1.example.com"
],
"tectonic_metal_controller_macs": [
"52:54:00:a1:9c:ae"
],
"tectonic_metal_controller_names": [
"node1"
],
"tectonic_metal_ingress_domain": "tectonic.example.com",
"tectonic_metal_matchbox_ca": "-----BEGIN CERTIFICATE-----\nMIIFDTCCAvWgAwIBAgIJAIuXq10k2OFlMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV\nBAMMB2Zha2UtY2EwHhcNMTcwMjAxMjIxMzI0WhcNMjcwMTMwMjIxMzI0WjASMRAw\nDgYDVQQDDAdmYWtlLWNhMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\nzzHsB56F6oZjsVBKzfpicsG+mVHQ/QzA4jqRCbQ8Zr12NtUZKnPUVwDoFf4WTfmy\nZ0u8Uv+6/B/8un3LGsIaJEugPfRboc2oZKJcqfMJSFfLb/wkmT0D/1HJR60ml/M5\nwpHeh4vQ7BhktNsK90EjdlLvr1GDfevXArnye5ksEInOSX9nXVsGPrm0AGSffhmY\nuUAjY8f9IspJa1j4vL6NI89GWO4jqME+SUnuI4SYIkuQJoSElofAIX2b5Tk3dFya\nVKmAq2L89teCMYsciPbFa/Z2HvDNZ7pC17Ow7zr1f+V5BU18h3cLk610YNPcEBw0\nf94+mePsmMSMjUM0f+NMFyDERF+pys60/3qqVWrJe/FkJM6NDCyWXXXAfTxIwLq0\nCVrlWALdTc+RMAPI2sxAdUp4BqAuek4SjIg3FuoJrBs3EAUPfybclJ7g3HJwyXM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yymhA4RqGPH/69F1NQ7froLXb152SzOV\njWcrt4ogRacgHb8thuTedrjUiJJLoWhQ3KqzSA2pI3tTLIxrJePiMMpt1Xb2z9l6\nPikk0rvNVB/vrPeVjAdGY9TJC/vpz3om92DRDmUifu8rCFxIHE0GrQ0=\n-----END RSA PRIVATE KEY-----\n",
"tectonic_metal_matchbox_http_url": "http://matchbox.example.com:8080",
"tectonic_metal_matchbox_rpc_endpoint": "matchbox.example.com:8081",
"tectonic_metal_worker_domains": [
"node2.example.com",
"node3.example.com"
],
"tectonic_metal_worker_macs": [
"52:54:00:b2:2f:86",
"52:54:00:c3:61:77"
],
"tectonic_metal_worker_names": [
"node2",
"node3"
],
"tectonic_pull_secret_path": "./pull_secret.json",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_ssh_authorized_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCt3BebCHqnSsgpLjo4kVvyfY/z2BS8t27r/7du+O2pb4xYkr7n+KFpbOz523vMTpQ+o1jY4u4TgexglyT9nqasWgLOvo1qjD1agHme8LlTPQSk07rXqOB85Uq5p7ig2zoOejF6qXhcc3n1c7+HkxHrgpBENjLVHOBpzPBIAHkAGaZcl07OCqbsG5yxqEmSGiAlh/IiUVOZgdDMaGjCRFy0wk0mQaGD66DmnFc1H5CzcPjsxr0qO65e7lTGsE930KkO1Vc+RHCVwvhdXs+c2NhJ2/3740Kpes9n1/YullaWZUzlCPDXtRuy6JRbFbvy39JUgHWGWzB3d+3f8oJ/N4qZ cardno:000603633110"
}

View File

@@ -1,16 +0,0 @@
{
"tectonic_azure_etcd_storage_type": "Standard_LRS",
"tectonic_azure_etcd_vm_size": "Standard_D2_v2",
"tectonic_azure_master_storage_type": "Standard_LRS",
"tectonic_azure_master_vm_size": "Standard_D2_v2",
"tectonic_azure_private_cluster": "false",
"tectonic_azure_worker_storage_type": "Standard_LRS",
"tectonic_azure_worker_vm_size": "Standard_D2_v2",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "1",
"tectonic_master_count": "1",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,18 +0,0 @@
{
"tectonic_azure_etcd_storage_type": "Standard_LRS",
"tectonic_azure_etcd_vm_size": "Standard_D2_v2",
"tectonic_azure_external_dns_zone_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/long-term-dns-records-tectonic-ci/providers/Microsoft.Network/dnszones/azure.tectonic-ci.de",
"tectonic_azure_master_storage_type": "Standard_LRS",
"tectonic_azure_master_vm_size": "Standard_D2_v2",
"tectonic_azure_private_cluster": "false",
"tectonic_azure_worker_storage_type": "Standard_LRS",
"tectonic_azure_worker_vm_size": "Standard_D2_v2",
"tectonic_base_domain": "azure.tectonic-ci.de",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "1",
"tectonic_master_count": "1",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,12 +0,0 @@
{
"tectonic_azure_private_cluster": "false",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "0",
"tectonic_experimental": "false",
"tectonic_master_count": "1",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_stats_url": "https://stats-collector.tectonic.com",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,25 +0,0 @@
{
"tectonic_azure_etcd_storage_type": "Standard_LRS",
"tectonic_azure_etcd_vm_size": "Standard_D2_v2",
"tectonic_azure_external_master_subnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net/subnets/integ_external_master_subnet",
"tectonic_azure_external_nsg_api_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_api",
"tectonic_azure_external_nsg_master_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_master",
"tectonic_azure_external_nsg_worker_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_worker",
"tectonic_azure_external_resource_group": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net",
"tectonic_azure_external_vnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net",
"tectonic_azure_external_worker_subnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net/subnets/integ_external_worker_subnet",
"tectonic_azure_location": "eastus",
"tectonic_azure_master_storage_type": "Standard_LRS",
"tectonic_azure_master_vm_size": "Standard_D2_v2",
"tectonic_azure_private_cluster": "false",
"tectonic_azure_worker_storage_type": "Standard_LRS",
"tectonic_azure_worker_vm_size": "Standard_D2_v2",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "0",
"tectonic_self_hosted_etcd": "enabled",
"tectonic_master_count": "1",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,23 +0,0 @@
{
"tectonic_azure_etcd_storage_type": "Standard_LRS",
"tectonic_azure_etcd_vm_size": "Standard_D2_v2",
"tectonic_azure_external_master_subnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net/subnets/integ_external_master_subnet",
"tectonic_azure_external_nsg_api_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_api",
"tectonic_azure_external_nsg_master_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_master",
"tectonic_azure_external_nsg_worker_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/networkSecurityGroups/integ_external_sg_worker",
"tectonic_azure_external_resource_group": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net",
"tectonic_azure_external_vnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net",
"tectonic_azure_external_worker_subnet_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/integ_external_net/providers/Microsoft.Network/virtualNetworks/integ_external_net/subnets/integ_external_worker_subnet",
"tectonic_azure_location": "eastus",
"tectonic_azure_master_storage_type": "Standard_LRS",
"tectonic_azure_master_vm_size": "Standard_D2_v2",
"tectonic_azure_worker_storage_type": "Standard_LRS",
"tectonic_azure_worker_vm_size": "Standard_D2_v2",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "2",
"tectonic_master_count": "2",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,10 +0,0 @@
{
"tectonic_azure_external_dns_zone_id": "/subscriptions/060bce24-f340-4249-a6c6-51a765e2e4c0/resourceGroups/long-term-dns-records-tectonic-ci/providers/Microsoft.Network/dnszones/azure.tectonic-ci.de",
"tectonic_azure_private_cluster": "true",
"tectonic_base_domain": "azure.tectonic-ci.de",
"tectonic_container_linux_channel": "stable",
"tectonic_azure_vnet_cidr_block": "10.0.0.0/16",
"tectonic_etcd_count": "1",
"tectonic_master_count": "2",
"tectonic_worker_count": "1"
}

View File

@@ -1,17 +0,0 @@
{
"tectonic_azure_etcd_storage_type": "Standard_LRS",
"tectonic_azure_etcd_vm_size": "Standard_D2_v2",
"tectonic_azure_master_storage_type": "Standard_LRS",
"tectonic_azure_master_vm_size": "Standard_D2_v2",
"tectonic_azure_private_cluster": "false",
"tectonic_azure_worker_storage_type": "Standard_LRS",
"tectonic_azure_worker_vm_size": "Standard_D2_v2",
"tectonic_cluster_cidr": "10.2.0.0/16",
"tectonic_container_linux_channel": "stable",
"tectonic_etcd_count": "0",
"tectonic_self_hosted_etcd": "enabled",
"tectonic_master_count": "1",
"tectonic_service_cidr": "10.3.0.0/16",
"tectonic_vanilla_k8s": "false",
"tectonic_worker_count": "1"
}

View File

@@ -1,22 +1,21 @@
module.exports = function make_grammar(dialect) {
const
PREC = {
unary: 7,
binary_mult: 6,
binary_add: 5,
binary_ord: 4,
binary_comp: 3,
binary_and: 2,
binary_or: 1,
const PREC = {
unary: 7,
binary_mult: 6,
binary_add: 5,
binary_ord: 4,
binary_comp: 3,
binary_and: 2,
binary_or: 1,
// if possible prefer string_literals to quoted templates
string_lit: 2,
quoted_template: 1,
}
// if possible prefer string_literals to quoted templates
string_lit: 2,
quoted_template: 1,
};
return grammar({
name: dialect,
externals: $ => [
externals: ($) => [
$.quoted_template_start,
$.quoted_template_end,
$._template_literal_chunk,
@@ -28,361 +27,333 @@ module.exports = function make_grammar(dialect) {
$._shim,
],
extras: $ => [
$.comment,
$._whitespace,
],
extras: ($) => [$.comment, $._whitespace],
rules: {
// also allow objects to handle .tfvars in json format
config_file: $ => optional(choice($.body, $.object)),
config_file: ($) => optional($.body),
body: $ => choice(
$._shim,
seq(
optional($._shim),
repeat1(
choice(
$.attribute,
$.block,
),
),
body: ($) =>
choice(
$._shim,
seq(optional($._shim), repeat1(choice($.attribute, $.block)))
),
),
attribute: $ => seq(
$.identifier,
'=',
$.expression,
),
attribute: ($) => seq($.identifier, "=", $.expression),
block: $ => seq(
$.identifier,
repeat(choice($.string_lit, $.identifier)),
$.block_start,
optional($.body),
$.block_end,
),
block: ($) =>
seq(
$.identifier,
repeat(choice($.string_lit, $.identifier)),
$.block_start,
optional($.body),
$.block_end
),
block_start: $ => '{',
block_end: $ => '}',
block_start: ($) => "{",
block_end: ($) => "}",
identifier: $ => token(seq(
choice(/\p{ID_Start}/, '_'),
repeat(choice(/\p{ID_Continue}/, '-')),
)),
identifier: ($) =>
token(
seq(
choice(/\p{ID_Start}/, "_"),
repeat(choice(/\p{ID_Continue}/, "-"))
)
),
expression: $ => prec.right(choice(
$._expr_term,
$.conditional,
)),
expression: ($) => prec.right(choice($._expr_term, $.conditional)),
// operations are documented as expressions, but our real world samples
// contain instances of operations without parentheses. think for example:
// x = a == "" && b != ""
_expr_term: $ => choice(
$.literal_value,
$.template_expr,
$.collection_value,
$.variable_expr,
$.function_call,
$.for_expr,
$.operation,
seq($._expr_term, $.index),
seq($._expr_term, $.get_attr),
seq($._expr_term, $.splat),
seq('(', $.expression, ')'),
),
_expr_term: ($) =>
choice(
$.literal_value,
$.template_expr,
$.collection_value,
$.variable_expr,
$.function_call,
$.for_expr,
$.operation,
seq($._expr_term, $.index),
seq($._expr_term, $.get_attr),
seq($._expr_term, $.splat),
seq("(", $.expression, ")")
),
literal_value: $ => choice(
$.numeric_lit,
$.bool_lit,
$.null_lit,
$.string_lit,
),
literal_value: ($) =>
choice($.numeric_lit, $.bool_lit, $.null_lit, $.string_lit),
numeric_lit: $ => choice(
/[0-9]+(\.[0-9]+([eE][-+]?[0-9]+)?)?/,
/0x[0-9a-zA-Z]+/
),
numeric_lit: ($) =>
choice(/[0-9]+(\.[0-9]+([eE][-+]?[0-9]+)?)?/, /0x[0-9a-zA-Z]+/),
bool_lit: $ => choice('true', 'false'),
bool_lit: ($) => choice("true", "false"),
null_lit: $ => 'null',
null_lit: ($) => "null",
string_lit: $ => prec(PREC.string_lit, seq(
$.quoted_template_start,
optional($.template_literal),
$.quoted_template_end,
)),
string_lit: ($) =>
prec(
PREC.string_lit,
seq(
$.quoted_template_start,
optional($.template_literal),
$.quoted_template_end
)
),
collection_value: ($) => choice($.tuple, $.object),
collection_value: $ => choice(
$.tuple,
$.object,
),
_comma: ($) => ",",
_comma: $ => ',',
tuple: ($) => seq($.tuple_start, optional($._tuple_elems), $.tuple_end),
tuple: $ => seq(
$.tuple_start,
optional($._tuple_elems),
$.tuple_end,
),
tuple_start: ($) => "[",
tuple_end: ($) => "]",
tuple_start: $ => '[',
tuple_end: $ => ']',
_tuple_elems: $ => seq(
$.expression,
repeat(seq(
$._comma,
_tuple_elems: ($) =>
seq(
$.expression,
)),
optional($._comma),
),
repeat(seq($._comma, $.expression)),
optional($._comma)
),
object: $ => seq(
$.object_start,
optional($._object_elems),
$.object_end,
),
object: ($) =>
seq($.object_start, optional($._object_elems), $.object_end),
object_start: $ => '{',
object_end: $ => '}',
object_start: ($) => "{",
object_end: ($) => "}",
_object_elems: $ => seq(
$.object_elem,
repeat(seq(
optional($._comma),
$.object_elem
)),
optional($._comma),
),
_object_elems: ($) =>
seq(
$.object_elem,
repeat(seq(optional($._comma), $.object_elem)),
optional($._comma)
),
object_elem: $ => seq(
field("key", $.expression),
choice('=', ':'),
field("val", $.expression),
),
object_elem: ($) =>
seq(
field("key", $.expression),
choice("=", ":"),
field("val", $.expression)
),
index: $ => choice($.new_index, $.legacy_index),
index: ($) => choice($.new_index, $.legacy_index),
new_index: $ => seq('[', $.expression, ']'),
legacy_index: $ => seq('.', /[0-9]+/),
new_index: ($) => seq("[", $.expression, "]"),
legacy_index: ($) => seq(".", /[0-9]+/),
get_attr: $ => seq('.', $.identifier),
get_attr: ($) => seq(".", $.identifier),
splat: $ => choice($.attr_splat, $.full_splat),
splat: ($) => choice($.attr_splat, $.full_splat),
attr_splat: $ => prec.right(seq(
'.*',
repeat(choice($.get_attr, $.index)),
)),
attr_splat: ($) =>
prec.right(seq(".*", repeat(choice($.get_attr, $.index)))),
full_splat: $ => prec.right(seq(
'[*]',
repeat(choice($.get_attr, $.index)),
)),
full_splat: ($) =>
prec.right(seq("[*]", repeat(choice($.get_attr, $.index)))),
for_expr: $ => choice($.for_tuple_expr, $.for_object_expr),
for_expr: ($) => choice($.for_tuple_expr, $.for_object_expr),
for_tuple_expr: $ => seq(
$.tuple_start,
$.for_intro,
$.expression,
optional($.for_cond),
$.tuple_end,
),
for_tuple_expr: ($) =>
seq(
$.tuple_start,
$.for_intro,
$.expression,
optional($.for_cond),
$.tuple_end
),
for_object_expr: $ => seq(
$.object_start,
$.for_intro,
$.expression,
'=>',
$.expression,
optional($.ellipsis),
optional($.for_cond),
$.object_end,
),
for_object_expr: ($) =>
seq(
$.object_start,
$.for_intro,
$.expression,
"=>",
$.expression,
optional($.ellipsis),
optional($.for_cond),
$.object_end
),
for_intro: $ => seq(
'for',
$.identifier,
optional(seq(',', $.identifier)),
'in',
$.expression,
':',
),
for_intro: ($) =>
seq(
"for",
$.identifier,
optional(seq(",", $.identifier)),
"in",
$.expression,
":"
),
for_cond: $ => seq(
'if',
$.expression,
),
for_cond: ($) => seq("if", $.expression),
variable_expr: $ => prec.right($.identifier),
variable_expr: ($) => prec.right($.identifier),
function_call: $ => seq(
$.identifier,
$._function_call_start,
optional($.function_arguments),
$._function_call_end,
),
function_call: ($) =>
seq(
$.identifier,
$._function_call_start,
optional($.function_arguments),
$._function_call_end
),
_function_call_start: $ => '(',
_function_call_end: $ => ')',
_function_call_start: ($) => "(",
_function_call_end: ($) => ")",
function_arguments: $ => prec.right(seq(
$.expression,
repeat(seq($._comma, $.expression,)),
optional(choice($._comma, $.ellipsis)),
)),
function_arguments: ($) =>
prec.right(
seq(
$.expression,
repeat(seq($._comma, $.expression)),
optional(choice($._comma, $.ellipsis))
)
),
ellipsis: $ => token('...'),
ellipsis: ($) => token("..."),
conditional: $ => prec.left(seq(
$.expression,
'?',
$.expression,
':',
$.expression,
)),
conditional: ($) =>
prec.left(seq($.expression, "?", $.expression, ":", $.expression)),
operation: $ => choice($.unary_operation, $.binary_operation),
operation: ($) => choice($.unary_operation, $.binary_operation),
unary_operation: $ => prec.left(PREC.unary, seq(choice('-', '!'), $._expr_term)),
unary_operation: ($) =>
prec.left(PREC.unary, seq(choice("-", "!"), $._expr_term)),
binary_operation: $ => {
binary_operation: ($) => {
const table = [
[PREC.binary_mult, choice('*', '/', '%')],
[PREC.binary_add, choice('+', '-')],
[PREC.binary_ord, choice('>', '>=', '<', '<=')],
[PREC.binary_comp, choice('==', '!=')],
[PREC.binary_and, choice('&&')],
[PREC.binary_or, choice('||')],
[PREC.binary_mult, choice("*", "/", "%")],
[PREC.binary_add, choice("+", "-")],
[PREC.binary_ord, choice(">", ">=", "<", "<=")],
[PREC.binary_comp, choice("==", "!=")],
[PREC.binary_and, choice("&&")],
[PREC.binary_or, choice("||")],
];
return choice(...table.map(([precedence, operator]) =>
prec.left(precedence, seq($._expr_term, operator, $._expr_term),
))
return choice(
...table.map(([precedence, operator]) =>
prec.left(precedence, seq($._expr_term, operator, $._expr_term))
)
);
},
template_expr: $ => choice(
$.quoted_template,
$.heredoc_template,
),
template_expr: ($) => choice($.quoted_template, $.heredoc_template),
quoted_template: $ => prec(PREC.quoted_template, seq(
$.quoted_template_start,
optional($._template),
$.quoted_template_end,
)),
quoted_template: ($) =>
prec(
PREC.quoted_template,
seq(
$.quoted_template_start,
optional($._template),
$.quoted_template_end
)
),
heredoc_template: $ => seq(
$.heredoc_start,
$.heredoc_identifier,
optional($._template),
$.heredoc_identifier,
),
heredoc_template: ($) =>
seq(
$.heredoc_start,
$.heredoc_identifier,
optional($._template),
$.heredoc_identifier
),
heredoc_start: $ => choice('<<', '<<-'),
heredoc_start: ($) => choice("<<", "<<-"),
strip_marker: $ => '~',
strip_marker: ($) => "~",
_template: $ => repeat1(choice(
$.template_interpolation,
$.template_directive,
$.template_literal,
)),
_template: ($) =>
repeat1(
choice(
$.template_interpolation,
$.template_directive,
$.template_literal
)
),
template_literal: $ => prec.right(repeat1(
$._template_literal_chunk,
)),
template_literal: ($) => prec.right(repeat1($._template_literal_chunk)),
template_interpolation: $ => seq(
$.template_interpolation_start,
optional($.strip_marker),
optional($.expression),
optional($.strip_marker),
$.template_interpolation_end,
),
template_interpolation: ($) =>
seq(
$.template_interpolation_start,
optional($.strip_marker),
optional($.expression),
optional($.strip_marker),
$.template_interpolation_end
),
template_directive: $ => choice(
$.template_for,
$.template_if,
),
template_directive: ($) => choice($.template_for, $.template_if),
template_for: $ => seq(
$.template_for_start,
optional($._template),
$.template_for_end,
),
template_for: ($) =>
seq($.template_for_start, optional($._template), $.template_for_end),
template_for_start: $ => seq(
$.template_directive_start,
optional($.strip_marker),
"for",
$.identifier,
optional(seq(",", $.identifier)),
"in",
$.expression,
optional($.strip_marker),
$.template_directive_end
),
template_for_start: ($) =>
seq(
$.template_directive_start,
optional($.strip_marker),
"for",
$.identifier,
optional(seq(",", $.identifier)),
"in",
$.expression,
optional($.strip_marker),
$.template_directive_end
),
template_for_end: $ => seq(
$.template_directive_start,
optional($.strip_marker),
"endfor",
optional($.strip_marker),
$.template_directive_end
),
template_for_end: ($) =>
seq(
$.template_directive_start,
optional($.strip_marker),
"endfor",
optional($.strip_marker),
$.template_directive_end
),
template_if: $ => seq(
$.template_if_intro,
optional($._template),
optional(seq($.template_else_intro, optional($._template))),
$.template_if_end,
),
template_if: ($) =>
seq(
$.template_if_intro,
optional($._template),
optional(seq($.template_else_intro, optional($._template))),
$.template_if_end
),
template_if_intro: $ => seq(
$.template_directive_start,
optional($.strip_marker),
"if",
$.expression,
optional($.strip_marker),
$.template_directive_end
),
template_if_intro: ($) =>
seq(
$.template_directive_start,
optional($.strip_marker),
"if",
$.expression,
optional($.strip_marker),
$.template_directive_end
),
template_else_intro: $ => seq(
$.template_directive_start,
optional($.strip_marker),
"else",
optional($.strip_marker),
$.template_directive_end
),
template_else_intro: ($) =>
seq(
$.template_directive_start,
optional($.strip_marker),
"else",
optional($.strip_marker),
$.template_directive_end
),
template_if_end: $ => seq(
$.template_directive_start,
optional($.strip_marker),
"endif",
optional($.strip_marker),
$.template_directive_end
),
template_if_end: ($) =>
seq(
$.template_directive_start,
optional($.strip_marker),
"endif",
optional($.strip_marker),
$.template_directive_end
),
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(choice(
seq('#', /.*/),
seq('//', /.*/),
seq(
'/*',
/[^*]*\*+([^/*][^*]*\*+)*/,
'/'
)
)),
comment: ($) =>
token(
choice(
seq("#", /.*/),
seq("//", /.*/),
seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, "/")
)
),
_whitespace: $ => token(/\s/),
}
_whitespace: ($) => token(/\s/),
},
});
}
};

View File

@@ -5,17 +5,8 @@
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "body"
},
{
"type": "SYMBOL",
"name": "object"
}
]
"type": "SYMBOL",
"name": "body"
},
{
"type": "BLANK"

View File

@@ -202,10 +202,6 @@
{
"type": "body",
"named": true
},
{
"type": "object",
"named": true
}
]
}

27680
src/parser.c

File diff suppressed because it is too large Load Diff

View File

@@ -283,6 +283,9 @@ private:
skip(lexer);
while (lexer->lookahead != '\n') {
skip(lexer);
if (lexer->eof(lexer)) {
return false;
}
}
return true;
}

View File

@@ -144,3 +144,14 @@ block {
(variable_expr
(identifier)))))
(block_end))))
================================================================================
comment at end of file
================================================================================
# foo
--------------------------------------------------------------------------------
(config_file
(body)
(comment))