Skip to content

Commit

Permalink
quit using hand writing parser
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Apr 28, 2024
1 parent a922f99 commit 397398b
Show file tree
Hide file tree
Showing 34 changed files with 11 additions and 366 deletions.
9 changes: 0 additions & 9 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ type constraint should not be `String(x)`
- should be `The(String, x)`
- or just `x: String`

# syntax

> remove partech -- use hand write parser
parseOperator
parseOperand
parseStmt & parseStmts
loopUntilEnd

# chimera

[chimera] 如何在逻辑式中恢复部分的过程式 contral flow?
Expand Down
10 changes: 0 additions & 10 deletions src/lang/syntax-old/index.ts

This file was deleted.

49 changes: 0 additions & 49 deletions src/lang/syntax/Lexer.test.ts

This file was deleted.

107 changes: 0 additions & 107 deletions src/lang/syntax/Lexer.ts

This file was deleted.

64 changes: 0 additions & 64 deletions src/lang/syntax/Parser.test.ts

This file was deleted.

84 changes: 0 additions & 84 deletions src/lang/syntax/Parser.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/lang/syntax/Span.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/lang/syntax/Token.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lang/syntax/TokenTable.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 10 additions & 4 deletions src/lang/syntax/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export * from "./Lexer.js"
export * from "./Parser.js"
export * from "./Span.js"
export * from "./Token.js"
import * as pt from "@cicada-lang/partech"
import * as grammars from "./grammars/index.js"
import * as matchers from "./matchers/index.js"

export const parseStmts = pt.gen_parse({
preprocess: pt.preprocess.erase_comment,
lexer: pt.lexers.common,
grammar: pt.grammar_start(grammars, "stmts"),
matcher: matchers.stmts_matcher,
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions src/lang/syntax/parseExp.ts

This file was deleted.

Loading

0 comments on commit 397398b

Please sign in to comment.