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); skip(lexer);
while (lexer->lookahead != '\n') { while (lexer->lookahead != '\n') {
skip(lexer); skip(lexer);
if (lexer->eof(lexer)) {
return false;
}
} }
return true; 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+RMAPI2sxAdUp4Bq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ZyHaz0IyPUDvRPn10UYXui\n2ZGseauwU/PmvFNofxVbG0Dc55lOoxl31520K0h9cWxVHcYzUxPndQ1pltYkXiMm\n/596LHkJ+unMJszDVhAIOmc0PgECtGH1VG6EoTTFlMu7VJekKInkYNow4Q6cAVcr\n11F4meOs0DMZgzfeUjSnsKG7KsLHfr5bLw6FEEzobgtI2sXVMOJi+ypd3zTY+ACq\noRt6wkRFCUoEgap7SG6B2TwHPGe15VIFZJtcnOZqHdrnfJLVROPnA4dYhJVJj1v1\n9JFH/T6EIi6nIqnrlX+10zaatpzq2+AFX8LiWpr7C7S99LgH3cnFdssfmlqoG82t\n3BshYpDrIw1f72zy8+RCkK52OdjNpDoVwubwz6i8jldzoENqmsioyetyaVfe9GGH\nUdEPrUZ4BHLeGPjHclOPVEhjVBZuofQ/GgM2gmCUdn5tcVLjnIeLAv/sQXwkMxIe\n4m9QcPrxVAKOlDr9LhB0mVPr2kfc4yI/wYWEe+CniwcuvxJiOmjsyrENxfaFY30r\nQspTSDVt8hVfVISzpuEchtLVjuRO/ESpmeOF1rRTc1qL/CjetmidkedDm64EZjyK\njyXQv9IZPMTwOndF6AVLH7l1F0E=\n-----END CERTIFICATE-----\n",
"tectonic_metal_matchbox_client_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAr8S7x/tAS6W+aRW3X833OvNfxXjUJAiRkUV85Raln7tqVcTG\n/9iyRhWgNpUn/WU1/3qVobto4ZCURIwoQh0kWk8io1lafZJ+S6Znm3+0TKo7u6QM\navolJyetsOQkT/bIoZ7309fhk4Vu9GILjtZtxV7GDb4WqR9R7z77nYTdHMio/BQV\nk+Xg6rkOsMRyoR+B9JHGn9mvXLZSi8Q+3ABtsN6flPt7mTkhFFFvTgWxtzgVbeOR\nT/uFxIV/IMjtGseUIzvFGUQP6KCyCJb3Kp4rxSxIbi35mFqEWXjB7BVT/0pjx1mc\n5tSvGuFl7G4N/MmGe3ZqZCF4FalpiPGAInKrWQIDAQABAoIBA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Qob\nyOjaSz8CgYEAwr3aYp1CkKBXeUTNioLbyymhA4RqGPH/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) { module.exports = function make_grammar(dialect) {
const const PREC = {
PREC = { unary: 7,
unary: 7, binary_mult: 6,
binary_mult: 6, binary_add: 5,
binary_add: 5, binary_ord: 4,
binary_ord: 4, binary_comp: 3,
binary_comp: 3, binary_and: 2,
binary_and: 2, binary_or: 1,
binary_or: 1,
// if possible prefer string_literals to quoted templates // if possible prefer string_literals to quoted templates
string_lit: 2, string_lit: 2,
quoted_template: 1, quoted_template: 1,
} };
return grammar({ return grammar({
name: dialect, name: dialect,
externals: $ => [ externals: ($) => [
$.quoted_template_start, $.quoted_template_start,
$.quoted_template_end, $.quoted_template_end,
$._template_literal_chunk, $._template_literal_chunk,
@@ -28,361 +27,333 @@ module.exports = function make_grammar(dialect) {
$._shim, $._shim,
], ],
extras: $ => [ extras: ($) => [$.comment, $._whitespace],
$.comment,
$._whitespace,
],
rules: { rules: {
// also allow objects to handle .tfvars in json format // also allow objects to handle .tfvars in json format
config_file: $ => optional(choice($.body, $.object)), config_file: ($) => optional($.body),
body: $ => choice( body: ($) =>
$._shim, choice(
seq( $._shim,
optional($._shim), seq(optional($._shim), repeat1(choice($.attribute, $.block)))
repeat1(
choice(
$.attribute,
$.block,
),
),
), ),
),
attribute: $ => seq( attribute: ($) => seq($.identifier, "=", $.expression),
$.identifier,
'=',
$.expression,
),
block: $ => seq( block: ($) =>
$.identifier, seq(
repeat(choice($.string_lit, $.identifier)), $.identifier,
$.block_start, repeat(choice($.string_lit, $.identifier)),
optional($.body), $.block_start,
$.block_end, optional($.body),
), $.block_end
),
block_start: $ => '{', block_start: ($) => "{",
block_end: $ => '}', block_end: ($) => "}",
identifier: $ => token(seq( identifier: ($) =>
choice(/\p{ID_Start}/, '_'), token(
repeat(choice(/\p{ID_Continue}/, '-')), seq(
)), choice(/\p{ID_Start}/, "_"),
repeat(choice(/\p{ID_Continue}/, "-"))
)
),
expression: $ => prec.right(choice( expression: ($) => prec.right(choice($._expr_term, $.conditional)),
$._expr_term,
$.conditional,
)),
// operations are documented as expressions, but our real world samples // operations are documented as expressions, but our real world samples
// contain instances of operations without parentheses. think for example: // contain instances of operations without parentheses. think for example:
// x = a == "" && b != "" // x = a == "" && b != ""
_expr_term: $ => choice( _expr_term: ($) =>
$.literal_value, choice(
$.template_expr, $.literal_value,
$.collection_value, $.template_expr,
$.variable_expr, $.collection_value,
$.function_call, $.variable_expr,
$.for_expr, $.function_call,
$.operation, $.for_expr,
seq($._expr_term, $.index), $.operation,
seq($._expr_term, $.get_attr), seq($._expr_term, $.index),
seq($._expr_term, $.splat), seq($._expr_term, $.get_attr),
seq('(', $.expression, ')'), seq($._expr_term, $.splat),
), seq("(", $.expression, ")")
),
literal_value: $ => choice( literal_value: ($) =>
$.numeric_lit, choice($.numeric_lit, $.bool_lit, $.null_lit, $.string_lit),
$.bool_lit,
$.null_lit,
$.string_lit,
),
numeric_lit: $ => choice( numeric_lit: ($) =>
/[0-9]+(\.[0-9]+([eE][-+]?[0-9]+)?)?/, choice(/[0-9]+(\.[0-9]+([eE][-+]?[0-9]+)?)?/, /0x[0-9a-zA-Z]+/),
/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( string_lit: ($) =>
$.quoted_template_start, prec(
optional($.template_literal), PREC.string_lit,
$.quoted_template_end, seq(
)), $.quoted_template_start,
optional($.template_literal),
$.quoted_template_end
)
),
collection_value: ($) => choice($.tuple, $.object),
collection_value: $ => choice( _comma: ($) => ",",
$.tuple,
$.object,
),
_comma: $ => ',', tuple: ($) => seq($.tuple_start, optional($._tuple_elems), $.tuple_end),
tuple: $ => seq( tuple_start: ($) => "[",
$.tuple_start, tuple_end: ($) => "]",
optional($._tuple_elems),
$.tuple_end,
),
tuple_start: $ => '[', _tuple_elems: ($) =>
tuple_end: $ => ']', seq(
_tuple_elems: $ => seq(
$.expression,
repeat(seq(
$._comma,
$.expression, $.expression,
)), repeat(seq($._comma, $.expression)),
optional($._comma), optional($._comma)
), ),
object: $ => seq( object: ($) =>
$.object_start, seq($.object_start, optional($._object_elems), $.object_end),
optional($._object_elems),
$.object_end,
),
object_start: $ => '{', object_start: ($) => "{",
object_end: $ => '}', object_end: ($) => "}",
_object_elems: $ => seq( _object_elems: ($) =>
$.object_elem, seq(
repeat(seq( $.object_elem,
optional($._comma), repeat(seq(optional($._comma), $.object_elem)),
$.object_elem optional($._comma)
)), ),
optional($._comma),
),
object_elem: $ => seq( object_elem: ($) =>
field("key", $.expression), seq(
choice('=', ':'), field("key", $.expression),
field("val", $.expression), choice("=", ":"),
), field("val", $.expression)
),
index: $ => choice($.new_index, $.legacy_index), index: ($) => choice($.new_index, $.legacy_index),
new_index: $ => seq('[', $.expression, ']'), new_index: ($) => seq("[", $.expression, "]"),
legacy_index: $ => seq('.', /[0-9]+/), 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( attr_splat: ($) =>
'.*', prec.right(seq(".*", repeat(choice($.get_attr, $.index)))),
repeat(choice($.get_attr, $.index)),
)),
full_splat: $ => prec.right(seq( full_splat: ($) =>
'[*]', prec.right(seq("[*]", repeat(choice($.get_attr, $.index)))),
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( for_tuple_expr: ($) =>
$.tuple_start, seq(
$.for_intro, $.tuple_start,
$.expression, $.for_intro,
optional($.for_cond), $.expression,
$.tuple_end, optional($.for_cond),
), $.tuple_end
),
for_object_expr: $ => seq( for_object_expr: ($) =>
$.object_start, seq(
$.for_intro, $.object_start,
$.expression, $.for_intro,
'=>', $.expression,
$.expression, "=>",
optional($.ellipsis), $.expression,
optional($.for_cond), optional($.ellipsis),
$.object_end, optional($.for_cond),
), $.object_end
),
for_intro: $ => seq( for_intro: ($) =>
'for', seq(
$.identifier, "for",
optional(seq(',', $.identifier)), $.identifier,
'in', optional(seq(",", $.identifier)),
$.expression, "in",
':', $.expression,
), ":"
),
for_cond: $ => seq( for_cond: ($) => seq("if", $.expression),
'if',
$.expression,
),
variable_expr: $ => prec.right($.identifier), variable_expr: ($) => prec.right($.identifier),
function_call: $ => seq( function_call: ($) =>
$.identifier, seq(
$._function_call_start, $.identifier,
optional($.function_arguments), $._function_call_start,
$._function_call_end, optional($.function_arguments),
), $._function_call_end
),
_function_call_start: $ => '(', _function_call_start: ($) => "(",
_function_call_end: $ => ')', _function_call_end: ($) => ")",
function_arguments: $ => prec.right(seq( function_arguments: ($) =>
$.expression, prec.right(
repeat(seq($._comma, $.expression,)), seq(
optional(choice($._comma, $.ellipsis)), $.expression,
)), repeat(seq($._comma, $.expression)),
optional(choice($._comma, $.ellipsis))
)
),
ellipsis: $ => token('...'), ellipsis: ($) => token("..."),
conditional: $ => prec.left(seq( conditional: ($) =>
$.expression, prec.left(seq($.expression, "?", $.expression, ":", $.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 = [ const table = [
[PREC.binary_mult, choice('*', '/', '%')], [PREC.binary_mult, choice("*", "/", "%")],
[PREC.binary_add, choice('+', '-')], [PREC.binary_add, choice("+", "-")],
[PREC.binary_ord, choice('>', '>=', '<', '<=')], [PREC.binary_ord, choice(">", ">=", "<", "<=")],
[PREC.binary_comp, choice('==', '!=')], [PREC.binary_comp, choice("==", "!=")],
[PREC.binary_and, choice('&&')], [PREC.binary_and, choice("&&")],
[PREC.binary_or, choice('||')], [PREC.binary_or, choice("||")],
]; ];
return choice(...table.map(([precedence, operator]) => return choice(
prec.left(precedence, seq($._expr_term, operator, $._expr_term), ...table.map(([precedence, operator]) =>
)) prec.left(precedence, seq($._expr_term, operator, $._expr_term))
)
); );
}, },
template_expr: $ => choice( template_expr: ($) => choice($.quoted_template, $.heredoc_template),
$.quoted_template,
$.heredoc_template,
),
quoted_template: $ => prec(PREC.quoted_template, seq( quoted_template: ($) =>
$.quoted_template_start, prec(
optional($._template), PREC.quoted_template,
$.quoted_template_end, seq(
)), $.quoted_template_start,
optional($._template),
$.quoted_template_end
)
),
heredoc_template: $ => seq( heredoc_template: ($) =>
$.heredoc_start, seq(
$.heredoc_identifier, $.heredoc_start,
optional($._template), $.heredoc_identifier,
$.heredoc_identifier, optional($._template),
), $.heredoc_identifier
),
heredoc_start: $ => choice('<<', '<<-'), heredoc_start: ($) => choice("<<", "<<-"),
strip_marker: $ => '~', strip_marker: ($) => "~",
_template: $ => repeat1(choice( _template: ($) =>
$.template_interpolation, repeat1(
$.template_directive, choice(
$.template_literal, $.template_interpolation,
)), $.template_directive,
$.template_literal
)
),
template_literal: $ => prec.right(repeat1( template_literal: ($) => prec.right(repeat1($._template_literal_chunk)),
$._template_literal_chunk,
)),
template_interpolation: $ => seq( template_interpolation: ($) =>
$.template_interpolation_start, seq(
optional($.strip_marker), $.template_interpolation_start,
optional($.expression), optional($.strip_marker),
optional($.strip_marker), optional($.expression),
$.template_interpolation_end, optional($.strip_marker),
), $.template_interpolation_end
),
template_directive: $ => choice( template_directive: ($) => choice($.template_for, $.template_if),
$.template_for,
$.template_if,
),
template_for: $ => seq( template_for: ($) =>
$.template_for_start, seq($.template_for_start, optional($._template), $.template_for_end),
optional($._template),
$.template_for_end,
),
template_for_start: $ => seq( template_for_start: ($) =>
$.template_directive_start, seq(
optional($.strip_marker), $.template_directive_start,
"for", optional($.strip_marker),
$.identifier, "for",
optional(seq(",", $.identifier)), $.identifier,
"in", optional(seq(",", $.identifier)),
$.expression, "in",
optional($.strip_marker), $.expression,
$.template_directive_end optional($.strip_marker),
), $.template_directive_end
),
template_for_end: $ => seq( template_for_end: ($) =>
$.template_directive_start, seq(
optional($.strip_marker), $.template_directive_start,
"endfor", optional($.strip_marker),
optional($.strip_marker), "endfor",
$.template_directive_end optional($.strip_marker),
), $.template_directive_end
),
template_if: $ => seq( template_if: ($) =>
$.template_if_intro, seq(
optional($._template), $.template_if_intro,
optional(seq($.template_else_intro, optional($._template))), optional($._template),
$.template_if_end, optional(seq($.template_else_intro, optional($._template))),
), $.template_if_end
),
template_if_intro: $ => seq( template_if_intro: ($) =>
$.template_directive_start, seq(
optional($.strip_marker), $.template_directive_start,
"if", optional($.strip_marker),
$.expression, "if",
optional($.strip_marker), $.expression,
$.template_directive_end optional($.strip_marker),
), $.template_directive_end
),
template_else_intro: $ => seq( template_else_intro: ($) =>
$.template_directive_start, seq(
optional($.strip_marker), $.template_directive_start,
"else", optional($.strip_marker),
optional($.strip_marker), "else",
$.template_directive_end optional($.strip_marker),
), $.template_directive_end
),
template_if_end: $ => seq( template_if_end: ($) =>
$.template_directive_start, seq(
optional($.strip_marker), $.template_directive_start,
"endif", optional($.strip_marker),
optional($.strip_marker), "endif",
$.template_directive_end optional($.strip_marker),
), $.template_directive_end
),
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890 // http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(choice( comment: ($) =>
seq('#', /.*/), token(
seq('//', /.*/), choice(
seq( seq("#", /.*/),
'/*', seq("//", /.*/),
/[^*]*\*+([^/*][^*]*\*+)*/, seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, "/")
'/' )
) ),
)),
_whitespace: $ => token(/\s/), _whitespace: ($) => token(/\s/),
} },
}); });
} };

View File

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

View File

@@ -202,10 +202,6 @@
{ {
"type": "body", "type": "body",
"named": true "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); skip(lexer);
while (lexer->lookahead != '\n') { while (lexer->lookahead != '\n') {
skip(lexer); skip(lexer);
if (lexer->eof(lexer)) {
return false;
}
} }
return true; return true;
} }

View File

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