lib/formulae/parse/formula_peg.rb in rubyfromexcel-0.0.17 vs lib/formulae/parse/formula_peg.rb in rubyfromexcel-0.0.18
- old
+ new
@@ -1,5 +1,6 @@
+# encoding: utf-8
require 'rubypeg'
class Formula < RubyPeg
def root
@@ -109,11 +110,11 @@
ignore { terminal("[") } && (range_structured_reference || complex_structured_reference || overly_structured_reference || simple_structured_reference) && ignore { terminal("]") }
end
end
def table_name
- terminal(/[.a-zA-Z0-9_]+/)
+ terminal(/[.\p{Word}]+/)
end
def range_structured_reference
terminal(/\[[^\u005d]*\],\[[^\u005d]*\]:\[[^\u005d]*\]/)
end
@@ -130,11 +131,11 @@
terminal(/[^\u005d]*/)
end
def named_reference
node :named_reference do
- terminal(/[#a-zA-Z][\w_.!]+/)
+ terminal(/[\p{Word}#][\p{Word}.!]*/)
end
end
def quoted_sheet_reference
node :quoted_sheet_reference do
@@ -142,10 +143,10 @@
end
end
def sheet_reference
node :sheet_reference do
- terminal(/[a-zA-Z0-9][\w_.]+/) && ignore { terminal("!") } && (sheetless_reference || named_reference)
+ terminal(/[\p{Word}][\p{Word}_.]+/) && ignore { terminal("!") } && (sheetless_reference || named_reference)
end
end
def single_quoted_string
ignore { terminal("'") } && terminal(/[^']*/) && ignore { terminal("'") }