Compare commits
No commits in common. "dff40e6b275a340d03b21a1f522b6d94eb59d468" and "9109c4d6809290c37df63cfea8616c9e5701118f" have entirely different histories.
dff40e6b27
...
9109c4d680
11 changed files with 15 additions and 46 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1 @@
|
||||||
__pycache__/
|
__pycache__/
|
||||||
bin/
|
|
||||||
|
|
|
||||||
1
README
1
README
|
|
@ -7,7 +7,6 @@ A personal little MATLAB alternative I suppose :)
|
||||||
In future I'd love to start using a developed TUI library like [textual](https://github.com/Textualize/textual?tab=readme-ov-file),
|
In future I'd love to start using a developed TUI library like [textual](https://github.com/Textualize/textual?tab=readme-ov-file),
|
||||||
but for now everything is just a custom ANSI wrapper thing.
|
but for now everything is just a custom ANSI wrapper thing.
|
||||||
|
|
||||||
Noether can compile to C or Nim via their respective backends.
|
|
||||||
|
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
Todo:
|
|
||||||
- [ ] Not currently sure how the lexer will interpret non-latin characters (make sure it handles all unicode)
|
|
||||||
- [ ] The lexer currently only handles a limited number of escape codes / whitespace characters
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
loop:
|
|
||||||
print("Goodbye world!")
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
loop:
|
|
||||||
print("Goodbye world!")
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
loop:
|
|
||||||
print("Goodbye world!")
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
"Goodbye World!"
|
|
||||||
'a'
|
|
||||||
'abc' # ERROR
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
author = "Emile Clark-Boman"
|
author = "Emile Clark-Boman"
|
||||||
description = "Type theoretic imperative and logic language for mathematical programming"
|
description = "Type theoretic imperative and logic language for mathematical programming"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
srcDir = "src"
|
srcDir = "src"
|
||||||
binDir = "bin"
|
|
||||||
installExt = @["nim"]
|
installExt = @["nim"]
|
||||||
bin = @["noether", "nlx"]
|
bin = @["noether", "nlx"]
|
||||||
backend = "c"
|
|
||||||
|
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
requires "nim >= 2.2.0"
|
requires "nim >= 2.2.0"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import os
|
||||||
import noether/lex
|
import noether/lex
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
echo "Noether Lang Extras v0.1.0 - nlx"
|
echo "Noether Lang - Extras"
|
||||||
|
|
||||||
if paramCount() > 0:
|
if paramCount() > 0:
|
||||||
let filename = paramStr(1)
|
let filename = paramStr(1)
|
||||||
|
|
|
||||||
|
|
@ -10,19 +10,16 @@ type
|
||||||
TERM, # String \0 terminator
|
TERM, # String \0 terminator
|
||||||
WORD, # Alphanumeric token
|
WORD, # Alphanumeric token
|
||||||
SYMB, # Symbolic token
|
SYMB, # Symbolic token
|
||||||
LNFD, # \r \n Line-Feed
|
LNFD, # Line-Feed
|
||||||
WTSP, # ' ' \t Whitespace
|
WTSP, # Whitespace
|
||||||
LPAR, # ( Left Parenthesis
|
LPAR, # (
|
||||||
RPAR, # ) Right Parenthesis
|
RPAR, # )
|
||||||
LBRA, # { Left Brace
|
LBRA, # {
|
||||||
RBRA, # } Right Brace
|
RBRA, # }
|
||||||
LSQB, # [ Left Square Bracket
|
LSQB, # [
|
||||||
RSQB, # ] Right Square Bracket
|
RSQB, # ]
|
||||||
# LANB, # < Left Angle Bracket
|
LANB, # <
|
||||||
# RANB, # > Right Angle Bracket
|
RANB, # >
|
||||||
SQUO, # ' Single Quotation Marking
|
|
||||||
DQUO, # " Double Quotation Marking
|
|
||||||
GRVA, # ` Grave Accent
|
|
||||||
|
|
||||||
nlTok = object
|
nlTok = object
|
||||||
tokType*: nlTokType
|
tokType*: nlTokType
|
||||||
|
|
@ -70,27 +67,13 @@ proc getTokType(c: char): nlTokType =
|
||||||
case c:
|
case c:
|
||||||
of '\0':
|
of '\0':
|
||||||
result = nlTokType.TERM
|
result = nlTokType.TERM
|
||||||
of '\r', '\n':
|
of '\n':
|
||||||
result = nlTokType.LNFD
|
result = nlTokType.LNFD
|
||||||
of ' ', '\t':
|
of ' ':
|
||||||
result = nlTokType.WTSP
|
result = nlTokType.WTSP
|
||||||
of '(':
|
of '(':
|
||||||
result = nlTokType.LPAR
|
result = nlTokType.LPAR
|
||||||
of ')':
|
of ')':
|
||||||
result = nlTokType.RPAR
|
result = nlTokType.RPAR
|
||||||
of '{':
|
|
||||||
result = nlTokType.LBRA
|
|
||||||
of '}':
|
|
||||||
result = nlTokType.RBRA
|
|
||||||
of '[':
|
|
||||||
result = nlTokType.LSQB
|
|
||||||
of ']':
|
|
||||||
result = nlTokType.RSQB
|
|
||||||
of '\'':
|
|
||||||
result = nlTokType.SQUO
|
|
||||||
of '\"':
|
|
||||||
result = nlTokType.DQUO
|
|
||||||
of '`':
|
|
||||||
result = nlTokType.GRVA
|
|
||||||
else:
|
else:
|
||||||
result = nlTokType.WORD
|
result = nlTokType.WORD
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue