tree-sitter-ssh-client-config 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grammar.js ADDED
@@ -0,0 +1,848 @@
1
+ module.exports = grammar({
2
+ name: 'sshclientconfig',
3
+
4
+ extras: $ => [
5
+ $.comment,
6
+ /\s/,
7
+ /\\\r?\n/,
8
+ /\\( |\t|\v|\f)/
9
+ ],
10
+
11
+ rules: {
12
+ client_config: $ => repeat($._option),
13
+
14
+ _option: $ => choice(
15
+ $.host,
16
+ $.match,
17
+ $.add_keys_to_agent,
18
+ $.address_family,
19
+ $.batch_mode,
20
+ $.bind_address,
21
+ $.bind_interface,
22
+ $.canonical_domains,
23
+ $.canonicalize_fallback_local,
24
+ $.canonicalize_hostname,
25
+ $.canonicalize_max_dots,
26
+ $.canonicalize_permitted_cnames,
27
+ $.ca_signature_algorithms,
28
+ $.certificate_file,
29
+ $.challenge_response_authentication,
30
+ $.check_host_ip,
31
+ $.cipher,
32
+ $.ciphers,
33
+ $.clear_all_forwardings,
34
+ $.compression,
35
+ $.connection_attempts,
36
+ $.connect_timeout,
37
+ $.control_master,
38
+ $.control_path,
39
+ $.control_persist,
40
+ $.dynamic_forward,
41
+ $.enable_ssh_keysign,
42
+ $.escape_char,
43
+ $.exit_on_forward_failure,
44
+ $.fingerprint_hash,
45
+ $.fork_after_authentication,
46
+ $.forward_agent,
47
+ $.forward_x11,
48
+ $.forward_x11_timeout,
49
+ $.forward_x11_trusted,
50
+ $.gateway_ports,
51
+ $.global_known_hosts_file,
52
+ $.gssapi_authentication,
53
+ $.gssapi_client_identity,
54
+ $.gssapi_delegate_credentials,
55
+ $.gssapi_key_exchange,
56
+ $.gssapi_renewal_forces_rekey,
57
+ $.gssapi_server_identity,
58
+ $.gssapi_trust_dns,
59
+ $.gssapi_kex_algorithms,
60
+ $.hash_known_hosts,
61
+ $.hostbased_accepted_algorithms,
62
+ $.hostbased_authentication,
63
+ $.host_key_algorithms,
64
+ $.host_key_alias,
65
+ $.hostname,
66
+ $.identities_only,
67
+ $.identity_agent,
68
+ $.identity_file,
69
+ $.ignore_unknown,
70
+ $.include,
71
+ $.ip_qos,
72
+ $.kbd_interactive_authentication,
73
+ $.kbd_interactive_devices,
74
+ $.kex_algorithms,
75
+ $.known_hosts_command,
76
+ $.local_command,
77
+ $.local_forward,
78
+ $.log_level,
79
+ $.log_verbose,
80
+ $.macs,
81
+ $.no_host_authentication_for_localhost,
82
+ $.number_of_password_prompts,
83
+ $.password_authentication,
84
+ $.permit_local_command,
85
+ $.permit_remote_open,
86
+ $.pkcs11_provider,
87
+ $.port,
88
+ $.preferred_authentications,
89
+ $.protocol,
90
+ $.proxy_command,
91
+ $.proxy_jump,
92
+ $.proxy_use_fdpass,
93
+ $.pubkey_accepted_algorithms,
94
+ $.pubkey_accepted_key_types,
95
+ $.pubkey_authentication,
96
+ $.rekey_limit,
97
+ $.remote_command,
98
+ $.remote_forward,
99
+ $.request_tty,
100
+ $.revoked_host_keys,
101
+ $.security_key_provider,
102
+ $.send_env,
103
+ $.server_alive_count_max,
104
+ $.server_alive_interval,
105
+ $.session_type,
106
+ $.set_env,
107
+ $.stdin_null,
108
+ $.stream_local_bind_mask,
109
+ $.stream_local_bind_unlink,
110
+ $.strict_host_key_checking,
111
+ $.syslog_facility,
112
+ $.tcp_keep_alive,
113
+ $.keep_alive,
114
+ $.tunnel,
115
+ $.tunnel_device,
116
+ $.update_host_keys,
117
+ $.use_keychain,
118
+ $.user,
119
+ $.user_known_hosts_file,
120
+ $.verify_host_key_dns,
121
+ $.visual_host_key,
122
+ $.xauth_location,
123
+ ),
124
+
125
+ comment: $ => token(prec(-10, /#.*/)),
126
+ number: $ => /[1234567890]+/,
127
+ boolean: $ => choice('yes', 'no'),
128
+ pattern: $ => /.*/,
129
+ time_format: $ => /[1234567890]+[sSmMhHdDwW]?/,
130
+
131
+ host: $ => option(
132
+ 'Host',
133
+ $.host_value
134
+ ),
135
+ host_value: $ => alias($.pattern, "host_value"),
136
+
137
+ match: $ => option(
138
+ 'Match',
139
+ $.match_value
140
+ ),
141
+ match_value: $ => alias($.pattern, "match_value"),
142
+
143
+ add_keys_to_agent: $ => option(
144
+ 'AddKeysToAgent',
145
+ $.add_keys_to_agent_value
146
+ ),
147
+ add_keys_to_agent_value: $ => alias($.boolean, "add_keys_to_agent_value"),
148
+
149
+ address_family: $ => option(
150
+ 'AddressFamily',
151
+ $.address_family_value
152
+ ),
153
+ address_family_value: $ => choice('any', 'inet', 'inet6'),
154
+
155
+ batch_mode: $ => option(
156
+ 'BatchMode',
157
+ $.batch_mode_value
158
+ ),
159
+ batch_mode_value: $ => alias($.boolean, "batch_mode_value"),
160
+
161
+ bind_address: $ => option(
162
+ 'BindAddress',
163
+ $.bind_address_value
164
+ ),
165
+ bind_address_value: $ => /.*/,
166
+
167
+ bind_interface: $ => option(
168
+ 'BindInterface',
169
+ $.bind_interface_value
170
+ ),
171
+ bind_interface_value: $ => /.*/,
172
+
173
+ canonical_domains: $ => option(
174
+ 'CanonicalDomains',
175
+ $.canonical_domains_value
176
+ ),
177
+ canonical_domains_value: $ => /.*/,
178
+
179
+ canonicalize_fallback_local: $ => option(
180
+ 'CanonicalizeFallbackLocal',
181
+ $.canonicalize_fallback_local_value
182
+ ),
183
+ canonicalize_fallback_local_value: $ => alias($.boolean,
184
+ "canonicalize_fallback_local_value"),
185
+
186
+ canonicalize_hostname: $ => option(
187
+ 'CanonicalizeHostname',
188
+ $.canonicalize_hostname_value
189
+ ),
190
+ canonicalize_hostname_value: $ => alias($.boolean,
191
+ "canonicalize_hostname_value"),
192
+
193
+ canonicalize_max_dots: $ => option(
194
+ 'CanonicalizeMaxDots',
195
+ $.canonicalize_max_dots_value
196
+ ),
197
+ canonicalize_max_dots_value: $ => alias($.number,
198
+ "canonicalize_max_dots_value"),
199
+
200
+ canonicalize_permitted_cnames: $ => option(
201
+ 'CanonicalizePermittedCNAMEs',
202
+ $.canonicalize_permitted_cnames_value
203
+ ),
204
+ canonicalize_permitted_cnames_value: $ => /.*/,
205
+
206
+ ca_signature_algorithms: $ => option(
207
+ 'CASignatureAlgorithms',
208
+ $.ca_signature_algorithms_value
209
+ ),
210
+ ca_signature_algorithms_value: $ => /.*/,
211
+
212
+ certificate_file: $ => option(
213
+ 'CertificateFile',
214
+ $.certificate_file_value
215
+ ),
216
+ certificate_file_value: $ => /.*/,
217
+
218
+ challenge_response_authentication: $ => option(
219
+ 'ChallengeResponseAuthentication',
220
+ $.challenge_response_authentication_value
221
+ ),
222
+ challenge_response_authentication_value: $ => alias($.boolean,
223
+ "challenge_response_authentication_value"),
224
+
225
+ check_host_ip: $ => option(
226
+ 'CheckHostIP',
227
+ $.check_host_ip_value
228
+ ),
229
+ check_host_ip_value: $ => alias($.boolean, "check_host_ip_value"),
230
+
231
+ ciphers: $ => option(
232
+ 'Ciphers',
233
+ $.ciphers_value
234
+ ),
235
+ ciphers_value: $ => /.*/,
236
+
237
+ cipher: $ => option(
238
+ 'Cipher',
239
+ $.cipher_value
240
+ ),
241
+ cipher_value: $ => /.*/,
242
+
243
+ clear_all_forwardings: $ => option(
244
+ 'ClearAllForwardings',
245
+ $.clear_all_forwardings_value
246
+ ),
247
+ clear_all_forwardings_value: $ => alias($.boolean,
248
+ "clear_all_forwardings_value"),
249
+
250
+ compression: $ => option(
251
+ 'Compression',
252
+ $.compression_value
253
+ ),
254
+ compression_value: $ => alias($.boolean, "compression_value"),
255
+
256
+ connection_attempts: $ => option(
257
+ 'ConnectionAttempts',
258
+ $.connection_attempts_value
259
+ ),
260
+ connection_attempts_value: $ => alias($.number,
261
+ "connection_attempts_value"),
262
+
263
+ connect_timeout: $ => option(
264
+ 'ConnectTimeout',
265
+ $.connect_timeout_value
266
+ ),
267
+ connect_timeout_value: $ => alias($.number, "connect_timeout_value"),
268
+
269
+ control_master: $ => option(
270
+ 'ControlMaster',
271
+ $.control_master_value
272
+ ),
273
+ control_master_value: $ => choice('yes', 'no', 'ask', 'auto', 'autoask'),
274
+
275
+ control_path: $ => option(
276
+ 'ControlPath',
277
+ $.control_path_value
278
+ ),
279
+ control_path_value: $ => /.*/,
280
+
281
+ control_persist: $ => option(
282
+ 'ControlPersist',
283
+ $.control_persist_value
284
+ ),
285
+ control_persist_value: $ => alias(choice($.boolean, $.time_format),
286
+ 'control_persist_value'),
287
+
288
+ dynamic_forward: $ => option(
289
+ 'DynamicForward',
290
+ $.dynamic_forward_value
291
+ ),
292
+ dynamic_forward_value: $ => /.*/,
293
+
294
+ enable_ssh_keysign: $ => option(
295
+ 'EnableSSHKeysign',
296
+ $.enable_ssh_keysign_value
297
+ ),
298
+ enable_ssh_keysign_value: $ => alias($.boolean, "enable_ssh_keysign_value"),
299
+
300
+ escape_char: $ => option(
301
+ 'EscapeChar',
302
+ $.escape_char_value
303
+ ),
304
+ escape_char_value: $ => /.*/,
305
+
306
+ exit_on_forward_failure: $ => option(
307
+ 'ExitOnForwardFailure',
308
+ $.exit_on_forward_failure_value
309
+ ),
310
+ exit_on_forward_failure_value: $ => alias($.boolean,
311
+ "exit_on_forward_failure_value"),
312
+
313
+ fingerprint_hash: $ => option(
314
+ 'FingerprintHash',
315
+ $.fingerprint_hash_value
316
+ ),
317
+ fingerprint_hash_value: $ => choice('md5', 'sha256'),
318
+
319
+ fork_after_authentication: $ => option(
320
+ 'ForkAfterAuthentication',
321
+ $.fork_after_authentication_value
322
+ ),
323
+ fork_after_authentication_value: $ => alias($.boolean,
324
+ "fork_after_authentication_value"),
325
+
326
+ forward_agent: $ => option(
327
+ 'ForwardAgent',
328
+ $.forward_agent_value
329
+ ),
330
+ forward_agent_value: $ => alias($.boolean, "forward_agent_value"),
331
+
332
+ forward_x11: $ => option(
333
+ 'ForwardX11',
334
+ $.forward_x11_value
335
+ ),
336
+ forward_x11_value: $ => alias($.boolean, "forward_x11_value"),
337
+
338
+ forward_x11_timeout: $ => option(
339
+ 'ForwardX11Timeout',
340
+ $.forward_x11_timeout_value
341
+ ),
342
+ forward_x11_timeout_value: $ => alias($.time_format,
343
+ "forward_x11_timeout_value"),
344
+
345
+ forward_x11_trusted: $ => option(
346
+ 'ForwardX11Trusted',
347
+ $.forward_x11_trusted_value
348
+ ),
349
+ forward_x11_trusted_value: $ => alias($.boolean,
350
+ "forward_x11_trusted_value"),
351
+
352
+ gateway_ports: $ => option(
353
+ 'GatewayPorts',
354
+ $.gateway_ports_value
355
+ ),
356
+ gateway_ports_value: $ => alias($.boolean, "gateway_ports_value"),
357
+
358
+ global_known_hosts_file: $ => option(
359
+ 'GlobalKnownHostsFile',
360
+ $.global_known_hosts_file_value
361
+ ),
362
+ global_known_hosts_file_value: $ => /.*/,
363
+
364
+ gssapi_authentication: $ => option(
365
+ 'GSSAPIAuthentication',
366
+ $.gssapi_authentication_value
367
+ ),
368
+ gssapi_authentication_value: $ => alias($.boolean,
369
+ "gssapi_authentication_value"),
370
+
371
+ gssapi_client_identity: $ => option(
372
+ 'GSSAPIClientIdentity',
373
+ $.gssapi_client_identity_value
374
+ ),
375
+ gssapi_client_identity_value: $ => /.*/,
376
+
377
+ gssapi_delegate_credentials: $ => option(
378
+ 'GSSAPIDelegateCredentials',
379
+ $.gssapi_delegate_credentials_value
380
+ ),
381
+ gssapi_delegate_credentials_value: $ => alias($.boolean,
382
+ "gssapi_delegate_credentials_value"),
383
+
384
+ gssapi_key_exchange: $ => option(
385
+ 'GSSAPIKeyExchange',
386
+ $.gssapi_key_exchange_value
387
+ ),
388
+ gssapi_key_exchange_value: $ => alias($.boolean,
389
+ "gssapi_key_exchange_value"),
390
+
391
+ gssapi_renewal_forces_rekey: $ => option(
392
+ 'GSSAPIRenewalForcesRekey',
393
+ $.gssapi_renewal_forces_rekey_value
394
+ ),
395
+ gssapi_renewal_forces_rekey_value: $ => alias($.boolean,
396
+ "gssapi_renewal_forces_rekey_value"),
397
+
398
+ gssapi_server_identity: $ => option(
399
+ 'GSSAPIServerIdentity',
400
+ $.gssapi_server_identity_value
401
+ ),
402
+ gssapi_server_identity_value: $ => /.*/,
403
+
404
+ gssapi_trust_dns: $ => option(
405
+ 'GSSAPITrustDns',
406
+ $.gssapi_trust_dns_value
407
+ ),
408
+ gssapi_trust_dns_value: $ => alias($.boolean, "gssapi_trust_dns_value"),
409
+
410
+ gssapi_kex_algorithms: $ => option(
411
+ 'GSSAPIKexAlgorithms',
412
+ $.gssapi_kex_algorithms_value
413
+ ),
414
+ gssapi_kex_algorithms_value: $ => /.*/,
415
+
416
+ hash_known_hosts: $ => option(
417
+ 'HashKnownHosts',
418
+ $.hash_known_hosts_value
419
+ ),
420
+ hash_known_hosts_value: $ => alias($.boolean, "hash_known_hosts_value"),
421
+
422
+ hostbased_accepted_algorithms: $ => option(
423
+ 'HostbasedAcceptedAlgorithms',
424
+ $.hostbased_accepted_algorithms_value
425
+ ),
426
+ hostbased_accepted_algorithms_value: $ => /.*/,
427
+
428
+ hostbased_authentication: $ => option(
429
+ 'HostbasedAuthentication',
430
+ $.hostbased_authentication_value
431
+ ),
432
+ hostbased_authentication_value: $ => alias($.boolean,
433
+ "hostbased_authentication_value"),
434
+
435
+ host_key_algorithms: $ => option(
436
+ 'HostKeyAlgorithms',
437
+ $.host_key_algorithms_value
438
+ ),
439
+ host_key_algorithms_value: $ => /.*/,
440
+
441
+ host_key_alias: $ => option(
442
+ 'HostKeyAlias',
443
+ $.host_key_alias_value
444
+ ),
445
+ host_key_alias_value: $ => /.*/,
446
+
447
+ hostname: $ => option(
448
+ 'Hostname',
449
+ $.hostname_value
450
+ ),
451
+ hostname_value: $ => /.*/,
452
+
453
+ identities_only: $ => option(
454
+ 'IdentitiesOnly',
455
+ $.identities_only_value
456
+ ),
457
+ identities_only_value: $ => alias($.boolean, "identities_only_value"),
458
+
459
+ identity_agent: $ => option(
460
+ 'IdentityAgent',
461
+ $.identity_agent_value
462
+ ),
463
+ identity_agent_value: $ => /.*/,
464
+
465
+ identity_file: $ => option(
466
+ 'IdentityFile',
467
+ $.identity_file_value
468
+ ),
469
+ identity_file_value: $ => /.*/,
470
+
471
+ ignore_unknown: $ => option(
472
+ 'IgnoreUnknown',
473
+ $.ignore_unknown_value
474
+ ),
475
+ ignore_unknown_value: $ => /.*/,
476
+
477
+ include: $ => option(
478
+ 'Include',
479
+ $.include_value
480
+ ),
481
+ include_value: $ => /.*/,
482
+
483
+ ip_qos: $ => option(
484
+ 'IPQoS',
485
+ $.ip_qos_value
486
+ ),
487
+ ip_qos_value: $ => alias(
488
+ choice('af11', 'af12', 'af13', 'af21', 'af22', 'af23', 'af31', 'af32',
489
+ 'af33', 'af41', 'af42', 'af43', 'cs0', 'cs1', 'cs2', 'cs3', 'cs4',
490
+ 'cs5', 'cs6', 'cs7', 'ef', 'le', 'lowdelay', 'throughput',
491
+ 'reliability', 'none', $.number), 'ip_qos_value'),
492
+
493
+ kbd_interactive_authentication: $ => option(
494
+ 'KbdInteractiveAuthentication',
495
+ $.kbd_interactive_authentication_value
496
+ ),
497
+ kbd_interactive_authentication_value: $ => alias($.boolean,
498
+ "kbd_interactive_authentication_value"),
499
+
500
+ kbd_interactive_devices: $ => option(
501
+ 'KbdInteractiveDevices',
502
+ $.kbd_interactive_devices_value
503
+ ),
504
+ kbd_interactive_devices_value: $ => /.*/,
505
+
506
+ kex_algorithms: $ => option(
507
+ 'KexAlgorithms',
508
+ $.kex_algorithms_value
509
+ ),
510
+ kex_algorithms_value: $ => /.*/,
511
+
512
+ known_hosts_command: $ => option(
513
+ 'KnownHostsCommand',
514
+ $.known_hosts_command_value
515
+ ),
516
+ known_hosts_command_value: $ => /.*/,
517
+
518
+ local_command: $ => option(
519
+ 'LocalCommand',
520
+ $.local_command_value
521
+ ),
522
+ local_command_value: $ => /.*/,
523
+
524
+ local_forward: $ => option(
525
+ 'LocalForward',
526
+ $.local_forward_value
527
+ ),
528
+ local_forward_value: $ => /.*/,
529
+
530
+ log_level: $ => option(
531
+ 'LogLevel',
532
+ $.log_level_value
533
+ ),
534
+ log_level_value: $ => choice(
535
+ ignoreCase('quiet'),
536
+ ignoreCase('fatal'),
537
+ ignoreCase('error'),
538
+ ignoreCase('info'),
539
+ ignoreCase('verbose'),
540
+ ignoreCase('debug'),
541
+ ignoreCase('debug1'),
542
+ ignoreCase('debug2'),
543
+ ignoreCase('debug3'),
544
+ ),
545
+
546
+ log_verbose: $ => option(
547
+ 'LogVerbose',
548
+ $.log_verbose_value
549
+ ),
550
+ log_verbose_value: $ => /.*/,
551
+
552
+ macs: $ => option(
553
+ 'MACs',
554
+ $.macs_value
555
+ ),
556
+ macs_value: $ => /.*/,
557
+
558
+ no_host_authentication_for_localhost: $ => option(
559
+ 'NoHostAuthenticationForLocalhost',
560
+ $.no_host_authentication_for_localhost_value
561
+ ),
562
+ no_host_authentication_for_localhost_value: $ => alias($.boolean,
563
+ "no_host_authentication_for_localhost_value"),
564
+
565
+ number_of_password_prompts: $ => option(
566
+ 'NumberOfPasswordPrompts',
567
+ $.number_of_password_prompts_value
568
+ ),
569
+ number_of_password_prompts_value: $ => alias($.number,
570
+ "number_of_password_prompts_value"),
571
+
572
+ password_authentication: $ => option(
573
+ 'PasswordAuthentication',
574
+ $.password_authentication_value
575
+ ),
576
+ password_authentication_value: $ => alias($.boolean,
577
+ "password_authentication_value"),
578
+
579
+ permit_local_command: $ => option(
580
+ 'PermitLocalCommand',
581
+ $.permit_local_command_value
582
+ ),
583
+ permit_local_command_value: $ => alias($.boolean,
584
+ "permit_local_command_value"),
585
+
586
+ permit_remote_open: $ => option(
587
+ 'PermitRemoteOpen',
588
+ $.permit_remote_open_value
589
+ ),
590
+ permit_remote_open_value: $ => /.*/,
591
+
592
+ pkcs11_provider: $ => option(
593
+ 'PKCS11Provider',
594
+ $.pkcs11_provider_value
595
+ ),
596
+ pkcs11_provider_value: $ => /.*/,
597
+
598
+ port: $ => option(
599
+ 'Port',
600
+ $.port_value
601
+ ),
602
+ port_value: $ => alias($.number, "port_value"),
603
+
604
+ preferred_authentications: $ => option(
605
+ 'PreferredAuthentications',
606
+ $.preferred_authentications_value
607
+ ),
608
+ preferred_authentications_value: $ => /.*/,
609
+
610
+ protocol: $ => option(
611
+ 'Protocol',
612
+ $.protocol_value
613
+ ),
614
+ protocol_value: $ => choice('1', '2'),
615
+
616
+ proxy_command: $ => option(
617
+ 'ProxyCommand',
618
+ $.proxy_command_value
619
+ ),
620
+ proxy_command_value: $ => /.*/,
621
+
622
+ proxy_jump: $ => option(
623
+ 'ProxyJump',
624
+ $.proxy_jump_value
625
+ ),
626
+ proxy_jump_value: $ => /.*/,
627
+
628
+ proxy_use_fdpass: $ => option(
629
+ 'ProxyUseFdpass',
630
+ $.proxy_use_fdpass_value
631
+ ),
632
+ proxy_use_fdpass_value: $ => alias($.boolean, "proxy_use_fdpass_value"),
633
+
634
+ pubkey_accepted_algorithms: $ => option(
635
+ 'PubkeyAcceptedAlgorithms',
636
+ $.pubkey_accepted_algorithms_value
637
+ ),
638
+ pubkey_accepted_algorithms_value: $ => /.*/,
639
+
640
+ pubkey_accepted_key_types: $ => option(
641
+ 'PubkeyAcceptedKeyTypes',
642
+ $.pubkey_accepted_key_types_value
643
+ ),
644
+ pubkey_accepted_key_types_value: $ => /.*/,
645
+
646
+ pubkey_authentication: $ => option(
647
+ 'PubkeyAuthentication',
648
+ $.pubkey_authentication_value
649
+ ),
650
+ pubkey_authentication_value: $ => alias($.boolean,
651
+ "pubkey_authentication_value"),
652
+
653
+ rekey_limit: $ => option(
654
+ 'RekeyLimit',
655
+ $.rekey_limit_value
656
+ ),
657
+ rekey_limit_value: $ => /.*/,
658
+
659
+ remote_command: $ => option(
660
+ 'RemoteCommand',
661
+ $.remote_command_value
662
+ ),
663
+ remote_command_value: $ => /.*/,
664
+
665
+ remote_forward: $ => option(
666
+ 'RemoteForward',
667
+ $.remote_forward_value
668
+ ),
669
+ remote_forward_value: $ => /.*/,
670
+
671
+ request_tty: $ => option(
672
+ 'RequestTTY',
673
+ $.request_tty_value
674
+ ),
675
+ request_tty_value: $ => choice('yes', 'no', 'auto', 'force'),
676
+
677
+ revoked_host_keys: $ => option(
678
+ 'RevokedHostKeys',
679
+ $.revoked_host_keys_value
680
+ ),
681
+ revoked_host_keys_value: $ => /.*/,
682
+
683
+ security_key_provider: $ => option(
684
+ 'SecurityKeyProvider',
685
+ $.security_key_provider_value
686
+ ),
687
+ security_key_provider_value: $ => /.*/,
688
+
689
+ send_env: $ => option(
690
+ 'SendEnv',
691
+ $.send_env_value
692
+ ),
693
+ send_env_value: $ => /.*/,
694
+
695
+ server_alive_count_max: $ => option(
696
+ 'ServerAliveCountMax',
697
+ $.server_alive_count_max_value
698
+ ),
699
+ server_alive_count_max_value: $ => alias($.number,
700
+ "server_alive_count_max_value"),
701
+
702
+ server_alive_interval: $ => option(
703
+ 'ServerAliveInterval',
704
+ $.server_alive_interval_value
705
+ ),
706
+ server_alive_interval_value: $ => alias($.number,
707
+ "server_alive_interval_value"),
708
+
709
+ session_type: $ => option(
710
+ 'SessionType',
711
+ $.session_type_value
712
+ ),
713
+ session_type_value: $ => choice('none', 'subsystem', 'default'),
714
+
715
+ set_env: $ => option(
716
+ 'SetEnv',
717
+ $.set_env_value
718
+ ),
719
+ set_env_value: $ => /.*/,
720
+
721
+ stdin_null: $ => option(
722
+ 'StdinNull',
723
+ $.stdin_null_value
724
+ ),
725
+ stdin_null_value: $ => alias($.boolean, "stdin_null_value"),
726
+
727
+ stream_local_bind_mask: $ => option(
728
+ 'StreamLocalBindMask',
729
+ $.stream_local_bind_mask_value
730
+ ),
731
+ stream_local_bind_mask_value: $ => /.*/,
732
+
733
+ stream_local_bind_unlink: $ => option(
734
+ 'StreamLocalBindUnlink',
735
+ $.stream_local_bind_unlink_value
736
+ ),
737
+ stream_local_bind_unlink_value: $ => alias($.boolean,
738
+ "stream_local_bind_unlink_value"),
739
+
740
+ strict_host_key_checking: $ => option(
741
+ 'StrictHostKeyChecking',
742
+ $.strict_host_key_checking_value
743
+ ),
744
+ strict_host_key_checking_value: $ => choice('yes', 'no', 'off', 'ask',
745
+ 'accept-new'),
746
+
747
+ syslog_facility: $ => option(
748
+ 'SyslogFacility',
749
+ $.syslog_facility_value
750
+ ),
751
+ syslog_facility_value: $ => choice('DAEMON', 'USER', 'AUTH', 'LOCAL0',
752
+ 'LOCAL1', 'LOCAL2', 'LOCAL3', 'LOCAL4', 'LOCAL5', 'LOCAL6', 'LOCAL7'),
753
+
754
+ tcp_keep_alive: $ => option(
755
+ 'TCPKeepAlive',
756
+ $.tcp_keep_alive_value
757
+ ),
758
+ tcp_keep_alive_value: $ => alias($.boolean, "tcp_keep_alive_value"),
759
+
760
+ keep_alive: $ => option(
761
+ 'KeepAlive',
762
+ $.keep_alive_value
763
+ ),
764
+ keep_alive_value: $ => alias($.boolean, "keep_alive_value"),
765
+
766
+ tunnel: $ => option(
767
+ 'Tunnel',
768
+ $.tunnel_value
769
+ ),
770
+ tunnel_value: $ => choice('yes', 'no', 'point-to-point', 'ethernet'),
771
+
772
+ tunnel_device: $ => option(
773
+ 'TunnelDevice',
774
+ $.tunnel_device_value
775
+ ),
776
+ tunnel_device_value: $ => /.*/,
777
+
778
+ update_host_keys: $ => option(
779
+ 'UpdateHostKeys',
780
+ $.update_host_keys_value
781
+ ),
782
+ update_host_keys_value: $ => choice('yes', 'no', 'ask'),
783
+
784
+ use_keychain: $ => option(
785
+ 'UseKeychain',
786
+ $.use_keychain_value
787
+ ),
788
+ use_keychain_value: $ => alias($.boolean, "use_keychain_value"),
789
+
790
+ user: $ => option(
791
+ 'User',
792
+ $.user_value
793
+ ),
794
+ user_value: $ => /.*/,
795
+
796
+ user_known_hosts_file: $ => option(
797
+ 'UserKnownHostsFile',
798
+ $.user_known_hosts_file_value
799
+ ),
800
+ user_known_hosts_file_value: $ => /.*/,
801
+
802
+ verify_host_key_dns: $ => option(
803
+ 'VerifyHostKeyDNS',
804
+ $.verify_host_key_dns_value
805
+ ),
806
+ verify_host_key_dns_value: $ => choice('yes', 'no', 'ask'),
807
+
808
+ visual_host_key: $ => option(
809
+ 'VisualHostKey',
810
+ $.visual_host_key_value
811
+ ),
812
+ visual_host_key_value: $ => alias($.boolean, "visual_host_key_value"),
813
+
814
+ xauth_location: $ => option(
815
+ 'XAuthLocation',
816
+ $.xauth_location_value
817
+ ),
818
+ xauth_location_value: $ => /.*/,
819
+
820
+ }
821
+ });
822
+
823
+ function option(name, value) {
824
+ return seq(
825
+ keyword(name),
826
+ optional('='),
827
+ value
828
+ )
829
+ }
830
+
831
+ function keyword(word) {
832
+ return alias(reserved(ignoreCase(word)), word)
833
+ }
834
+
835
+ function ignoreCase(word) {
836
+ return new RegExp(caseInsensitive(word))
837
+ }
838
+
839
+ function reserved(regex) {
840
+ return token(prec(1, regex))
841
+ }
842
+
843
+ function caseInsensitive(word) {
844
+ return word
845
+ .split('')
846
+ .map(letter => `[${letter.toLowerCase()}${letter.toUpperCase()}]`)
847
+ .join('')
848
+ }