Skip to content

Commit

Permalink
Syntax: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Apr 19, 2024
1 parent 5dc90f8 commit 4e18b80
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions data/syntax.no
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ trait Baz<U> { fn a(self): Unit fn f<T>(self): T {} }
impl <T> Baz<Option<T>> for Bar<T> { fn f(self): T {} }
fn foo<T: std::io::Show + U, U>(b: T): Option<U> {
let a = [1, "str", 'c', true, Option::None(), Option::Some(value: 1), Option::Some(2)]
let s = "interp {foo("nest {'b'}")}"
let Foo::Foo(x) = Foo::Foo(4)
let b = if a.next().isSome() { a } else { [] }
let b2 = a.next()!.await?
Expand All @@ -18,9 +19,11 @@ fn foo<T: std::io::Show + U, U>(b: T): Option<U> {
match c.foo() {
-5 if a.count() > 6 {}
a @ V::B(v, o: _) {}
[1, s @ _, tail] {}
V::B() {}
"str" {}
'c' {}
_ {}
}
}

5 changes: 2 additions & 3 deletions nois.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ statement ::= var-def | fn-def | trait-def | impl-def | type-def | r
div-op ::= SLASH;
exp-op ::= CARET;
mod-op ::= PERCENT;
access-op ::= PERIOD;
eq-op ::= EQUALS EQUALS;
ne-op ::= EXCL EQUALS;
ge-op ::= C-ANGLE EQUALS;
Expand Down Expand Up @@ -141,7 +140,7 @@ pattern ::= pattern-bind? pattern-expr
;
con-pattern ::= identifier con-pattern-params
;
con-pattern-parms ::= O-PAREN (field-pattern (COMMA field-pattern)*)? COMMA? C-PAREN
con-pattern-params::= O-PAREN (field-pattern (COMMA field-pattern)*)? COMMA? C-PAREN
;
field-pattern ::= NAME (COLON pattern)?
;
Expand All @@ -153,7 +152,7 @@ number ::= MINUS? (INT | FLOAT)
;
string ::= D-QUOTE string-part* D-QUOTE
;
string-part ::= STRING | O-BRACE operand C-BRACE
string-part ::= STRING | O-BRACE expr C-BRACE
;
bool ::= TRUE | FALSE
;
1 change: 0 additions & 1 deletion src/ast/op.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export const buildBinaryOp = (node: ParseNode): BinaryOp => {
'div-op',
'exp-op',
'mod-op',
'access-op',
'eq-op',
'ne-op',
'ge-op',
Expand Down
2 changes: 1 addition & 1 deletion src/parser/fns/expr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const parseString = (parser: Parser): void => {
}

/*
* string-part ::= STRING | O-BRACE operand C-BRACE
* string-part ::= STRING | O-BRACE expr C-BRACE
*/
export const parseStringPart = (parser: Parser): void => {
const mark = parser.open()
Expand Down
1 change: 0 additions & 1 deletion src/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const treeKinds = <const>[
'unwrap-op',
'bind-op',
'await-op',
'access-op',
'arg',
'closure-expr',
'closure-params',
Expand Down

0 comments on commit 4e18b80

Please sign in to comment.