lib/formulae/parse/formula_peg.txt in rubyfromexcel-0.0.10 vs lib/formulae/parse/formula_peg.txt in rubyfromexcel-0.0.13
- old
+ new
@@ -2,14 +2,14 @@
expression = string_join | comparison | arithmetic | thing
thing = function | brackets | any_reference | string | percentage | number | boolean | prefix | named_reference
argument = expression | null
function := /[A-Z]+/ `'(' space argument? (space `',' space argument)* space `')'
brackets := `'(' space expression+ space `')'
-string_join := thing (space `"&" space thing)+
+string_join := (arithmetic | thing) (space `"&" space (arithmetic | thing))+
arithmetic := thing (space operator space thing)+
comparison := (arithmetic | thing) space comparator space (arithmetic | thing)
comparator := '>=' | '<=' | '<>' | '>' | '<' | '='
-string := `'"' /[^"]*/ `'"'
+string := `'"' /(""|[^"])*/ `'"'
any_reference = external_reference | any_internal_reference
any_internal_reference = table_reference | local_table_reference | quoted_sheet_reference | sheet_reference | sheetless_reference
percentage := /[-+]?[0-9]+\.?[0-9]*/ `'%'
number := /[-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?/
operator := '+' | '-' | '/' | '*' | '^'