Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Productive2 2021-02-28 14:11:29 +01:00
commit 17913f1d7c
6 changed files with 66 additions and 17 deletions

View File

@ -19,8 +19,17 @@ jobs:
# We test using a reasonably modern Python version
python-version: 3.8.0
architecture: x64
- name: Setup Nim environment
uses: jiro4989/setup-nim-action@v1.1.4
with:
nim-version: stable
- uses: actions/checkout@v2
- name: Setup dependencies
run: |
git clone https://github.com/japl-lang/jale --branch 0.1.0
cd jale
nimble install
- name: Run production-mode tests
run: ./build.py --profile resources/profiles/production.json
run: ./build.py --profile resources/profiles/production.json src
- name: Run developmet tests
run: ./build.py --profile resources/profiles/production.json
run: ./build.py --profile resources/profiles/production.json src

33
.github/workflows/website.yml vendored Normal file
View File

@ -0,0 +1,33 @@
# Automatically pushes the README to the website repo
name: Deploy website
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
push_readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure git credentials
uses: OleksiyRudenko/gha-git-credentials@v2-latest
with:
global: true
email: github-action@users.noreply.github.com
name: GitHub Action
actor: github.actor
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Push README to japl-lang.github.io
run: |
git clone https://github.com/japl-lang/japl-lang.github.io
cd japl-lang.github.io
cp ../README.md .
git add README.md
git commit -m "Actions: Update README"
git push

6
.gitignore vendored
View File

@ -41,6 +41,8 @@ jats
*.deps
*.dot
# Development scripts
setenv.sh
# Python bytecode cache
__pycache__
*.pyc

View File

@ -220,14 +220,14 @@ def build(path: str, flags: Optional[Dict[str, str]] = {}, options: Optional[Dic
logging.debug(f"Path '{path}' is not writable, attempting next entry in PATH")
except Exception as fatal:
logging.error(f"A fatal unhandled exception occurred -> {type(fatal).__name__}: {fatal}")
return False
logging.debug(f"JAPL installed at '{path}', setting executable permissions")
# TODO: Use external oschmod library once we support windows!
try:
os.chmod(install_path, os.stat(install_path).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
except Exception as fatal:
logging.error(f"A fatal unhandled exception occurred -> {type(fatal).__name__}: {fatal}")
break
else:
logging.debug(f"JAPL installed at '{path}', setting executable permissions")
# TODO: Use external oschmod library once we support windows!
try:
os.chmod(install_path, os.stat(install_path).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
except Exception as fatal:
logging.error(f"A fatal unhandled exception occurred -> {type(fatal).__name__}: {fatal}")
break
return True

View File

@ -310,6 +310,11 @@ proc binary(self: Compiler, canAssign: bool) =
of TokenType.DEQ:
self.emitByte(OpCode.Equal)
of TokenType.GT:
# To allow for chaining of greater/less comparisons in the future (without doing
# weird stuff such as allowing false with the greater/less than operators)
# we need to move their logic in another function. This will
# also allow for a sort of short-circuiting control flow like
# for logical ands and ors, because why not?
self.emitByte(OpCode.Greater)
of TokenType.GE:
self.emitByte(OpCode.GreaterOrEqual)

View File

@ -31,12 +31,14 @@ import jale/plugin/defaults
import jale/plugin/history
import jale/plugin/editor_history
proc getLineEditor: LineEditor =
result = newLineEditor()
result.prompt = "=> "
result.populateDefaults() # setup default keybindings
let hist = result.plugHistory() # create history object
result.bindHistory(hist) # set default history keybindings
result.populateDefaults() # setup default keybindings
let hist = result.plugHistory() # create history object
result.bindHistory(hist) # set default history keybindings
proc repl(bytecodeVM: VM) =
var bytecodeVM = bytecodeVM
@ -58,8 +60,6 @@ proc repl(bytecodeVM: VM) =
continue
elif source == "//exit" or source == "// exit":
echo "Goodbye!"
echo JAPL_VERSION_STRING
echo nimDetails
break
elif source != "":
discard bytecodeVM.interpret(source, "stdin")