mork-parser 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bed8800b4f506dcf34185682e440188ebc60a0d40afb6709b3de078e8d8cd35d
4
- data.tar.gz: 2efabe69f325398a9982d9eabcb44cf88898f581245ce3d4863f07b5a2ad815d
3
+ metadata.gz: f748648d306d200d547fb0897aaefd464c59c43e6e762990fc9f8d4b15383431
4
+ data.tar.gz: 3d385b5f89f12761f8e8776216380f5879cb97cf488e4ab22a6f83b91065f1be
5
5
  SHA512:
6
- metadata.gz: 25845a115fbed77f346cd14cf14d9c2be85b03bb73d95b130dea0a28c4c18ff3694b6e1fab0ef6708bbf2512b4e1bf1500260b72fe42d103de75d1512c1e4ac0
7
- data.tar.gz: 12cb8b831ac111de6848008c5e84183a4651d6e197dfd07d4b092badf74aa37083b12b34d959471696958e2043ba51d70c34eb1222aefa8ad79ee911409856b4
6
+ metadata.gz: 14c31d3c29257c950ab861bb98425bb2f7bc3a08b76a68418156b2c6fbe4f6c49d25a24f2d47673a3c0f8772a8b3dd0d0c8b2f4a91c9dd64654a463826f76381
7
+ data.tar.gz: 98b9221a5cbb6396c72abe2dbb65b9c452d843462501128ed785f2af998a8cf46390113d6a2c98d3a4e62de061d1dac3cd40821711ee93fa60bdee969cdfb50b
data/README.md CHANGED
@@ -35,6 +35,25 @@ and then run `rake release`, which will create a git tag for the version,
35
35
  push git commits and the created tag,
36
36
  and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
37
 
38
+ ## Lexer/Parser Modifications
39
+
40
+ The lexer, `parser/mork.rex`, is written in [Rexical grammar](https://github.com/tenderlove/rexical).
41
+
42
+ After changes, regenerate the Ruby lexer code:
43
+
44
+ ```sh
45
+ $ rex parser/mork.rex --output-file lib/mork/lexer.rb
46
+ ```
47
+
48
+ The parser, which uses the symbols lexed by `lib/mork/lexer.rb`,
49
+ is `parser/mork.y`.
50
+
51
+ To regenerate the parser:
52
+
53
+ ```sh
54
+ $ racc parser/mork.y --output-file lib/mork/parser.rb
55
+ ```
56
+
38
57
  ## Contributing
39
58
 
40
59
  Bug reports and pull requests are welcome on GitHub at https://github.com/joeyates/mork.
data/lib/mork/lexer.rb CHANGED
@@ -255,7 +255,7 @@ class Mork::Lexer < Racc::Parser
255
255
  action { @stack.push(@state); @state = :ROW; [:row_in, text] }
256
256
 
257
257
  when (text = @ss.scan(/\-[A-Z0-9]+\s*/))
258
- action { [:row_delete, text] }
258
+ action { [:row_delete, text] }
259
259
 
260
260
  when (text = @ss.scan(/[A-Z0-9]+(:[^\s]+\s)?/))
261
261
  action { [:table_row_ref, text] }
data/lib/mork/raw/id.rb CHANGED
@@ -26,15 +26,15 @@ module Mork
26
26
  private
27
27
 
28
28
  def action
29
- ACTIONS[parts[:action]]
29
+ ACTIONS[parts["action"]]
30
30
  end
31
31
 
32
32
  def id
33
- parts[:id]
33
+ parts["id"]
34
34
  end
35
35
 
36
36
  def raw_namespace
37
- parts[:raw_namespace]
37
+ parts["raw_namespace"]
38
38
  end
39
39
 
40
40
  def resolve_namespace(dictionaries)
@@ -56,7 +56,7 @@ module Mork
56
56
  \A
57
57
  \{? # The lexer captures the table delimiter
58
58
  (?<action>-)? # The optional action can indicate deletion
59
- (?<id>[0-9]+) # Tables are numbered
59
+ (?<id>[A-F0-9]+) # Tables are numbered
60
60
  (
61
61
  :
62
62
  (?<raw_namespace>
data/lib/mork.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mork
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
data/mork.gemspec CHANGED
@@ -24,4 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = []
26
26
  spec.require_paths = ["lib"]
27
+
28
+ spec.add_runtime_dependency "racc", "~> 1.7"
27
29
  end
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mork-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Yates
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-22 00:00:00.000000000 Z
12
- dependencies: []
13
- description:
11
+ date: 2024-03-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: racc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ description:
14
28
  email:
15
29
  - joe.g.yates@gmail.com
16
30
  executables: []
@@ -46,7 +60,7 @@ metadata:
46
60
  source_code_uri: https://github.com/joeyates/mork
47
61
  changelog_uri: https://github.com/joeyates/mork/blob/main/CHANGELOG.md
48
62
  rubygems_mfa_required: 'true'
49
- post_install_message:
63
+ post_install_message:
50
64
  rdoc_options: []
51
65
  require_paths:
52
66
  - lib
@@ -61,8 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
75
  - !ruby/object:Gem::Version
62
76
  version: '0'
63
77
  requirements: []
64
- rubygems_version: 3.4.10
65
- signing_key:
78
+ rubygems_version: 3.5.3
79
+ signing_key:
66
80
  specification_version: 4
67
81
  summary: Parse Mork databases (as used by Mozilla Thunderbird)
68
82
  test_files: []