Skip to content

Commit a85ecc9

Browse files
committed
fix(isc): any_character primitive, stray identifiers in rule_line
- Add any_character as an item_atom (matches any single char) - rule_line now accepts comment_item (comments + stray identifiers) inside parallel/sequence blocks Verification: 278/289 (96.5%), 9 ISC fail.
1 parent 0dca3b6 commit a85ecc9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lib/interscript/isc/grammar/concerns/items.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Items
1414
quoted_string |
1515
str("none").as(:none) |
1616
zero_width_primitive |
17+
any_character |
1718
any_constructor |
1819
capture_constructor |
1920
maybe_constructor |
@@ -48,6 +49,11 @@ module Items
4849
).as(:primitive)
4950
end
5051

52+
# any_character — matches any single character.
53+
rule(:any_character) do
54+
str("any_character").as(:any_char)
55+
end
56+
5157
rule(:any_constructor) do
5258
str("any") >> str("(") >> whitespace? >>
5359
(range_arg | set_arg | alias_arg).as(:any) >>
@@ -114,7 +120,8 @@ module Items
114120
str("none") | str("boundary") | str("line_start") |
115121
str("line_end") | str("word_boundary") |
116122
str("downcase") | str("upcase") | str("title_case") |
117-
str("capture") | str("maybe") | str("some") | str("ref")
123+
str("capture") | str("maybe") | str("some") | str("ref") |
124+
str("any_character")
118125
end
119126

120127
# Concatenation: one or more atoms. The continuation pattern

lib/interscript/isc/grammar/concerns/stages.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module Stages
6262
end
6363

6464
rule(:rule_line) do
65-
whitespace? >> rule >> whitespace?
65+
whitespace? >> (rule | comment_item) >> whitespace?
6666
end
6767

6868
# A rule is either compact form (single line) or block form

0 commit comments

Comments
 (0)