-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[syntax] use "@cicada-lang/partech" to implement new syntax
- Loading branch information
Showing
28 changed files
with
264 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
(defcons sole 0 1) | ||
defcons sole 0 1 end | ||
|
||
(defcons null 0 1) | ||
(defcons cons 2 1) | ||
defcons null 0 1 end | ||
defcons cons 2 1 end | ||
|
||
(defcons diff 2 1) | ||
defcons diff 2 1 end | ||
|
||
(defelim diff-append 2 1) | ||
defelim diff_append 2 1 end | ||
|
||
(defrule (diff diff-append) | ||
(let diff-list end start) | ||
end diff-list diff-open start diff) | ||
defru diff diff_append | ||
(let start) (let fin) (let diff_list) | ||
fin diff_list diff_open start diff | ||
end | ||
|
||
(defelim diff-open 2 1) | ||
defelim diff_open 2 1 end | ||
|
||
(defrule (diff diff-open) | ||
(let list end start) | ||
list end connect | ||
start) | ||
defru diff diff_open | ||
(let start) (let fin) (let list) | ||
list fin connect | ||
start | ||
end | ||
|
||
(defnet one-two-soles | ||
defnet one_two_soles | ||
wire sole cons diff | ||
wire sole cons sole cons diff | ||
diff-append) | ||
diff_append | ||
end | ||
|
||
(defnet two-two-soles | ||
defnet two_two_soles | ||
wire sole cons sole cons diff | ||
wire sole cons sole cons diff | ||
diff-append) | ||
diff_append | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
(defcons sole 0 1) | ||
defcons sole 0 1 end | ||
|
||
(defcons null 0 1) | ||
defcons null 0 1 end | ||
|
||
(defcons cons 2 1) | ||
defcons cons 2 1 end | ||
|
||
(defelim append 2 1) | ||
defelim append 2 1 end | ||
|
||
(defrule (null append)) | ||
defru null append end | ||
|
||
(defrule (cons append) (let head) append head cons) | ||
defru cons append (let head) append head cons end | ||
|
||
(defnet six-soles | ||
defnet six_soles | ||
null sole cons sole cons sole cons | ||
null sole cons sole cons sole cons | ||
append) | ||
append | ||
end |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
(defcons zero 0 1) | ||
defcons zero 0 1 end | ||
|
||
(defcons add1 1 1) | ||
defcons add1 1 1 end | ||
|
||
(defelim add 2 1) | ||
defelim add 2 1 end | ||
|
||
(defrule (zero add)) | ||
defru zero add end | ||
|
||
(defrule (add1 add) add add1) | ||
defru add1 add add add1 end | ||
|
||
(defnet two | ||
defnet two | ||
zero add1 | ||
zero add1 | ||
add) | ||
add | ||
end | ||
|
||
(defnet four | ||
two two add) | ||
defnet four | ||
two two add | ||
end |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { ParsingError } from "@cicada-lang/sexp/lib/errors" | ||
export { ParsingError } from "@cicada-lang/partech/lib/errors" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { Span } from "@cicada-lang/sexp/lib/span" | ||
export { Span } from "@cicada-lang/partech/lib/span" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as pt from "@cicada-lang/partech" | ||
|
||
export const zero_or_more = pt.grammars.zero_or_more | ||
export const one_or_more = pt.grammars.one_or_more | ||
export const optional = pt.grammars.optional | ||
export const dashline = pt.grammars.dashline | ||
|
||
export * from "./name" | ||
export * from "./stmt" | ||
export * from "./word" |
Oops, something went wrong.