Skip to content

Commit

Permalink
Added inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilescur committed May 1, 2018
1 parent 590c0b6 commit 22e11b9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.2

- Added `[INPUT]` function.

## 1.0.1

- Added `[PRIME:x]` function.
Expand Down
2 changes: 1 addition & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:io';

main(List<String> arguments) {
print('Procedural Footnote Language Interpreter');
print('[Version 1.0.1] - (c) Radu Vasilescu, 2018.');
print('[Version 1.0.2] - (c) Radu Vasilescu, 2018.');
print('');

if (arguments.length < 1) {
Expand Down
5 changes: 5 additions & 0 deletions lib/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:pfl/PflProgram.dart';
import 'package:pfl/errors.dart';

import 'dart:math';
import 'dart:io';


// ################# ParamFunctions ################# //
Expand Down Expand Up @@ -273,6 +274,10 @@ class ConstFunction extends Element {
return 'Hi, Sherry!';
break;

case 'INPUT':
return stdin.readLineSync();
break;

case 'RET':
return '\n'; // Carriage return
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Parser {
// Constant Functions
else if ([
'ABC', 'BEEP', 'DATE', 'FALSE', 'HS',
'RET', 'SPACE', 'TAB', 'TIME',
'INPUT', 'RET', 'SPACE', 'TAB', 'TIME',
'TRUE', 'VER', 'ZEN'
].contains(tagText)) {
newElem = new ConstFunction(tagText);
Expand Down
44 changes: 44 additions & 0 deletions newrelease.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@echo off

if exist main.dart.snapshot (
echo Deleting main.dart.snapshot
del main.dart.snapshot
)

echo Creating snapshot...
dart --snapshot=main.dart.snapshot bin/main.dart

if exist ..\dartbin-master\main.dart.snapshot (
echo Deleting snapshot from dartbin...
del ..\dartbin-master\main.dart.snapshot
)

echo Moving shapshot file...
move main.dart.snapshot ..\dartbin-master

cd ..\dartbin-master

echo Generating Go files...
dart bin/main.dart main.dart.snapshot

cd go_src

if exist go_src.exe (
echo Deleting go_src.exe ...
del go_src.exe
)

if exist pfl.exe (
echo Deleting pfl.exe ...
del pfl.exe
)

echo Running Go build...
env GOPATH=C:\Users\vasil\Desktop\Programming\Dart\dartbin-master\go_src go build -v
echo Go build finished.

echo Renaming file...
rename go_src.exe pfl.exe

echo Done.
cd ..\..\pfl
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pfl
description: An interpreter for Procedural Footnote Language
version: 1.0.1
version: 1.0.2
author: Radu Vasilescu <[email protected]>

environment:
Expand Down

0 comments on commit 22e11b9

Please sign in to comment.