diff options
-rw-r--r-- | code/.vscode/launch.json | 2 | ||||
-rw-r--r-- | code/src/main.ts | 8 | ||||
-rw-r--r-- | src/parser/grammar/expressions.rs | 2 | ||||
-rw-r--r-- | src/yellow/syntax.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/code/.vscode/launch.json b/code/.vscode/launch.json index 5d75a92e8..64f2c3693 100644 --- a/code/.vscode/launch.json +++ b/code/.vscode/launch.json | |||
@@ -9,7 +9,7 @@ | |||
9 | "type": "extensionHost", | 9 | "type": "extensionHost", |
10 | "request": "launch", | 10 | "request": "launch", |
11 | "runtimeExecutable": "${execPath}", | 11 | "runtimeExecutable": "${execPath}", |
12 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], | 12 | "args": ["--extensionDevelopmentPath=${workspaceRoot}"], |
13 | "stopOnEntry": false, | 13 | "stopOnEntry": false, |
14 | "sourceMaps": true, | 14 | "sourceMaps": true, |
15 | "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], | 15 | "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], |
diff --git a/code/src/main.ts b/code/src/main.ts index dfb005c09..75a824b7b 100644 --- a/code/src/main.ts +++ b/code/src/main.ts | |||
@@ -12,7 +12,6 @@ let uris = { | |||
12 | 12 | ||
13 | export function activate(context: vscode.ExtensionContext) { | 13 | export function activate(context: vscode.ExtensionContext) { |
14 | let textDocumentContentProvider = new TextDocumentContentProvider() | 14 | let textDocumentContentProvider = new TextDocumentContentProvider() |
15 | |||
16 | let dispose = (disposable) => { | 15 | let dispose = (disposable) => { |
17 | context.subscriptions.push(disposable); | 16 | context.subscriptions.push(disposable); |
18 | } | 17 | } |
@@ -25,7 +24,6 @@ export function activate(context: vscode.ExtensionContext) { | |||
25 | let emitter = textDocumentContentProvider.eventEmitter | 24 | let emitter = textDocumentContentProvider.eventEmitter |
26 | emitter.fire(uris.syntaxTree) | 25 | emitter.fire(uris.syntaxTree) |
27 | let syntax = activeSyntax() | 26 | let syntax = activeSyntax() |
28 | console.log(syntax.highlight()); | ||
29 | setHighlights(vscode.window.activeTextEditor, syntax.highlight()) | 27 | setHighlights(vscode.window.activeTextEditor, syntax.highlight()) |
30 | }) | 28 | }) |
31 | 29 | ||
@@ -89,7 +87,10 @@ function documentToFile(disposables: vscode.Disposable[], onChange) { | |||
89 | } | 87 | } |
90 | 88 | ||
91 | function createFile(text: String) { | 89 | function createFile(text: String) { |
92 | return new backend.RustFile(text) | 90 | console.time("parsing") |
91 | let res = new backend.RustFile(text); | ||
92 | console.timeEnd("parsing") | ||
93 | return res | ||
93 | } | 94 | } |
94 | 95 | ||
95 | vscode.workspace.onDidChangeTextDocument((event: vscode.TextDocumentChangeEvent) => { | 96 | vscode.workspace.onDidChangeTextDocument((event: vscode.TextDocumentChangeEvent) => { |
@@ -159,7 +160,6 @@ function setHighlights( | |||
159 | editor: vscode.TextEditor, | 160 | editor: vscode.TextEditor, |
160 | highlihgs: Array<[number, number, string]> | 161 | highlihgs: Array<[number, number, string]> |
161 | ) { | 162 | ) { |
162 | console.log("setHighlight"); | ||
163 | let byTag = {} | 163 | let byTag = {} |
164 | for (let tag in decorations) { | 164 | for (let tag in decorations) { |
165 | byTag[tag] = [] | 165 | byTag[tag] = [] |
diff --git a/src/parser/grammar/expressions.rs b/src/parser/grammar/expressions.rs index 4861536f8..a6456c8d5 100644 --- a/src/parser/grammar/expressions.rs +++ b/src/parser/grammar/expressions.rs | |||
@@ -69,7 +69,7 @@ fn atom_expr(p: &mut Parser) -> Option<CompletedMarker> { | |||
69 | match p.current() { | 69 | match p.current() { |
70 | L_PAREN => Some(tuple_expr(p)), | 70 | L_PAREN => Some(tuple_expr(p)), |
71 | _ => { | 71 | _ => { |
72 | p.error("expected expression"); | 72 | p.err_and_bump("expected expression"); |
73 | None | 73 | None |
74 | } | 74 | } |
75 | } | 75 | } |
diff --git a/src/yellow/syntax.rs b/src/yellow/syntax.rs index 65ce647c7..58e8ab9b6 100644 --- a/src/yellow/syntax.rs +++ b/src/yellow/syntax.rs | |||
@@ -109,7 +109,7 @@ impl<R: TreeRoot> SyntaxNode<R> { | |||
109 | let red = self.red(); | 109 | let red = self.red(); |
110 | let parent = self.parent()?; | 110 | let parent = self.parent()?; |
111 | let next_sibling_idx = red.index_in_parent()? + 1; | 111 | let next_sibling_idx = red.index_in_parent()? + 1; |
112 | if next_sibling_idx == red.n_children() { | 112 | if next_sibling_idx == parent.red().n_children() { |
113 | return None; | 113 | return None; |
114 | } | 114 | } |
115 | Some(SyntaxNode { | 115 | Some(SyntaxNode { |