pycplus 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -0
  3. data/lib/pcpparse.rb +6 -5
  4. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 573f59a30af939f137fba7684ca507a4c0726598b9b98a9596761be93ced4906
4
- data.tar.gz: 4158857a428507fa891adfb036516ff7cdd242532d69f68b8203e5131de34ed3
3
+ metadata.gz: b5ad55e5bb630968fc874f2b4864d1157f613387a386963d80ae70a059f7fe82
4
+ data.tar.gz: 3f9cd2e36bb0307ad340f1e0279904761d0bf0b6d1f8f14a61cb86230aacc0b6
5
5
  SHA512:
6
- metadata.gz: a43a5652ee52fe8bf6fe771ee78ca88ee4a695f8cee399994fc86d722437ccef6e09ccb66367066da7823b506d8a9ec96597b765a8288385e11c8f48a526b824
7
- data.tar.gz: cbbd8b500dc0fc67bc3bc55936c67acdf2e324436ddcdde6951ff95ff6c479a2275afd193f4fba3139ad291e13ec2d2fcaa12abcdfafedd075e44ed8905aac41
6
+ metadata.gz: fd8d3e774ffa9e0008799e40a612a4f0855736f4ffb7a80c7bd47b0215586e054b8843f3eb9c01b212bd11b651a593510531ad439a0a8ec5a5b3abd8d16c6587
7
+ data.tar.gz: a425b2c00467899bedaa54b2ba471b731f10f3013daf726295b0105e5258ac8253e6e33dc16a551d0cd52a2f5a35048bb7c5578b7b9c36664534cc019c901988
data/README.md CHANGED
@@ -13,11 +13,36 @@ To install PyCPlus, you can simply use RubyGems:
13
13
  gem install pycplus
14
14
  ```
15
15
 
16
+ ## Flags
17
+
18
+ Several flags can be used with the gem.
19
+
20
+ Type the following command to see the available flags:
21
+
22
+ ```bash
23
+ pycplus -h
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ The programming language is to be used with files of type .pcp.
29
+
30
+ To run a file, navigate to the directory where the file is located and type the following command:
31
+
32
+ ```bash
33
+ pycplus filename.pcp
34
+ ```
16
35
 
17
36
  ## Unit testing
18
37
 
19
38
  Unit tests can be ran from the projects test directory.
20
39
 
40
+ Navigate to the projectfolder and type the following command:
41
+
21
42
  ```bash
22
43
  rake
23
44
  ```
45
+
46
+ ## Additional documentation
47
+
48
+ Additional documentation about the language and system can be found in the 'doc' directory. This documentation is in Swedish.
data/lib/pcpparse.rb CHANGED
@@ -238,14 +238,15 @@ class Pycplus
238
238
  end
239
239
 
240
240
  def parse_file(filename)
241
- file = File.open(filename)
242
- file_data = file.read
241
+ file_data = File.read(filename)
242
+ result = nil
243
243
  begin
244
- result = @pycplus_parser.parse(file_data)
244
+ ast = @pycplus_parser.parse(file_data)
245
+ result = ast.evaluate if ast
245
246
  rescue StandardError => e
246
- puts "Something went wrong! Error #{e.message}"
247
+ puts "Something went wrong! #{e.class}: #{e.message}"
247
248
  end
248
- return result.evaluate if result
249
+ return result
249
250
  end
250
251
 
251
252
  def parse_string(str, return_tree = false, display_output = false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pycplus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-07 00:00:00.000000000 Z
12
+ date: 2024-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -31,8 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.6.0
34
- description: This Ruby Gem provides a framework for creating and utilizing a programming
35
- language developed as part of a school project at LiU (Linköping University).
34
+ description: This Ruby Gem provides the tools to parse, interpret, and execute programs
35
+ written in a custom programming language, developed as part of a school project
36
+ at LiU (Linköping University).
36
37
  email: test@test.com
37
38
  executables:
38
39
  - pycplus
@@ -66,5 +67,5 @@ requirements: []
66
67
  rubygems_version: 3.3.5
67
68
  signing_key:
68
69
  specification_version: 4
69
- summary: A Ruby Gem for creating and using a programming language.
70
+ summary: A Ruby Gem for creating and running programs in a custom language.
70
71
  test_files: []