Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser TS bindings #7881

Merged
merged 48 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ff98c07
Parser TS bindings
kazcw Aug 30, 2023
e666051
deserializeTree
kazcw Sep 24, 2023
6332acf
DataView
kazcw Sep 25, 2023
bcd835f
No utf8
kazcw Sep 25, 2023
df3d298
WIP
kazcw Sep 26, 2023
3005f06
Fix.
kazcw Sep 26, 2023
a06e873
Lint.
kazcw Sep 26, 2023
2636866
prettier
kazcw Sep 26, 2023
2f41699
Merge branch 'develop' into wip/kw/parser-ts
kazcw Sep 26, 2023
eef76e2
Cleanup.
kazcw Sep 26, 2023
13eaf71
Cleanup.
kazcw Sep 26, 2023
475a66a
Restore cow powers for the time being.
kazcw Sep 26, 2023
9523e8c
Testing.
kazcw Sep 26, 2023
bedf476
Simplify.
kazcw Sep 26, 2023
599641b
Testing.
kazcw Sep 26, 2023
986bc84
Cleanup.
kazcw Sep 27, 2023
e93ce83
Merge remote-tracking branch 'origin/develop' into ts-parser
kazcw Sep 27, 2023
d9ac1c8
Finish u64/Result support.
kazcw Sep 27, 2023
fca9b19
Remove test.
kazcw Sep 27, 2023
3666517
Format, fix Windows.
kazcw Sep 27, 2023
458dca8
Fix Windows
kazcw Sep 28, 2023
86dfd12
Lint
kazcw Sep 28, 2023
8ff1c71
Fix typing.
kazcw Sep 28, 2023
f8708c6
Review.
kazcw Sep 30, 2023
b2d591a
Merge branch 'develop' into wip/kw/parser-ts
kazcw Oct 2, 2023
af7bece
new Result
kazcw Oct 2, 2023
5d8e168
Compute utf16 offsets while lexing.
kazcw Oct 2, 2023
bfb8e14
Abolish cows.
kazcw Oct 2, 2023
0b8d1b0
WIP: More comprehensive test.
kazcw Oct 2, 2023
2e32656
Use 32-bit numbers in parser.
kazcw Oct 2, 2023
8b45146
Fix bug.
kazcw Oct 4, 2023
978fdda
Cleanup.
kazcw Oct 4, 2023
e9f64db
Use change-case.
kazcw Oct 4, 2023
de2a099
Organize
kazcw Oct 4, 2023
a6031e1
Lint
kazcw Oct 4, 2023
42a484b
Organize.
kazcw Oct 4, 2023
a2f9af8
Docs.
kazcw Oct 4, 2023
95a4059
Span testing.
kazcw Oct 5, 2023
8353dca
Fix most spans...
kazcw Oct 6, 2023
5e21a48
Fix spans
kazcw Oct 6, 2023
1388d02
Clean up.
kazcw Oct 10, 2023
82ec438
Prettier.
kazcw Oct 10, 2023
73963b1
Docs.
kazcw Oct 10, 2023
d7dd38e
Change field names
kazcw Oct 10, 2023
a618068
Merge remote-tracking branch 'origin/develop' into wip/kw/parser-ts
kazcw Oct 10, 2023
d048e1d
Update tests for new field names
kazcw Oct 10, 2023
88d0fa1
Make prettier happier
kazcw Oct 10, 2023
c6a4f53
remove old Ast, simplify codegen build sequence
Frizi Oct 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"lib/rust/parser/src/syntax/tree/visitor",
"lib/rust/parser/jni",
"lib/rust/parser/generate-java",
"lib/rust/parser/schema",
"lib/rust/parser/debug",
"lib/rust/ensogl/pack",
"lib/rust/profiler/data",
Expand Down
4 changes: 2 additions & 2 deletions app/gui/language/parser/src/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Translate {
let space = span.left_offset.code.repr.len();
self.space_after.insert(self.offset, space);
self.offset += space;
span.left_offset.visible.width_in_spaces
usize::try_from(span.left_offset.visible.width_in_spaces).unwrap()
}

/// This must be called at the beginning of each [`Token`], as they are processed in depth-first
Expand All @@ -93,7 +93,7 @@ impl Translate {
/// This must be called at the beginning of each [`Token`], as they are processed in depth-first
/// order. It updates the internal counter for the token's bytes, and returns its contents.
fn visit_token_ref<T>(&mut self, token: syntax::token::Ref<T>) -> WithInitialSpace<String> {
let space = token.left_offset.visible.width_in_spaces;
let space = usize::try_from(token.left_offset.visible.width_in_spaces).unwrap();
let body = token.code.to_string();
self.space_after.insert(self.offset, space);
self.offset += token.left_offset.code.repr.len();
Expand Down
4 changes: 3 additions & 1 deletion app/gui2/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.html
*.css
*.css

**/generated
2 changes: 1 addition & 1 deletion app/gui2/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="vite/client" />

declare const PROJECT_MANAGER_URL: string
declare const RUNNING_VTEST: boolean
declare const RUNNING_VITEST: boolean

// This is an augmentation to the built-in `ImportMeta` interface.
// This file MUST NOT contain any top-level imports.
Expand Down
3 changes: 2 additions & 1 deletion app/gui2/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const DIR_NAME = path.dirname(url.fileURLToPath(import.meta.url))

const conf = [
{
ignores: ['rust-ffi/pkg', 'dist'],
ignores: ['rust-ffi/pkg', 'dist', 'src/generated'],
},
...compat.extends('plugin:vue/vue3-recommended'),
eslintJs.configs.recommended,
Expand All @@ -26,6 +26,7 @@ const conf = [
'./tsconfig.server.json',
'./tsconfig.app.vitest.json',
'./tsconfig.server.vitest.json',
'./parser-codegen/tsconfig.json',
],
},
},
Expand Down
8 changes: 6 additions & 2 deletions app/gui2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
"typecheck": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "eslint .",
"format": "prettier --write src/ && eslint . --fix",
"build-rust-ffi": "cd rust-ffi && wasm-pack build --release --target web",
"preinstall": "npm run build-rust-ffi"
"build-rust-ffi": "wasm-pack build ./rust-ffi --release --target web",
"generate-ast-schema": "cargo run -p enso-parser-schema > src/generated/ast-schema.json",
"generate-ast-types": "tsx ./parser-codegen/index.ts src/generated/ast-schema.json src/generated/ast.ts",
"preinstall": "npm run build-rust-ffi && npm run generate-ast-schema && npm run generate-ast-types"
},
"dependencies": {
"@babel/parser": "^7.22.16",
Expand Down Expand Up @@ -75,6 +77,7 @@
"@vue/tsconfig": "^0.4.0",
"ag-grid-community": "^30.1.0",
"ag-grid-enterprise": "^30.1.0",
"change-case": "^5.0.2",
"d3": "^7.4.0",
"esbuild": "^0.19.3",
"eslint": "^8.49.0",
Expand All @@ -86,6 +89,7 @@
"shuffle-seed": "^1.1.6",
"sql-formatter": "^13.0.0",
"tailwindcss": "^3.2.7",
"tsx": "^3.12.6",
"typescript": "~5.2.2",
"vite": "^4.4.9",
"vite-plugin-inspect": "^0.7.38",
Expand Down
Loading
Loading