Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Bumped parser #1274

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion src/rust/ide/lib/ast/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub enum Shape<T> {
// === Macros ===
Match { pfx : Option<MacroPatternMatch<Shifted<T>>>
, segs : ShiftedVec1<MacroMatchSegment<T>>
, resolved : Ast },
, resolved : Option<Ast> },
Ambiguous { segs : ShiftedVec1<MacroAmbiguousSegment<T>>
, paths : Tree<Ast, Unit> },

Expand Down
2 changes: 1 addition & 1 deletion src/rust/ide/lib/parser/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::path::PathBuf;
const PARSER_PATH: &str = "./pkg/scala-parser.js";

/// Commit from `enso` repository that will be used to obtain parser from.
const PARSER_COMMIT: &str = "2c5ed028aab74fa50747c5c9eaa1ec21ae0c5c07";
const PARSER_COMMIT: &str = "fea88569709015363d053f28bbe6ada75b385321";

/// Magic code that needs to be prepended to ScalaJS generated parser due to:
/// https://github.com/scala-js/scala-js/issues/3677/
Expand Down
14 changes: 0 additions & 14 deletions src/rust/ide/lib/parser/tests/bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ use wasm_bindgen_test::wasm_bindgen_test_configure;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
fn missing_macro_segment() {
// TODO: should succeed
// https://github.com/enso-org/enso/issues/256
assert!(parser::Parser::new_or_panic().parse_line("-> a").is_err());
}

#[wasm_bindgen_test]
fn nested_macros() {
// TODO: should succeed
// https://github.com/enso-org/enso/issues/256 or https://github.com/enso-org/enso/issues/343
assert!(parser::Parser::new_or_panic().parse_line("(a -> b) -> c").is_err());
}

#[wasm_bindgen_test]
fn extension_operator_methods() {
let ast = parser::Parser::new_or_panic().parse_line("Int.+").unwrap();
Expand Down
6 changes: 4 additions & 2 deletions src/rust/ide/lib/parser/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn import_utilities() {
assert!(ast_as_import_match(&ast).is_none());
};

// expect_import("import"); // TODO [mwu] https://github.com/enso-org/enso/issues/1016
expect_import("import");
expect_import("import Foo");
expect_import("import Foo.Bar");
expect_import("import Foo.Bar.Baz");
Expand All @@ -39,6 +39,8 @@ fn import_utilities() {
expect_not_import("type Foo as Bar");
expect_not_import("if Foo then Bar else Baz");
expect_not_import("Foo.Bar.Baz");
expect_not_import("->");
expect_not_import("export");
expect_not_import("export Foo");
expect_not_import("from Foo export all hiding Bar");
}
Expand All @@ -63,7 +65,7 @@ fn recognizing_lambdas() {
expect_lambda("a->b", "a", "b");
expect_lambda("foo->4+(4)", "foo", "4+(4)");
expect_lambda("a->b->c", "a", "b->c");
// expect_lambda("(a->b)->c"); // TODO: Failing due to internal parser error: java.lang.NullPointerException
expect_lambda("(a->b)->c", "(a->b)", "c");

expect_not_lambda("(a->b)");
expect_not_lambda("a+b");
Expand Down
3 changes: 3 additions & 0 deletions src/rust/ide/lib/parser/tests/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,13 @@ impl Fixture {
, "freeze bar"
, "case foo of\n bar"
, "import foo"
, "import"
, "export bar"
, "from bar import all"
, "from bar export bo"
, "a ->"
, "-> a"
, "(a -> b) -> c"
];

for macro_usage in macro_usages.iter() {
Expand Down