remulang / urgent-lang Goto Github PK
View Code? Open in Web Editor NEWThe urgent programming language. might not be academic enough or excellent, merely as a better tool for better reasoning things.
License: MIT License
The urgent programming language. might not be academic enough or excellent, merely as a better tool for better reasoning things.
License: MIT License
Currently, the exceptions are not well-rendered, and I just collect the error here,
urgent-lang/urgent/compiler.py
Lines 81 to 85 in 1fc741a
Lines 62 to 64 in 1fc741a
Also, many exceptions raised when compiling are just this simple, without a proper exception type specified:
urgent-lang/urgent/compiler.py
Line 309 in 1fc741a
To narrow the exception types, we might create a new module called excs
, and make some new exception types in this module, for raising during compilation. The existing exception types might be migrated to excs
module.
To pretty print the exceptions, we might create a method in excs
to well render the exception to string message.
随便写写, 能用就行.
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- ugt
scope: source.urgent
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: keywords
- include: numbers
- include: strings
- include: operators
- include: cases
keywords:
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '\b(data|match|rec|True|False|and|or|else|for|while|let|def|module|in|infixl|infixr|open|do)\b'
scope: keyword.control.example-c
cases:
- match: '\b[A-Z][a-zA-Z_0-9]*\b'
scope: entity.name.class
numbers:
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.example-c
operators:
- match: '->|=>|and|or'
scope: keyword.operator.haskell
strings:
# Strings begin and end with quotes, and use backslashes as an escape
# character.
- match: '"'
scope: punctuation.definition.string.begin.example-c
push: inside_string
inside_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.example-c
- match: '\.'
scope: constant.character.escape.example-c
- match: '"'
scope: punctuation.definition.string.end.example-c
pop: true
comments:
# Comments begin with a '//' and finish at the end of the line.
- match: '//'
scope: punctuation.definition.comment.example-c
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.double-slash.example-c
- match: $\n?
pop: true
I gave up thinking. HMF is okay.
urgent-lang/urgent/compiler.py
Line 627 in bcd4ec7
I tried to run examples in README.md
, but got an error. :(
Python version: 3.7
install urgent-lang by:
pip3 install urgent
pip3 install prompt_toolkit
urgent-lang version:
$ pip3 show urgent
Name: urgent
Version: 0.1.1
Summary: UNKNOWN
Home-page: https://github.com/RemuLang/urgent
Author: thautawarm
Author-email: [email protected]
License: mit
Location: /usr/local/lib/python3.7/site-packages
Requires: toml, remu-operator, argser, rbnf-rts, sijuiacion-lang
Required-by:
# Sen @ Sen in ~/github/urgent-lang on git:master x [15:38:45]
$ ls
LICENSE build-parser.sh dev3.py test urgent_stmt.exrbnf
README.md cli.py hello.ugt urgent
base dev.py mininal_sijuiacion urgent.exrbnf
bootstrap.toml dev2.py setup.py urgent.rlex
# Sen @ Sen in ~/github/urgent-lang on git:master x [15:38:47]
$ ugt repl
Urgent> import Hello
Traceback (most recent call last):
File "/usr/local/bin/ugt", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/urgent/cli.py", line 73, in main
subs.parse()
File "/usr/local/lib/python3.7/site-packages/argser/parse_func.py", line 136, in parse
return self.functions[name](**data)
File "/usr/local/lib/python3.7/site-packages/urgent/repl1s.py", line 59, in repl
print('=>', eval(code, ctx, ctx))
File "import Hello", line 11, in <repl>
File "base", line 1, in tailcall
TypeError: cannot unpack non-iterable module object
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.