changed comment syntax to avoid clashing with the very common *)

sequence
This commit is contained in:
William Ball 2024-11-20 12:23:41 -08:00
parent 0012f4e974
commit f915663f94
3 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ Type ascriptions are optional. If included, `perga` will check to make sure your
If the RHS of a definition is `axiom`, then `perga` will assume that the identifier is an inhabitant of the type ascribed to it (as such when using axioms, a type ascription is required). This allows you to use axioms. If the RHS of a definition is `axiom`, then `perga` will assume that the identifier is an inhabitant of the type ascribed to it (as such when using axioms, a type ascription is required). This allows you to use axioms.
Line comments are `--` like in Haskell, and block comments are `(* *)` like ML (and nest properly). There is no significant whitespace, so you are free to format code as you wish. Line comments are `--` like in Haskell, and block comments are `[* *]` somewhat like ML (and nest properly). There is no significant whitespace, so you are free to format code as you wish.
# Usage # Usage
@ -120,7 +120,7 @@ Obviously not fully decidable, but I might be able to implement some basic unifi
### TODO Implicits ### TODO Implicits
Much, much more useful than [inference](#orgdba513b), implicit arguments would be amazing. It also seems a lot more complicated, but any system for dealing with implicit arguments is far better than none. Getting rid of stuff like [lines 213-215 of the example file](./examples/example.pg) would be amazing. Much, much more useful than [inference](#orgfd5754c), implicit arguments would be amazing. It also seems a lot more complicated, but any system for dealing with implicit arguments is far better than none. Getting rid of stuff like [lines 213-215 of the example file](./examples/example.pg) would be amazing.
### TODO Module System ### TODO Module System
@ -130,7 +130,7 @@ A proper module system would be wonderful. To me, ML style modules with structur
### TODO Universes? ### TODO Universes?
Not really all that necessary, especially without [inductive definitions](#org1f674ce), but could be fun. Not really all that necessary, especially without [inductive definitions](#org3e4a465), but could be fun.
### TODO Inductive Definitions ### TODO Inductive Definitions
@ -197,7 +197,7 @@ I’m imagining the parser could be chosen based on the file extension or so
### TODO treesitter parser and/or emacs mode ### TODO treesitter parser and/or emacs mode
Really not necessary, especially while the syntax is in a bit of flux, but would eventually be nice. The syntax is simple enough that a treesitter grammar shouldn’t be too hard to write. An emacs mode would especially be nice if I ever get end up implementing an [alternate syntax](#org4dd267a), to better handle indentation, automatically adjust line numbers, etc. Really not necessary, especially while the syntax is in a bit of flux, but would eventually be nice. The syntax is simple enough that a treesitter grammar shouldn’t be too hard to write. An emacs mode would especially be nice if I ever get end up implementing an [alternate syntax](#org461e006), to better handle indentation, automatically adjust line numbers, etc.
### TODO TUI ### TODO TUI

View file

@ -28,7 +28,7 @@ Type ascriptions are optional. If included, =perga= will check to make sure your
If the RHS of a definition is =axiom=, then =perga= will assume that the identifier is an inhabitant of the type ascribed to it (as such when using axioms, a type ascription is required). This allows you to use axioms. If the RHS of a definition is =axiom=, then =perga= will assume that the identifier is an inhabitant of the type ascribed to it (as such when using axioms, a type ascription is required). This allows you to use axioms.
Line comments are =--= like in Haskell, and block comments are =(* *)= like ML (and nest properly). There is no significant whitespace, so you are free to format code as you wish. Line comments are =--= like in Haskell, and block comments are =[* *]= somewhat like ML (and nest properly). There is no significant whitespace, so you are free to format code as you wish.
* Usage * Usage
Running =perga= without any arguments drops you into a basic repl. From here, you can type in definitions which =perga= will typecheck. Previous definitions are accessible in future definitions. The usual readline keybindings are available, including navigating history, which is saved between sessions (in =~/.cache/perga/history=). In the repl, you can enter ":q", press C-c, or press C-d to quit. Entering ":e" shows everything that has been defined along with their types. Entering ":t <ident>" prints the type of a particular identifier. Entering ":n <expr>" will fully normalize (including unfolding definitions) an expression. Running =perga= without any arguments drops you into a basic repl. From here, you can type in definitions which =perga= will typecheck. Previous definitions are accessible in future definitions. The usual readline keybindings are available, including navigating history, which is saved between sessions (in =~/.cache/perga/history=). In the repl, you can enter ":q", press C-c, or press C-d to quit. Entering ":e" shows everything that has been defined along with their types. Entering ":t <ident>" prints the type of a particular identifier. Entering ":n <expr>" will fully normalize (including unfolding definitions) an expression.

View file

@ -49,7 +49,7 @@ skipSpace =
L.space L.space
space1 space1
(L.skipLineComment "--") (L.skipLineComment "--")
(L.skipBlockCommentNested "(*" "*)") (L.skipBlockCommentNested "[*" "*]")
lexeme :: Parser a -> Parser a lexeme :: Parser a -> Parser a
lexeme = L.lexeme skipSpace lexeme = L.lexeme skipSpace