Issue 1:
Problem revoking a subfolder

Currently you cannot revoke a subfolder permission.

example :

///1. Request permissions needed

const permStatus_1 = await Deno.permissions.request({ name: "read", path: "./folderA"}); //Grant
//Skipped because folderA was granted
const permStatus_2 = await Deno.permissions.request({ name: "read", path: "./folderA/SubFolderA" });

console.log(permStatus_1); //Granted
console.log(permStatus_2); //Granted

///2. Remove unused permissions

//Revoke the folderA
await Deno.permissions.revoke({ name: "read", path: "./folderA/SubFolderA" });
const permStatus_3 = await Deno.permissions.query({ name: "read", path: "./folderA" });
const permStatus_4 = await Deno.permissions.query({ name: "read", path: "./folderA/SubFolderA" });

console.log(permStatus_3); //Granted
console.log(permStatus_4); //Granted [!] The revocation was not taken into account

Proposition : add the recursive optional attribute

It's an idea, but I think it might be interesting to consider the permission request of the subfolder, although the permission of parent folder was already granted.

Also, when a revocation is called, revoke all children only if the optional recursive parameter has been provided.

const permStatus_5 = await Deno.permissions.request({ name: "read", path: "./folderA" }); //Grant
//Skipped because folderA was granted, /!\ but add the path to the granted list
const permStatus_6 = await Deno.permissions.request({ name: "read", path: "./folderA/SubFolderA" });

console.log(permStatus_5 ); //Granted
console.log(permStatus_6 ); //Granted

without the recursive attribute :

await Deno.permissions.revoke({ name: "read", path: "./folderA" }); //Revoke the folderA
const permStatus_7 = await Deno.permissions.query({ name: "read", path: "./folderA" });
const permStatus_8 = await Deno.permissions.query({ name: "read", path: "./folderA/SubFolderA" });

console.log(permStatus_7); //Prompt
console.log(permStatus_8); //Granted

with the recursive attribute :

await Deno.permissions.revoke({ name: "read", path: "./folderA", recursive: true }); //Revoke the folderA recursively
const permStatus_9 = await Deno.permissions.query({ name: "read", path: "./folderA" });
const permStatus_10 = await Deno.permissions.query({ name: "read", path: "./folderA/SubFolderA" });

console.log(permStatus_9); //Prompt
console.log(permStatus_10); //Prompt

Issue 2:
I'm experiencing a strange bug with Deno.

When a exception is thrown the main process panics. This is the trace:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', cli\fmt_errors.rs:86:8
stack backtrace:
0: 0x7ff7af88a45b - <unknown>
1: 0x7ff7af53cecc - <unknown>
2: 0x7ff7af889483 - <unknown>
3: 0x7ff7af888bb8 - <unknown>
4: 0x7ff7af887d2e - <unknown>
5: 0x7ff7af88efe5 - <unknown>
6: 0x7ff7af53a4b0 - <unknown>
7: 0x7ff7af53a2cc - <unknown>
8: 0x7ff7af36cbf2 - <unknown>
9: 0x7ff7af48ada8 - <unknown>
10: 0x7ff7af48b345 - <unknown>
11: 0x7ff7af53cecc - <unknown>
12: 0x7ff7af751885 - <unknown>
13: 0x7ff7af349c1d - <unknown>
14: 0x7ff7af4daf6f - <unknown>
15: 0x7ff7af8aa3f6 - <unknown>
16: 0x7ff7af4ea67e - <unknown>
17: 0x7ff7b048bf10 - CrashForExceptionInNonABICompliantCodeRange
18: 0x7ff8e9777bd4 - BaseThreadInitThunk
19: 0x7ff8ea16ce51 - RtlUserThreadStart

I don't know how to reproduce the bug but it happened in my project so I tried to isolate it in a separated branch:

https://github.com/AndreJesusBrito/WebAssembly-Language-Compiler/tree/rust-exception-bug-isolation

The bug happens in file src/SyntaxAnalysis/SyntaxRule.ts at line 25 when I throw an exception.

...
public getDerivation(terminal: string): RuleDerivation {
const derivation = this.derivations.get(terminal);
if (derivation) {
return {
derivationSymbols: [...derivation.derivationSymbols].reverse(),
actions: derivation.actions,
};
} else {
throw SyntaxError("Unexpected token '" + terminal + "' at rule " + this._name); // THIS IS LINE 25
}
}

public setDerivation(rule: SyntaxSymbol[], actions: ActionObj[], ...terminals: string[]): void {
for (const terminal of terminals) {
if (this.derivations.get(terminal) instanceof Array) {
console.warn("'" + terminal + "' repeated terminal for rule " + this._name);
...

Even though I'm using a SyntaxError (that is not a very good idea and will change later) it seems to happen for any error including the base Error class.

The most strange thing to me is that by changing the white space on this file it can work correctly.

For example, when I remove line 28 it works fine:

error: Uncaught SyntaxError: Unexpected token '' at rule none
public setDerivation(rule: SyntaxSymbol[], actions: ActionObj[], ...terminals: string[]): void {
^
at SyntaxRule.getDerivation (file:///C:/Users/Andr%C3%A9%20Brito/Documents/GitHub/WebAssembly-Language-Compiler/src/SyntaxAnalysis/SyntaxRule.ts:28:13)
at file:///C:/Users/Andr%C3%A9%20Brito/Documents/GitHub/WebAssembly-Language-Compiler/src/main.ts:4:1

I'm running using the command:

deno run src\main.ts

and my specs are:

deno 1.2.2
v8 8.5.216
typescript 3.9.2
OS: Windows_NT x64 10.0.18362

Hope this helps! :)