Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion isc.artifact.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion lib/interscript/isc/grammar/concerns/primitives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ module Primitives
str('"').as(:dquote) |
str("\\").as(:backslash) |
(str("u") >> match(/[0-9a-fA-F]/).repeat(4, 4).as(:unicode)) |
(str("U") >> match(/[0-9a-fA-F]/).repeat(8, 8).as(:unicode))
# The corpus converter emits \U with 4 hex digits too
# (gki-bel "\U040E") — accept 4..8, don't be stricter than
# the corpus.
(str("U") >> match(/[0-9a-fA-F]/).repeat(4, 8).as(:unicode))
)
end

Expand Down
5 changes: 3 additions & 2 deletions lib/interscript/isc/grammar/isc.parg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ grammar InterscriptIsc version "0.1.0" {
esc_dq = "\"" as dquote
esc_bs = "\\" as backslash
esc_uni4 = "u" (4hexd) as unicode
esc_uni8 = "U" (8hexd) as unicode
esc_uni8 = "U" (4*8hexd) as unicode
escape_sequence = "\\" (esc_nl / esc_cr / esc_tab / esc_dq / esc_bs / esc_uni4 / esc_uni8)

raw_run = 1*(!("\\" / "\"") chr)
Expand Down Expand Up @@ -129,8 +129,9 @@ grammar InterscriptIsc version "0.1.0" {

item_atom_start = "\"" / "'" / ident_first
cont_stop = "to" / "before" / "after" / "not_before" / "not_after" / "}"
alias_decl_stop = identifier [ws] "="
item_atom = quoted_string / none_lit / zw_primitive / any_char_lit / any_ctor / capture_ctor / maybe_ctor / some_ctor / fn_lit / capture_reference / alias_reference
item = (item_atom 0*(item_sep !cont_stop &item_atom_start item_atom)) as concatenation
item = (item_atom 0*(item_sep !cont_stop !(alias_decl_stop) &item_atom_start item_atom)) as concatenation

# -- rules and stages ---------------------------------------------------

Expand Down
Loading