lib/ebnf/base.rb in ebnf-2.4.0 vs lib/ebnf/base.rb in ebnf-2.5.0
- old
+ new
@@ -1,6 +1,7 @@
require 'strscan'
+require 'sxp' unless defined?(SXP)
# Extended Bakus-Nour Form (EBNF), being the W3C variation is
# originaly defined in the
# [W3C XML 1.0 Spec](https://www.w3.org/TR/REC-xml/#sec-notation).
#
@@ -150,10 +151,9 @@
rule.orig = r
@ast << rule
end
end
when :sxp
- require 'sxp' unless defined?(SXP)
@ast = SXP::Reader::Basic.read(input).map {|e| Rule.from_sxp(e)}
else
raise "unknown input format #{format.inspect}"
end
\ No newline at end of file