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 +4 -4
- data/README.md +19 -0
- data/lib/mork/lexer.rb +1 -1
- data/lib/mork/raw/id.rb +4 -4
- data/lib/mork.rb +1 -1
- data/mork.gemspec +2 -0
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f748648d306d200d547fb0897aaefd464c59c43e6e762990fc9f8d4b15383431
|
4
|
+
data.tar.gz: 3d385b5f89f12761f8e8776216380f5879cb97cf488e4ab22a6f83b91065f1be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 {
|
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[
|
29
|
+
ACTIONS[parts["action"]]
|
30
30
|
end
|
31
31
|
|
32
32
|
def id
|
33
|
-
parts[
|
33
|
+
parts["id"]
|
34
34
|
end
|
35
35
|
|
36
36
|
def raw_namespace
|
37
|
-
parts[
|
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>[
|
59
|
+
(?<id>[A-F0-9]+) # Tables are numbered
|
60
60
|
(
|
61
61
|
:
|
62
62
|
(?<raw_namespace>
|
data/lib/mork.rb
CHANGED
data/mork.gemspec
CHANGED
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.
|
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-
|
12
|
-
dependencies:
|
13
|
-
|
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.
|
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: []
|