diff --git a/Makefile b/Makefile index 80206550..f1b3aa5b 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ install-dependencies-ocaml: menhirLib \ dune dune-build-info \ cmdliner obelisk \ - tls cohttp lwt cohttp-lwt-unix yojson\ re reason\ obelisk\ ocamlgraph @@ -159,7 +158,9 @@ all: install-dependencies build doc tests all_examples website-assets clean: dune clean $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) clean - $(MAKE) -C $(ENGLISH_DUMMY_DIR) clean + $(MAKE) -C $(US_TAX_CODE_DIR) clean + $(MAKE) -C $(TUTORIAL_DIR) clean + $(MAKE) -C $(CODE_GENERAL_IMPOTS_DIR) clean inspect: gitinspector -f ml,mli,mly,iro,tex,catala,md,ir --grading diff --git a/dune-project b/dune-project index 265f8117..6829ba13 100644 --- a/dune-project +++ b/dune-project @@ -31,26 +31,5 @@ ) ) -(package - (name legifrance_catala) - (synopsis "Interaction tool between French Catala programs and the LegiFrance API") - (depends - (ocaml (>= 4.07.0)) - (ANSITerminal (>= 0.8.2)) - (sedlex (>= 2.1)) - (menhir (>= 20200211)) - (menhirLib (>= 20200211)) - (dune-build-info (>= 2.0.1)) - (cmdliner (>= 1.0.4)) - (re (>= 1.9.0)) - (dune (and :build )) - (reason ( >= 3.6.0)) - (yojson ( >= 1.7.0)) - (cohttp-lwt-unix ( >= 2.5.1)) - (lwt ( >= 5.3.0)) - (cohttp ( >= 2.5.1)) - (tls ( >= 0.11.1)) - ) -) (using menhir 2.1) diff --git a/examples/us_tax_code/section_132.catala_en b/examples/us_tax_code/section_132.catala_en index 04b1575d..03354484 100644 --- a/examples/us_tax_code/section_132.catala_en +++ b/examples/us_tax_code/section_132.catala_en @@ -1,11 +1,8 @@ @@Section 132@@ -/* -# We only formalize part (c) here -*/ - @@Begin metadata@@ /* +# We only formalize part (c) here declaration enumeration DiscountType: -- Property -- Services diff --git a/legifrance_catala.opam b/legifrance_catala.opam deleted file mode 100644 index 3e952633..00000000 --- a/legifrance_catala.opam +++ /dev/null @@ -1,42 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -version: "0.1.1" -synopsis: - "Interaction tool between French Catala programs and the LegiFrance API" -maintainer: ["denis.merigoux@inria.fr"] -authors: ["Denis Merigoux"] -license: "Apache2" -homepage: "https://github.com/CatalaLang/catala" -bug-reports: "https://github.com/CatalaLang/catala/issues" -depends: [ - "ocaml" {>= "4.07.0"} - "ANSITerminal" {>= "0.8.2"} - "sedlex" {>= "2.1"} - "menhir" {>= "20200211"} - "menhirLib" {>= "20200211"} - "dune-build-info" {>= "2.0.1"} - "cmdliner" {>= "1.0.4"} - "re" {>= "1.9.0"} - "dune" {build} - "reason" {>= "3.6.0"} - "yojson" {>= "1.7.0"} - "cohttp-lwt-unix" {>= "2.5.1"} - "lwt" {>= "5.3.0"} - "cohttp" {>= "2.5.1"} - "tls" {>= "0.11.1"} -] -build: [ - ["dune" "subst"] {pinned} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/CatalaLang/catala.git" diff --git a/src/catala/catala_surface/catala_ast.ml b/src/catala/catala_surface/catala_ast.ml index ce67d5a4..ee7fb811 100644 --- a/src/catala/catala_surface/catala_ast.ml +++ b/src/catala/catala_surface/catala_ast.ml @@ -189,14 +189,21 @@ type law_include = | CatalaFile of string Pos.marked | LegislativeText of string Pos.marked -type program_item = - | LawHeading of string * int - | LawArticle of law_article +type law_article_item = | LawText of string | CodeBlock of code_block * source_repr - | MetadataBlock of code_block * source_repr | LawInclude of law_include +type law_heading = { law_heading_name : string; law_heading_precedence : int } + +type law_structure = + | LawHeading of law_heading * law_structure list + | LawArticle of law_article * law_article_item list + | MetadataBlock of code_block * source_repr + | IntermediateText of string + +type program_item = LawStructure of law_structure + type program = { program_items : program_item list; program_source_files : string list } type source_file_or_master = diff --git a/src/catala/catala_surface/desugaring.ml b/src/catala/catala_surface/desugaring.ml index 34893447..e5295c83 100644 --- a/src/catala/catala_surface/desugaring.ml +++ b/src/catala/catala_surface/desugaring.ml @@ -206,13 +206,30 @@ let process_scope_use (ctxt : Name_resolution.context) (prgm : Scope_ast.program let translate_program_to_scope (ctxt : Name_resolution.context) (prgm : Catala_ast.program) : Scope_ast.program = let empty_prgm = Uid.ScopeMap.empty in - let processer (prgm : Scope_ast.program) (item : Catala_ast.program_item) : Scope_ast.program = + let processer_article_item (prgm : Scope_ast.program) (item : Catala_ast.law_article_item) : + Scope_ast.program = match item with - | CodeBlock (block, _) | MetadataBlock (block, _) -> + | CodeBlock (block, _) -> List.fold_left (fun prgm item -> match Pos.unmark item with ScopeUse use -> process_scope_use ctxt prgm use | _ -> prgm) prgm block | _ -> prgm in - List.fold_left processer empty_prgm prgm.program_items + let rec processer_structure (prgm : Scope_ast.program) (item : Catala_ast.law_structure) : + Scope_ast.program = + match item with + | LawHeading (_, children) -> + List.fold_left (fun prgm child -> processer_structure prgm child) prgm children + | LawArticle (_, children) -> + List.fold_left (fun prgm child -> processer_article_item prgm child) prgm children + | MetadataBlock (b, c) -> processer_article_item prgm (CodeBlock (b, c)) + | IntermediateText _ -> prgm + in + + let processer_item (prgm : Scope_ast.program) (item : Catala_ast.program_item) : Scope_ast.program + = + match item with LawStructure s -> processer_structure prgm s + in + + List.fold_left processer_item empty_prgm prgm.program_items diff --git a/src/catala/catala_surface/name_resolution.ml b/src/catala/catala_surface/name_resolution.ml index 11b7ca97..277411ca 100644 --- a/src/catala/catala_surface/name_resolution.ml +++ b/src/catala/catala_surface/name_resolution.ml @@ -237,12 +237,29 @@ let process_code_block (ctxt : context) (block : Catala_ast.code_block) (process_item : context -> Catala_ast.code_item Pos.marked -> context) : context = List.fold_left (fun ctxt decl -> process_item ctxt decl) ctxt block +(** Process a program item *) +let process_law_article_item (ctxt : context) (item : Catala_ast.law_article_item) + (process_item : context -> Catala_ast.code_item Pos.marked -> context) : context = + match item with CodeBlock (block, _) -> process_code_block ctxt block process_item | _ -> ctxt + +(** Process a law structure *) +let rec process_law_structure (ctxt : context) (s : Catala_ast.law_structure) + (process_item : context -> Catala_ast.code_item Pos.marked -> context) : context = + match s with + | Catala_ast.LawHeading (_, children) -> + List.fold_left (fun ctxt child -> process_law_structure ctxt child process_item) ctxt children + | Catala_ast.LawArticle (_, children) -> + List.fold_left + (fun ctxt child -> process_law_article_item ctxt child process_item) + ctxt children + | Catala_ast.MetadataBlock (b, c) -> + process_law_article_item ctxt (Catala_ast.CodeBlock (b, c)) process_item + | Catala_ast.IntermediateText _ -> ctxt + (** Process a program item *) let process_program_item (ctxt : context) (item : Catala_ast.program_item) (process_item : context -> Catala_ast.code_item Pos.marked -> context) : context = - match item with - | CodeBlock (block, _) | MetadataBlock (block, _) -> process_code_block ctxt block process_item - | _ -> ctxt + match item with Catala_ast.LawStructure s -> process_law_structure ctxt s process_item (** Derive the context from metadata, in two passes *) let form_context (prgm : Catala_ast.program) : context = diff --git a/src/catala/catala_surface/parser.messages b/src/catala/catala_surface/parser.messages index efdd6065..14aefb32 100644 --- a/src/catala/catala_surface/parser.messages +++ b/src/catala/catala_surface/parser.messages @@ -1,6 +1,55 @@ -source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR CONTENT YEAR +source_file_or_master: BEGIN_METADATA BEGIN_CODE END_CODE YEAR ## -## Ends in an error in state: 261. +## Ends in an error in state: 271. +## +## metadata_block -> BEGIN_CODE code END_CODE . END_METADATA [ LAW_TEXT LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA ] +## +## The known suffix of the stack is as follows: +## BEGIN_CODE code END_CODE +## + + + +source_file_or_master: BEGIN_METADATA BEGIN_CODE YEAR +## +## Ends in an error in state: 12. +## +## metadata_block -> BEGIN_CODE . code END_CODE END_METADATA [ LAW_TEXT LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA ] +## +## The known suffix of the stack is as follows: +## BEGIN_CODE +## + + + +source_file_or_master: BEGIN_METADATA YEAR +## +## Ends in an error in state: 11. +## +## source_file_item -> BEGIN_METADATA . metadata_block [ LAW_TEXT LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA ] +## +## The known suffix of the stack is as follows: +## BEGIN_METADATA +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR CONTENT TEXT YEAR +## +## Ends in an error in state: 265. +## +## nonempty_list(enum_decl_line) -> enum_decl_line . [ SCOPE END_CODE DECLARATION ] +## nonempty_list(enum_decl_line) -> enum_decl_line . nonempty_list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] +## +## The known suffix of the stack is as follows: +## enum_decl_line +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR CONTENT YEAR +## +## Ends in an error in state: 260. ## ## enum_decl_line_payload -> CONTENT . typ [ SCOPE END_CODE DECLARATION ALT ] ## @@ -8,12 +57,11 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRU ## CONTENT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#257 + -source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRUCTOR YEAR ## -## Ends in an error in state: 260. +## Ends in an error in state: 259. ## ## enum_decl_line -> ALT constructor . option(enum_decl_line_payload) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -21,12 +69,11 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT CONSTRU ## ALT constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#256 + -source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT YEAR ## -## Ends in an error in state: 259. +## Ends in an error in state: 258. ## ## enum_decl_line -> ALT . constructor option(enum_decl_line_payload) [ SCOPE END_CODE DECLARATION ALT ] ## @@ -34,12 +81,11 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON ALT YEAR ## ALT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#255 + -source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 258. +## Ends in an error in state: 257. ## ## code_item -> DECLARATION ENUM constructor COLON . nonempty_list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -47,12 +93,11 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR COLON YEAR ## DECLARATION ENUM constructor COLON ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#254 + -source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM CONSTRUCTOR YEAR ## -## Ends in an error in state: 257. +## Ends in an error in state: 256. ## ## code_item -> DECLARATION ENUM constructor . COLON nonempty_list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -60,12 +105,11 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM CONSTRUCTOR YEAR ## DECLARATION ENUM constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#253 + -source_file_or_master: BEGIN_CODE DECLARATION ENUM YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION ENUM YEAR ## -## Ends in an error in state: 256. +## Ends in an error in state: 255. ## ## code_item -> DECLARATION ENUM . constructor COLON nonempty_list(enum_decl_line) [ SCOPE END_CODE DECLARATION ] ## @@ -73,12 +117,47 @@ source_file_or_master: BEGIN_CODE DECLARATION ENUM YEAR ## DECLARATION ENUM ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#252 + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONTENT BOOLEAN DEPENDS BOOLEAN DEPENDS +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONDITION YEAR ## -## Ends in an error in state: 253. +## Ends in an error in state: 250. +## +## scope_decl_item -> CONTEXT ident CONDITION . option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] +## +## The known suffix of the stack is as follows: +## CONTEXT ident CONDITION +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONTENT TEXT YEAR +## +## Ends in an error in state: 248. +## +## scope_decl_item -> CONTEXT ident CONTENT typ . option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] +## +## The known suffix of the stack is as follows: +## CONTEXT ident CONTENT typ +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONTENT YEAR +## +## Ends in an error in state: 247. +## +## scope_decl_item -> CONTEXT ident CONTENT . typ option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] +## +## The known suffix of the stack is as follows: +## CONTEXT ident CONTENT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT SCOPE CONSTRUCTOR YEAR +## +## Ends in an error in state: 252. ## ## nonempty_list(scope_decl_item) -> scope_decl_item . [ SCOPE END_CODE DECLARATION ] ## nonempty_list(scope_decl_item) -> scope_decl_item . nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] @@ -87,39 +166,24 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT ID ## scope_decl_item ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#250 + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONTENT TEXT DATA -## -## Ends in an error in state: 249. -## -## scope_decl_item -> CONTEXT ident CONTENT typ . option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] -## -## The known suffix of the stack is as follows: -## CONTEXT ident CONTENT typ -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#228 - -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT CONTENT YEAR -## -## Ends in an error in state: 248. -## -## scope_decl_item -> CONTEXT ident CONTENT . typ option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] -## -## The known suffix of the stack is as follows: -## CONTEXT ident CONTENT -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#227 - -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT SCOPE YEAR ## ## Ends in an error in state: 245. ## +## scope_decl_item -> CONTEXT ident SCOPE . constructor [ SCOPE END_CODE DECLARATION CONTEXT ] +## +## The known suffix of the stack is as follows: +## CONTEXT ident SCOPE +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT IDENT YEAR +## +## Ends in an error in state: 244. +## ## scope_decl_item -> CONTEXT ident . CONTENT typ option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> CONTEXT ident . SCOPE constructor [ SCOPE END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> CONTEXT ident . CONDITION option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] @@ -128,12 +192,11 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT ID ## CONTEXT ident ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#226 + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT YEAR ## -## Ends in an error in state: 244. +## Ends in an error in state: 243. ## ## scope_decl_item -> CONTEXT . ident CONTENT typ option(struct_scope_func) [ SCOPE END_CODE DECLARATION CONTEXT ] ## scope_decl_item -> CONTEXT . ident SCOPE constructor [ SCOPE END_CODE DECLARATION CONTEXT ] @@ -143,12 +206,11 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON CONTEXT YE ## CONTEXT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#225 + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 243. +## Ends in an error in state: 242. ## ## code_item -> DECLARATION SCOPE constructor COLON . nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -156,11 +218,11 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR COLON YEAR ## DECLARATION SCOPE constructor COLON ## -Scope declarations must have at least one context element + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR YEAR ## -## Ends in an error in state: 242. +## Ends in an error in state: 241. ## ## code_item -> DECLARATION SCOPE constructor . COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -168,12 +230,11 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE CONSTRUCTOR YEAR ## DECLARATION SCOPE constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#223 + -source_file_or_master: BEGIN_CODE DECLARATION SCOPE YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION SCOPE YEAR ## -## Ends in an error in state: 241. +## Ends in an error in state: 240. ## ## code_item -> DECLARATION SCOPE . constructor COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] ## @@ -181,12 +242,11 @@ source_file_or_master: BEGIN_CODE DECLARATION SCOPE YEAR ## DECLARATION SCOPE ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#222 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS COLLECTION BEGIN_METADATA +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS COLLECTION YEAR ## -## Ends in an error in state: 228. +## Ends in an error in state: 227. ## ## typ -> collection_marked . typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONTEXT CONDITION ALT ] ## @@ -194,12 +254,35 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION ## collection_marked ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#198 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS OPTIONAL YEAR ## -## Ends in an error in state: 232. +## Ends in an error in state: 224. +## +## typ -> optional_marked . typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONTEXT CONDITION ALT ] +## +## The known suffix of the stack is as follows: +## optional_marked +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS TEXT YEAR +## +## Ends in an error in state: 235. +## +## list(struct_scope) -> struct_scope . list(struct_scope) [ SCOPE END_CODE DECLARATION ] +## +## The known suffix of the stack is as follows: +## struct_scope +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT DEPENDS YEAR +## +## Ends in an error in state: 231. ## ## struct_scope_func -> DEPENDS . typ [ SCOPE END_CODE DECLARATION DATA CONTEXT CONDITION ] ## @@ -207,12 +290,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION ## DEPENDS ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#213 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION IDENT YEAR ## -## Ends in an error in state: 231. +## Ends in an error in state: 230. ## ## struct_scope -> struct_scope_base . option(struct_scope_func) [ SCOPE END_CODE DECLARATION DATA CONDITION ] ## @@ -220,11 +302,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION ## struct_scope_base ## -Unexpected token, struct scope declaration is over at this point + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION YEAR ## -## Ends in an error in state: 238. +## Ends in an error in state: 237. ## ## struct_scope_base -> condition_pos . ident [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -232,12 +314,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON CONDITION ## condition_pos ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#219 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT CONTENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT CONTENT YEAR ## -## Ends in an error in state: 214. +## Ends in an error in state: 213. ## ## struct_scope_base -> DATA ident CONTENT . typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -245,12 +326,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDEN ## DATA ident CONTENT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#195 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDENT YEAR ## -## Ends in an error in state: 213. +## Ends in an error in state: 212. ## ## struct_scope_base -> DATA ident . CONTENT typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -258,12 +338,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA IDEN ## DATA ident ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#194 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA YEAR ## -## Ends in an error in state: 212. +## Ends in an error in state: 211. ## ## struct_scope_base -> DATA . ident CONTENT typ [ SCOPE END_CODE DEPENDS DECLARATION DATA CONDITION ] ## @@ -271,12 +350,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON DATA YEAR ## DATA ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#193 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 211. +## Ends in an error in state: 210. ## ## code_item -> DECLARATION STRUCT constructor COLON . list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -284,12 +362,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR COLON YEAR ## DECLARATION STRUCT constructor COLON ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#192 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR YEAR ## -## Ends in an error in state: 210. +## Ends in an error in state: 209. ## ## code_item -> DECLARATION STRUCT constructor . COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -297,12 +374,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT CONSTRUCTOR YEAR ## DECLARATION STRUCT constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#191 + -source_file_or_master: BEGIN_CODE DECLARATION STRUCT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION STRUCT YEAR ## -## Ends in an error in state: 209. +## Ends in an error in state: 208. ## ## code_item -> DECLARATION STRUCT . constructor COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## @@ -310,12 +386,11 @@ source_file_or_master: BEGIN_CODE DECLARATION STRUCT YEAR ## DECLARATION STRUCT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#190 + -source_file_or_master: BEGIN_CODE DECLARATION YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE DECLARATION YEAR ## -## Ends in an error in state: 208. +## Ends in an error in state: 207. ## ## code_item -> DECLARATION . STRUCT constructor COLON list(struct_scope) [ SCOPE END_CODE DECLARATION ] ## code_item -> DECLARATION . SCOPE constructor COLON nonempty_list(scope_decl_item) [ SCOPE END_CODE DECLARATION ] @@ -325,12 +400,11 @@ source_file_or_master: BEGIN_CODE DECLARATION YEAR ## DECLARATION ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#189 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL THEN +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL THEN ## -## Ends in an error in state: 205. +## Ends in an error in state: 204. ## ## nonempty_list(scope_item) -> scope_item . [ SCOPE END_CODE DECLARATION ] ## nonempty_list(scope_item) -> scope_item . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] @@ -342,157 +416,23 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL THE ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 42, spurious reduction of production primitive_expression -> CARDINAL -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 103, spurious reduction of production logical_expression -> compare_expression -## In state 110, spurious reduction of production expression -> logical_expression -## In state 202, spurious reduction of production assertion_base -> expression -## In state 203, spurious reduction of production assertion -> option(condition_consequence) assertion_base -## In state 204, spurious reduction of production scope_item -> ASSERTION assertion +## In state 41, spurious reduction of production primitive_expression -> CARDINAL +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression +## In state 201, spurious reduction of production assertion_base -> expression +## In state 202, spurious reduction of production assertion -> option(condition_consequence) assertion_base +## In state 203, spurious reduction of production scope_item -> ASSERTION assertion ## -Unexpected token after a scope item + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CARDINAL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT BY YEAR ## -## Ends in an error in state: 42. -## -## aggregate_func -> CARDINAL . [ FOR ] -## primitive_expression -> CARDINAL . [ WITH THEN SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## CARDINAL -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#43 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CONSTRUCTOR CONTENT MONEY_AMOUNT YEAR -## -## Ends in an error in state: 128. -## -## enum_inject_content -> CONTENT small_expression . [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## small_expression -> small_expression . ARROW constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] -## small_expression -> small_expression . DOT ident [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] -## -## The known suffix of the stack is as follows: -## CONTENT small_expression -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#68 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CONSTRUCTOR CONTENT YEAR -## -## Ends in an error in state: 63. -## -## enum_inject_content -> CONTENT . small_expression [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## struct_or_enum_inject_content -> CONTENT . LPAREN ALT separated_nonempty_list(ALT,struct_content_field) RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## CONTENT -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#67 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION CONSTRUCTOR YEAR -## -## Ends in an error in state: 62. -## -## struct_or_enum_inject -> constructor . struct_or_enum_inject_content [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## constructor -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#66 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS IDENT IN CARDINAL SUCH THAT YEAR -## -## Ends in an error in state: 118. -## -## expression -> exists_prefix . expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] -## -## The known suffix of the stack is as follows: -## exists_prefix -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#113 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS IDENT IN NOW SUCH YEAR -## -## Ends in an error in state: 124. -## -## exists_prefix -> exists_marked ident IN primitive_expression SUCH . THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## exists_marked ident IN primitive_expression SUCH -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#119 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS IDENT IN NOW YEAR -## -## Ends in an error in state: 123. -## -## exists_prefix -> exists_marked ident IN primitive_expression . SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## exists_marked ident IN primitive_expression -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#118 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS IDENT IN YEAR -## -## Ends in an error in state: 122. -## -## exists_prefix -> exists_marked ident IN . primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## exists_marked ident IN -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#117 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS IDENT YEAR -## -## Ends in an error in state: 121. -## -## exists_prefix -> exists_marked ident . IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## exists_marked ident -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#116 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION EXISTS YEAR -## -## Ends in an error in state: 120. -## -## exists_prefix -> exists_marked . ident IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## exists_marked -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#115 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT BY YEAR -## -## Ends in an error in state: 199. +## Ends in an error in state: 198. ## ## assertion -> FIXED qident BY . ident [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -500,12 +440,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT ## FIXED qident BY ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#180 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT WITH_V +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT WITH_V ## -## Ends in an error in state: 198. +## Ends in an error in state: 197. ## ## assertion -> FIXED qident . BY ident [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -516,16 +455,15 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED IDENT ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 178, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 160, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## In state 177, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 159, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#179 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED YEAR ## -## Ends in an error in state: 197. +## Ends in an error in state: 196. ## ## assertion -> FIXED . qident BY ident [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] ## @@ -533,12 +471,533 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FIXED YEAR ## FIXED ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#178 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDENT IN CARDINAL WE_HAVE YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION CARDINAL CONSEQUENCE BY ## -## Ends in an error in state: 111. +## Ends in an error in state: 200. +## +## assertion -> option(condition_consequence) . assertion_base [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## option(condition_consequence) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION CARDINAL THEN +## +## Ends in an error in state: 169. +## +## condition_consequence -> condition . CONSEQUENCE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FILLED FALSE EXISTS DEFINED_AS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## condition +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 41, spurious reduction of production primitive_expression -> CARDINAL +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression +## In state 162, spurious reduction of production condition -> UNDER_CONDITION expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION YEAR +## +## Ends in an error in state: 161. +## +## condition -> UNDER_CONDITION . expression [ CONSEQUENCE ] +## +## The known suffix of the stack is as follows: +## UNDER_CONDITION +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT UNDER_CONDITION +## +## Ends in an error in state: 189. +## +## assertion -> VARIES qident . WITH_V base_expression option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## VARIES qident +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 177, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 159, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V TRUE THEN +## +## Ends in an error in state: 191. +## +## assertion -> VARIES qident WITH_V base_expression . option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## VARIES qident WITH_V base_expression +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V YEAR +## +## Ends in an error in state: 190. +## +## assertion -> VARIES qident WITH_V . base_expression option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## VARIES qident WITH_V +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES YEAR +## +## Ends in an error in state: 188. +## +## assertion -> VARIES . qident WITH_V base_expression option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## VARIES +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION YEAR +## +## Ends in an error in state: 187. +## +## scope_item -> ASSERTION . assertion [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## ASSERTION +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT DEFINED_AS YEAR +## +## Ends in an error in state: 184. +## +## definition -> qident option(definition_parameters) option(condition_consequence) DEFINED_AS . expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## qident option(definition_parameters) option(condition_consequence) DEFINED_AS +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT OF IDENT DECREASING +## +## Ends in an error in state: 182. +## +## definition -> qident option(definition_parameters) . option(condition_consequence) DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## qident option(definition_parameters) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT UNDER_CONDITION CARDINAL CONSEQUENCE DECREASING +## +## Ends in an error in state: 183. +## +## definition -> qident option(definition_parameters) option(condition_consequence) . DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## qident option(definition_parameters) option(condition_consequence) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT WITH_V +## +## Ends in an error in state: 181. +## +## definition -> qident . option(definition_parameters) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## qident +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 177, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 159, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION YEAR +## +## Ends in an error in state: 180. +## +## scope_item -> DEFINITION . definition [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## DEFINITION +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT DOT YEAR +## +## Ends in an error in state: 178. +## +## separated_nonempty_list(DOT,ident) -> ident DOT . separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] +## +## The known suffix of the stack is as follows: +## ident DOT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT NOT FALSE +## +## Ends in an error in state: 166. +## +## rule_consequence -> option(NOT) . FILLED [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## option(NOT) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF IDENT YEAR +## +## Ends in an error in state: 160. +## +## rule -> rule_expr . option(condition_consequence) rule_consequence [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## rule_expr +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF YEAR +## +## Ends in an error in state: 173. +## +## definition_parameters -> OF . ident [ UNDER_CONDITION NOT FILLED DEFINED_AS ] +## +## The known suffix of the stack is as follows: +## OF +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT UNDER_CONDITION TRUE CONSEQUENCE FALSE +## +## Ends in an error in state: 163. +## +## rule -> rule_expr option(condition_consequence) . rule_consequence [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## rule_expr option(condition_consequence) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT WITH_V +## +## Ends in an error in state: 172. +## +## rule_expr -> qident . option(definition_parameters) [ UNDER_CONDITION NOT FILLED ] +## +## The known suffix of the stack is as follows: +## qident +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 177, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident +## In state 159, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT YEAR +## +## Ends in an error in state: 177. +## +## separated_nonempty_list(DOT,ident) -> ident . [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] +## separated_nonempty_list(DOT,ident) -> ident . DOT separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] +## +## The known suffix of the stack is as follows: +## ident +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE YEAR +## +## Ends in an error in state: 158. +## +## scope_item -> RULE . rule [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## +## The known suffix of the stack is as follows: +## RULE +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR COLON YEAR +## +## Ends in an error in state: 157. +## +## code_item -> SCOPE constructor option(scope_use_condition) COLON . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] +## +## The known suffix of the stack is as follows: +## SCOPE constructor option(scope_use_condition) COLON +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CARDINAL YEAR +## +## Ends in an error in state: 41. +## +## aggregate_func -> CARDINAL . [ FOR ] +## primitive_expression -> CARDINAL . [ WITH THEN SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## CARDINAL +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN ALT IDENT COLON CARDINAL ALT YEAR +## +## Ends in an error in state: 66. +## +## separated_nonempty_list(ALT,struct_content_field) -> struct_content_field ALT . separated_nonempty_list(ALT,struct_content_field) [ RPAREN ] +## +## The known suffix of the stack is as follows: +## struct_content_field ALT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN ALT IDENT COLON CARDINAL THEN +## +## Ends in an error in state: 65. +## +## separated_nonempty_list(ALT,struct_content_field) -> struct_content_field . [ RPAREN ] +## separated_nonempty_list(ALT,struct_content_field) -> struct_content_field . ALT separated_nonempty_list(ALT,struct_content_field) [ RPAREN ] +## +## The known suffix of the stack is as follows: +## struct_content_field +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 41, spurious reduction of production primitive_expression -> CARDINAL +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 101, spurious reduction of production struct_content_field -> ident COLON logical_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN ALT IDENT COLON YEAR +## +## Ends in an error in state: 69. +## +## struct_content_field -> ident COLON . logical_expression [ RPAREN ALT ] +## +## The known suffix of the stack is as follows: +## ident COLON +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN ALT IDENT YEAR +## +## Ends in an error in state: 68. +## +## struct_content_field -> ident . COLON logical_expression [ RPAREN ALT ] +## +## The known suffix of the stack is as follows: +## ident +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN ALT YEAR +## +## Ends in an error in state: 64. +## +## struct_or_enum_inject_content -> CONTENT LPAREN ALT . separated_nonempty_list(ALT,struct_content_field) RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## CONTENT LPAREN ALT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT LPAREN YEAR +## +## Ends in an error in state: 63. +## +## atomic_expression -> LPAREN . expression RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## struct_or_enum_inject_content -> CONTENT LPAREN . ALT separated_nonempty_list(ALT,struct_content_field) RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## CONTENT LPAREN +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT TRUE YEAR +## +## Ends in an error in state: 127. +## +## enum_inject_content -> CONTENT small_expression . [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression . ARROW constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## small_expression -> small_expression . DOT ident [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## +## The known suffix of the stack is as follows: +## CONTENT small_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR CONTENT YEAR +## +## Ends in an error in state: 62. +## +## enum_inject_content -> CONTENT . small_expression [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## struct_or_enum_inject_content -> CONTENT . LPAREN ALT separated_nonempty_list(ALT,struct_content_field) RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## CONTENT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION CONSTRUCTOR YEAR +## +## Ends in an error in state: 61. +## +## struct_or_enum_inject -> constructor . struct_or_enum_inject_content [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## constructor +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN CARDINAL SUCH THAT YEAR +## +## Ends in an error in state: 117. +## +## expression -> exists_prefix . expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] +## +## The known suffix of the stack is as follows: +## exists_prefix +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN TRUE SUCH YEAR +## +## Ends in an error in state: 123. +## +## exists_prefix -> exists_marked ident IN primitive_expression SUCH . THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## exists_marked ident IN primitive_expression SUCH +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN TRUE WITH +## +## Ends in an error in state: 122. +## +## exists_prefix -> exists_marked ident IN primitive_expression . SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## exists_marked ident IN primitive_expression +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT IN YEAR +## +## Ends in an error in state: 121. +## +## exists_prefix -> exists_marked ident IN . primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## exists_marked ident IN +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS IDENT YEAR +## +## Ends in an error in state: 120. +## +## exists_prefix -> exists_marked ident . IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## exists_marked ident +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION EXISTS YEAR +## +## Ends in an error in state: 119. +## +## exists_prefix -> exists_marked . ident IN primitive_expression SUCH THAT [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] +## +## The known suffix of the stack is as follows: +## exists_marked +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN CARDINAL WE_HAVE YEAR +## +## Ends in an error in state: 110. ## ## expression -> forall_prefix . expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -546,25 +1005,29 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDEN ## forall_prefix ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#106 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDENT IN NOW YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN TRUE WITH ## -## Ends in an error in state: 115. +## Ends in an error in state: 114. ## ## forall_prefix -> for_all_marked ident IN primitive_expression . WE_HAVE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] ## ## The known suffix of the stack is as follows: ## for_all_marked ident IN primitive_expression ## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#110 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDENT IN YEAR +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression ## -## Ends in an error in state: 114. + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT IN YEAR +## +## Ends in an error in state: 113. ## ## forall_prefix -> for_all_marked ident IN . primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] ## @@ -572,12 +1035,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDEN ## for_all_marked ident IN ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#109 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL IDENT YEAR ## -## Ends in an error in state: 113. +## Ends in an error in state: 112. ## ## forall_prefix -> for_all_marked ident . IN primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] ## @@ -585,11 +1047,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL IDEN ## for_all_marked ident ## -A for all construction expects only one ident + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR ALL YEAR ## -## Ends in an error in state: 112. +## Ends in an error in state: 111. ## ## forall_prefix -> for_all_marked . ident IN primitive_expression WE_HAVE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FALSE EXISTS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] ## @@ -597,12 +1059,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR ALL YEAR ## for_all_marked ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#107 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION FOR YEAR ## -## Ends in an error in state: 37. +## Ends in an error in state: 36. ## ## for_all_marked -> FOR . ALL [ IDENT ] ## @@ -610,12 +1071,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION FOR YEAR ## FOR ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#39 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW RULE +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE SCOPE ## -## Ends in an error in state: 135. +## Ends in an error in state: 134. ## ## expression -> IF expression . THEN expression ELSE base_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -626,20 +1086,20 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW RULE ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 103, spurious reduction of production logical_expression -> compare_expression -## In state 110, spurious reduction of production expression -> logical_expression +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#126 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN NOW ELSE YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE THEN TRUE ELSE YEAR ## -## Ends in an error in state: 138. +## Ends in an error in state: 137. ## ## expression -> IF expression THEN expression ELSE . base_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -647,12 +1107,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN ## IF expression THEN expression ELSE ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#129 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN NOW THEN +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE THEN TRUE THEN ## -## Ends in an error in state: 137. +## Ends in an error in state: 136. ## ## expression -> IF expression THEN expression . ELSE base_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -663,20 +1122,20 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 103, spurious reduction of production logical_expression -> compare_expression -## In state 110, spurious reduction of production expression -> logical_expression +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#128 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF TRUE THEN YEAR ## -## Ends in an error in state: 136. +## Ends in an error in state: 135. ## ## expression -> IF expression THEN . expression ELSE base_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -684,12 +1143,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF NOW THEN ## IF expression THEN ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#127 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION IF YEAR ## -## Ends in an error in state: 35. +## Ends in an error in state: 34. ## ## expression -> IF . expression THEN expression ELSE base_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -697,12 +1155,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION IF YEAR ## IF ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#38 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION INT_LITERAL WITH_V +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION INT_LITERAL WITH_V ## -## Ends in an error in state: 55. +## Ends in an error in state: 54. ## ## literal -> num_literal . option(unit_literal) [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -710,11 +1167,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION INT_LITERAL ## num_literal ## -Expecting an unit for the preceding numeric literal, or an operator + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION LPAREN NOW THEN +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LPAREN TRUE THEN ## -## Ends in an error in state: 126. +## Ends in an error in state: 125. ## ## atomic_expression -> LPAREN expression . RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -725,19 +1182,20 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION LPAREN NOW T ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 103, spurious reduction of production logical_expression -> compare_expression -## In state 110, spurious reduction of production expression -> logical_expression +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression ## -Unmatched parenthesis that should have ended before this + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION LPAREN YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION LPAREN YEAR ## -## Ends in an error in state: 33. +## Ends in an error in state: 32. ## ## atomic_expression -> LPAREN . expression RPAREN [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -745,12 +1203,29 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION LPAREN YEAR ## LPAREN ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#36 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR COLON NOT NOW OR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WE_HAVE ## -## Ends in an error in state: 143. +## Ends in an error in state: 139. +## +## expression -> MATCH primitive_expression . WITH match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] +## +## The known suffix of the stack is as follows: +## MATCH primitive_expression +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR COLON NOT TRUE OR +## +## Ends in an error in state: 142. ## ## match_arms -> ALT match_arm . match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -761,20 +1236,20 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 101, spurious reduction of production logical_expression -> logical_unop compare_expression -## In state 147, spurious reduction of production match_arm -> constructor_binding COLON logical_expression +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 100, spurious reduction of production logical_expression -> logical_unop compare_expression +## In state 146, spurious reduction of production match_arm -> constructor_binding COLON logical_expression ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#136 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR COLON YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR COLON YEAR ## -## Ends in an error in state: 146. +## Ends in an error in state: 145. ## ## match_arm -> constructor_binding COLON . logical_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -782,12 +1257,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## constructor_binding COLON ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#139 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR OF CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR OF CONSTRUCTOR YEAR ## -## Ends in an error in state: 151. +## Ends in an error in state: 150. ## ## optional_binding -> OF constructor . constructor_binding [ COLON ] ## @@ -795,12 +1269,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## OF constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#144 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR OF IDENT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR OF IDENT YEAR ## -## Ends in an error in state: 145. +## Ends in an error in state: 144. ## ## match_arm -> constructor_binding . COLON logical_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -808,12 +1281,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## constructor_binding ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#138 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR OF YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR OF YEAR ## -## Ends in an error in state: 149. +## Ends in an error in state: 148. ## ## optional_binding -> OF . ident [ COLON ] ## optional_binding -> OF . constructor constructor_binding [ COLON ] @@ -822,12 +1294,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## OF ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#142 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT CONSTRUCTOR YEAR ## -## Ends in an error in state: 148. +## Ends in an error in state: 147. ## ## constructor_binding -> constructor . optional_binding [ COLON ] ## @@ -835,12 +1306,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## constructor ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#141 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH ALT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH ALT YEAR ## -## Ends in an error in state: 142. +## Ends in an error in state: 141. ## ## match_arms -> ALT . match_arm match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -848,12 +1318,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## ALT ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#135 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WITH YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH TRUE WITH YEAR ## -## Ends in an error in state: 141. +## Ends in an error in state: 140. ## ## expression -> MATCH primitive_expression WITH . match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -861,25 +1330,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW WI ## MATCH primitive_expression WITH ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#134 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH NOW YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MATCH YEAR ## -## Ends in an error in state: 140. -## -## expression -> MATCH primitive_expression . WITH match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] -## -## The known suffix of the stack is as follows: -## MATCH primitive_expression -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#133 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH YEAR -## -## Ends in an error in state: 32. +## Ends in an error in state: 31. ## ## expression -> MATCH . primitive_expression WITH match_arms [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ] ## @@ -887,12 +1342,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MATCH YEAR ## MATCH ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#35 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MINUS YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION MINUS YEAR ## -## Ends in an error in state: 43. +## Ends in an error in state: 42. ## ## sum_expression -> sum_unop . sum_expression [ THEN SCOPE RULE RPAREN OR NOT_EQUAL LESSER_EQUAL LESSER GREATER_EQUAL GREATER EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -900,39 +1354,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MINUS YEAR ## sum_unop ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#44 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MONEY_AMOUNT ARROW YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION NOT YEAR ## -## Ends in an error in state: 49. -## -## small_expression -> small_expression ARROW . constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] -## -## The known suffix of the stack is as follows: -## small_expression ARROW -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#47 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION MONEY_AMOUNT YEAR -## -## Ends in an error in state: 46. -## -## primitive_expression -> small_expression . [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## small_expression -> small_expression . ARROW constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] -## small_expression -> small_expression . DOT ident [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] -## -## The known suffix of the stack is as follows: -## small_expression -## - -Expected operator or new item after expression - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOT YEAR -## -## Ends in an error in state: 100. +## Ends in an error in state: 99. ## ## logical_expression -> logical_unop . compare_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -940,12 +1366,139 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOT YEAR ## logical_unop ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#103 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW IN YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM FOR IDENT IN TRUE OF YEAR ## -## Ends in an error in state: 133. +## Ends in an error in state: 95. +## +## aggregate -> aggregate_func FOR ident IN primitive_expression OF . base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func FOR ident IN primitive_expression OF +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM FOR IDENT IN TRUE WITH +## +## Ends in an error in state: 94. +## +## aggregate -> aggregate_func FOR ident IN primitive_expression . OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func FOR ident IN primitive_expression +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM FOR IDENT IN YEAR +## +## Ends in an error in state: 92. +## +## aggregate -> aggregate_func FOR ident IN . primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func FOR ident IN +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM FOR IDENT YEAR +## +## Ends in an error in state: 91. +## +## aggregate -> aggregate_func FOR ident . IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func FOR ident +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM FOR YEAR +## +## Ends in an error in state: 90. +## +## aggregate -> aggregate_func FOR . ident IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func FOR +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION SUM YEAR +## +## Ends in an error in state: 89. +## +## aggregate -> aggregate_func . FOR ident IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## +## The known suffix of the stack is as follows: +## aggregate_func +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE ARROW YEAR +## +## Ends in an error in state: 48. +## +## small_expression -> small_expression ARROW . constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## +## The known suffix of the stack is as follows: +## small_expression ARROW +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE ASSERTION +## +## Ends in an error in state: 156. +## +## code_item -> SCOPE constructor option(scope_use_condition) . COLON nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] +## +## The known suffix of the stack is as follows: +## SCOPE constructor option(scope_use_condition) +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression +## In state 83, spurious reduction of production mult_expression -> base_expression +## In state 78, spurious reduction of production sum_expression -> mult_expression +## In state 70, spurious reduction of production compare_expression -> sum_expression +## In state 102, spurious reduction of production logical_expression -> compare_expression +## In state 109, spurious reduction of production expression -> logical_expression +## In state 154, spurious reduction of production scope_use_condition -> UNDER_CONDITION expression +## In state 155, spurious reduction of production option(scope_use_condition) -> scope_use_condition +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE DOT YEAR +## +## Ends in an error in state: 46. +## +## small_expression -> small_expression DOT . ident [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## +## The known suffix of the stack is as follows: +## small_expression DOT +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE IN YEAR +## +## Ends in an error in state: 132. ## ## base_expression -> primitive_expression IN . base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -953,11 +1506,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW IN YEAR ## primitive_expression IN ## -Missing collection for testing whether an element is inside a collection or not + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW INCREASING +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE INCREASING ## -## Ends in an error in state: 84. +## Ends in an error in state: 83. ## ## mult_expression -> base_expression . [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## mult_expression -> base_expression . mult_op mult_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] @@ -969,15 +1522,15 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW INCREASI ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression +## In state 45, spurious reduction of production primitive_expression -> small_expression +## In state 50, spurious reduction of production base_expression -> primitive_expression ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#89 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW MULT YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE MULT YEAR ## -## Ends in an error in state: 87. +## Ends in an error in state: 86. ## ## mult_expression -> base_expression mult_op . mult_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -985,11 +1538,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW MULT YEA ## base_expression mult_op ## -Expected expression on the right-hand side of multiplication operator + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW NOT_EQUAL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE NOT_EQUAL YEAR ## -## Ends in an error in state: 78. +## Ends in an error in state: 77. ## ## compare_expression -> sum_expression compare_op . compare_expression [ THEN SCOPE RULE RPAREN OR END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -997,11 +1550,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW NOT_EQUA ## sum_expression compare_op ## -Expected the second term of the comparison + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW OF YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE OF YEAR ## -## Ends in an error in state: 54. +## Ends in an error in state: 53. ## ## base_expression -> primitive_expression OF . base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1009,11 +1562,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW OF YEAR ## primitive_expression OF ## -Invalid function application + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW OR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE OR YEAR ## -## Ends in an error in state: 106. +## Ends in an error in state: 105. ## ## logical_expression -> compare_expression logical_op . logical_expression [ THEN SCOPE RULE RPAREN END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION ALT ] ## @@ -1021,12 +1574,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW OR YEAR ## compare_expression logical_op ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#124 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW PLUS YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE PLUS YEAR ## -## Ends in an error in state: 82. +## Ends in an error in state: 81. ## ## sum_expression -> mult_expression sum_op . sum_expression [ THEN SCOPE RULE RPAREN OR NOT_EQUAL LESSER_EQUAL LESSER GREATER_EQUAL GREATER EQUAL END_CODE ELSE DEFINITION DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## @@ -1034,24 +1586,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW PLUS YEA ## mult_expression sum_op ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#87 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW WITH YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WE_HAVE ## -## Ends in an error in state: 52. -## -## base_expression -> primitive_expression WITH . constructor [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## primitive_expression WITH -## - -Missing enumeration case for testing if an enumeration value is in a particular enumeration case - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW YEAR -## -## Ends in an error in state: 51. +## Ends in an error in state: 50. ## ## base_expression -> primitive_expression . [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## base_expression -> primitive_expression . OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] @@ -1061,187 +1600,44 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION NOW YEAR ## The known suffix of the stack is as follows: ## primitive_expression ## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#50 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM FOR IDENT IN NOW OF YEAR -## -## Ends in an error in state: 96. -## -## aggregate -> aggregate_func FOR ident IN primitive_expression OF . base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func FOR ident IN primitive_expression OF -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#79 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM FOR IDENT IN NOW YEAR -## -## Ends in an error in state: 95. -## -## aggregate -> aggregate_func FOR ident IN primitive_expression . OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func FOR ident IN primitive_expression -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#78 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM FOR IDENT IN YEAR -## -## Ends in an error in state: 93. -## -## aggregate -> aggregate_func FOR ident IN . primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func FOR ident IN -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#76 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM FOR IDENT YEAR -## -## Ends in an error in state: 92. -## -## aggregate -> aggregate_func FOR ident . IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func FOR ident -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#75 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM FOR YEAR -## -## Ends in an error in state: 91. -## -## aggregate -> aggregate_func FOR . ident IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func FOR -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#74 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION SUM YEAR -## -## Ends in an error in state: 90. -## -## aggregate -> aggregate_func . FOR ident IN primitive_expression OF base_expression [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] -## -## The known suffix of the stack is as follows: -## aggregate_func -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#73 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION CARDINAL CONSEQUENCE BY -## -## Ends in an error in state: 201. -## -## assertion -> option(condition_consequence) . assertion_base [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## option(condition_consequence) -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#182 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION CARDINAL THEN -## -## Ends in an error in state: 170. -## -## condition_consequence -> condition . CONSEQUENCE [ VERTICAL TRUE SUM NOW NOT MONEY_AMOUNT MINUS MATCH LPAREN INT_LITERAL IF IDENT FOR FILLED FALSE EXISTS DEFINED_AS DECIMAL_LITERAL CONSTRUCTOR CARDINAL ] -## -## The known suffix of the stack is as follows: -## condition -## ## WARNING: This example involves spurious reductions. ## This implies that, although the LR(1) items shown above provide an ## accurate view of the past (what has been recognized so far), they ## may provide an INCOMPLETE view of the future (what was expected next). -## In state 42, spurious reduction of production primitive_expression -> CARDINAL -## In state 51, spurious reduction of production base_expression -> primitive_expression -## In state 84, spurious reduction of production mult_expression -> base_expression -## In state 79, spurious reduction of production sum_expression -> mult_expression -## In state 71, spurious reduction of production compare_expression -> sum_expression -## In state 103, spurious reduction of production logical_expression -> compare_expression -## In state 110, spurious reduction of production expression -> logical_expression -## In state 163, spurious reduction of production condition -> UNDER_CONDITION expression +## In state 45, spurious reduction of production primitive_expression -> small_expression ## -Unexpected token after a condition + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION UNDER_CONDITION YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE WITH YEAR ## -## Ends in an error in state: 162. +## Ends in an error in state: 51. ## -## condition -> UNDER_CONDITION . expression [ CONSEQUENCE ] +## base_expression -> primitive_expression WITH . constructor [ THEN SCOPE RULE RPAREN PLUS OR NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] ## ## The known suffix of the stack is as follows: -## UNDER_CONDITION +## primitive_expression WITH ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#21 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V NOW THEN +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION TRUE YEAR ## -## Ends in an error in state: 192. +## Ends in an error in state: 45. ## -## assertion -> VARIES qident WITH_V base_expression . option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] +## primitive_expression -> small_expression . [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION AND ALT ] +## small_expression -> small_expression . ARROW constructor [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] +## small_expression -> small_expression . DOT ident [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## ## The known suffix of the stack is as follows: -## VARIES qident WITH_V base_expression -## -## WARNING: This example involves spurious reductions. -## This implies that, although the LR(1) items shown above provide an -## accurate view of the past (what has been recognized so far), they -## may provide an INCOMPLETE view of the future (what was expected next). -## In state 51, spurious reduction of production base_expression -> primitive_expression +## small_expression ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#173 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES IDENT WITH_V YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL DIV INT_LITERAL YEAR ## -## Ends in an error in state: 191. -## -## assertion -> VARIES qident WITH_V . base_expression option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## VARIES qident WITH_V -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#172 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VARIES YEAR -## -## Ends in an error in state: 189. -## -## assertion -> VARIES . qident WITH_V base_expression option(variation_type) [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## VARIES -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#170 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT_LITERAL DIV INT_LITERAL DIV INT_LITERAL YEAR -## -## Ends in an error in state: 24. +## Ends in an error in state: 23. ## ## literal -> VERTICAL date_int DIV date_int DIV date_int . VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1249,12 +1645,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT ## VERTICAL date_int DIV date_int DIV date_int ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#28 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT_LITERAL DIV INT_LITERAL DIV YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL DIV YEAR ## -## Ends in an error in state: 23. +## Ends in an error in state: 22. ## ## literal -> VERTICAL date_int DIV date_int DIV . date_int VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1262,11 +1657,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT ## VERTICAL date_int DIV date_int DIV ## -Expected date inside "|...|" + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT_LITERAL DIV INT_LITERAL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV INT_LITERAL YEAR ## -## Ends in an error in state: 22. +## Ends in an error in state: 21. ## ## literal -> VERTICAL date_int DIV date_int . DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1274,12 +1669,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT ## VERTICAL date_int DIV date_int ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#26 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT_LITERAL DIV YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL DIV YEAR ## -## Ends in an error in state: 21. +## Ends in an error in state: 20. ## ## literal -> VERTICAL date_int DIV . date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1287,11 +1681,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT ## VERTICAL date_int DIV ## -Expected date inside "|...|" + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT_LITERAL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL INT_LITERAL YEAR ## -## Ends in an error in state: 20. +## Ends in an error in state: 19. ## ## literal -> VERTICAL date_int . DIV date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1299,12 +1693,11 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL INT ## VERTICAL date_int ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#24 + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION VERTICAL YEAR ## -## Ends in an error in state: 18. +## Ends in an error in state: 17. ## ## literal -> VERTICAL . date_int DIV date_int DIV date_int VERTICAL [ WITH WE_HAVE THEN SUCH SCOPE RULE RPAREN PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER INCREASING IN GREATER_EQUAL GREATER EQUAL END_CODE ELSE DOT DIV DEFINITION DECREASING DECLARATION CONSEQUENCE COLON ASSERTION ARROW AND ALT ] ## @@ -1312,229 +1705,35 @@ source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION VERTICAL YEA ## VERTICAL ## -Expected date inside "|...|" + -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON ASSERTION YEAR -## -## Ends in an error in state: 188. -## -## scope_item -> ASSERTION . assertion [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## ASSERTION -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#169 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT DEFINED_AS YEAR -## -## Ends in an error in state: 185. -## -## definition -> qident option(definition_parameters) option(condition_consequence) DEFINED_AS . expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## qident option(definition_parameters) option(condition_consequence) DEFINED_AS -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#166 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT OF IDENT DECREASING -## -## Ends in an error in state: 183. -## -## definition -> qident option(definition_parameters) . option(condition_consequence) DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## qident option(definition_parameters) -## - -Wrong token following function parameter - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT UNDER_CONDITION CARDINAL CONSEQUENCE DECREASING -## -## Ends in an error in state: 184. -## -## definition -> qident option(definition_parameters) option(condition_consequence) . DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## qident option(definition_parameters) option(condition_consequence) -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#165 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION IDENT WITH_V -## -## Ends in an error in state: 182. -## -## definition -> qident . option(definition_parameters) option(condition_consequence) DEFINED_AS expression [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## qident -## -## WARNING: This example involves spurious reductions. -## This implies that, although the LR(1) items shown above provide an -## accurate view of the past (what has been recognized so far), they -## may provide an INCOMPLETE view of the future (what was expected next). -## In state 178, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 160, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) -## - -Only the identifier you wish to define should follow the definition introducing token - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON DEFINITION YEAR -## -## Ends in an error in state: 181. -## -## scope_item -> DEFINITION . definition [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## DEFINITION -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#162 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT DOT YEAR -## -## Ends in an error in state: 179. -## -## separated_nonempty_list(DOT,ident) -> ident DOT . separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] -## -## The known suffix of the stack is as follows: -## ident DOT -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#61 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT NOT SCOPE -## -## Ends in an error in state: 167. -## -## rule_consequence -> option(NOT) . FILLED [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## option(NOT) -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#151 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF IDENT YEAR -## -## Ends in an error in state: 161. -## -## rule -> rule_expr . option(condition_consequence) rule_consequence [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## rule_expr -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#20 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT OF YEAR -## -## Ends in an error in state: 174. -## -## definition_parameters -> OF . ident [ UNDER_CONDITION NOT FILLED DEFINED_AS ] -## -## The known suffix of the stack is as follows: -## OF -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#158 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT UNDER_CONDITION NOW CONSEQUENCE SCOPE -## -## Ends in an error in state: 164. -## -## rule -> rule_expr option(condition_consequence) . rule_consequence [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## rule_expr option(condition_consequence) -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#149 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT WITH_V -## -## Ends in an error in state: 173. -## -## rule_expr -> qident . option(definition_parameters) [ UNDER_CONDITION NOT FILLED ] -## -## The known suffix of the stack is as follows: -## qident -## -## WARNING: This example involves spurious reductions. -## This implies that, although the LR(1) items shown above provide an -## accurate view of the past (what has been recognized so far), they -## may provide an INCOMPLETE view of the future (what was expected next). -## In state 178, spurious reduction of production separated_nonempty_list(DOT,ident) -> ident -## In state 160, spurious reduction of production qident -> separated_nonempty_list(DOT,ident) -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#157 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE IDENT YEAR -## -## Ends in an error in state: 178. -## -## separated_nonempty_list(DOT,ident) -> ident . [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] -## separated_nonempty_list(DOT,ident) -> ident . DOT separated_nonempty_list(DOT,ident) [ WITH_V UNDER_CONDITION OF NOT FILLED DEFINED_AS BY ] -## -## The known suffix of the stack is as follows: -## ident -## - -Wrong token following an identifier - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON RULE YEAR -## -## Ends in an error in state: 159. -## -## scope_item -> RULE . rule [ SCOPE RULE END_CODE DEFINITION DECLARATION ASSERTION ] -## -## The known suffix of the stack is as follows: -## RULE -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#18 - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR COLON YEAR -## -## Ends in an error in state: 158. -## -## code_item -> SCOPE constructor option(scope_use_condition) COLON . nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] -## -## The known suffix of the stack is as follows: -## SCOPE constructor option(scope_use_condition) COLON -## - -Expected a rule, a definition or an assertion - -source_file_or_master: BEGIN_CODE SCOPE CONSTRUCTOR YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR UNDER_CONDITION YEAR ## ## Ends in an error in state: 16. ## +## scope_use_condition -> UNDER_CONDITION . expression [ COLON ] +## +## The known suffix of the stack is as follows: +## UNDER_CONDITION +## + + + +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE CONSTRUCTOR YEAR +## +## Ends in an error in state: 15. +## ## code_item -> SCOPE constructor . option(scope_use_condition) COLON nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] ## ## The known suffix of the stack is as follows: ## SCOPE constructor ## -Expected a colon after scope constructor + -source_file_or_master: BEGIN_CODE SCOPE YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE SCOPE YEAR ## -## Ends in an error in state: 14. +## Ends in an error in state: 13. ## ## code_item -> SCOPE . constructor option(scope_use_condition) COLON nonempty_list(scope_item) [ SCOPE END_CODE DECLARATION ] ## @@ -1542,71 +1741,55 @@ source_file_or_master: BEGIN_CODE SCOPE YEAR ## SCOPE ## -Expecting the constructor for the scope + -source_file_or_master: BEGIN_CODE YEAR +source_file_or_master: LAW_ARTICLE BEGIN_CODE YEAR +## +## Ends in an error in state: 281. +## +## law_article_item -> BEGIN_CODE . code END_CODE [ LAW_TEXT LAW_INCLUDE LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA BEGIN_CODE ] +## +## The known suffix of the stack is as follows: +## BEGIN_CODE +## + + + +source_file_or_master: LAW_ARTICLE LAW_TEXT YEAR +## +## Ends in an error in state: 285. +## +## law_articles_items -> law_article_item . law_articles_items [ LAW_TEXT LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA ] +## +## The known suffix of the stack is as follows: +## law_article_item +## + + + +source_file_or_master: LAW_ARTICLE YEAR +## +## Ends in an error in state: 278. +## +## source_file_item -> law_article . law_articles_items [ LAW_TEXT LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA ] +## +## The known suffix of the stack is as follows: +## law_article +## + + + +source_file_or_master: LAW_HEADING YEAR ## ## Ends in an error in state: 275. ## -## source_file_item -> BEGIN_CODE . code END_CODE [ LAW_TEXT LAW_INCLUDE LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA BEGIN_CODE ] -## -## The known suffix of the stack is as follows: -## BEGIN_CODE -## - -Wrong way to begin a code section - -source_file_or_master: BEGIN_METADATA BEGIN_CODE END_CODE YEAR -## -## Ends in an error in state: 272. -## -## metadata_block -> BEGIN_CODE code END_CODE . END_METADATA [ LAW_TEXT LAW_INCLUDE LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA BEGIN_CODE ] -## -## The known suffix of the stack is as follows: -## BEGIN_CODE code END_CODE -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#268 - -source_file_or_master: BEGIN_METADATA BEGIN_CODE YEAR -## -## Ends in an error in state: 13. -## -## metadata_block -> BEGIN_CODE . code END_CODE END_METADATA [ LAW_TEXT LAW_INCLUDE LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA BEGIN_CODE ] -## -## The known suffix of the stack is as follows: -## BEGIN_CODE -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#13 - -source_file_or_master: BEGIN_METADATA YEAR -## -## Ends in an error in state: 12. -## -## source_file_item -> BEGIN_METADATA . metadata_block [ LAW_TEXT LAW_INCLUDE LAW_HEADING LAW_ARTICLE EOF BEGIN_METADATA BEGIN_CODE ] -## -## The known suffix of the stack is as follows: -## BEGIN_METADATA -## - -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#12 - -source_file_or_master: LAW_TEXT YEAR -## -## Ends in an error in state: 279. -## ## source_file -> source_file_item . source_file [ # ] ## ## The known suffix of the stack is as follows: ## source_file_item ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#275 + source_file_or_master: MASTER_FILE LAW_INCLUDE YEAR ## @@ -1618,8 +1801,7 @@ source_file_or_master: MASTER_FILE LAW_INCLUDE YEAR ## master_file_include ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#5 + source_file_or_master: MASTER_FILE YEAR ## @@ -1631,8 +1813,7 @@ source_file_or_master: MASTER_FILE YEAR ## MASTER_FILE ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#1 + source_file_or_master: YEAR ## @@ -1644,5 +1825,5 @@ source_file_or_master: YEAR ## ## -Unexpected token -To get a better error messsage, file an issue at https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#0 + + diff --git a/src/catala/catala_surface/parser.mly b/src/catala/catala_surface/parser.mly index 291ab050..c7789814 100644 --- a/src/catala/catala_surface/parser.mly +++ b/src/catala/catala_surface/parser.mly @@ -497,21 +497,9 @@ metadata_block: (code, (text, pos)) } -source_file_item: -| title = LAW_ARTICLE { - let (title, id, exp_date) = title in LawArticle { - law_article_name = (title, $sloc); - law_article_id = id; - law_article_expiration_date = exp_date; - } -} -| heading = LAW_HEADING { let (title, precedence) = heading in LawHeading (title, precedence) } +law_article_item: | text = LAW_TEXT { LawText text } -| BEGIN_METADATA code = metadata_block { - let (code, source_repr) = code in - MetadataBlock (code, source_repr) -} -| BEGIN_CODE code_and_pos = code text = END_CODE { +| BEGIN_CODE code_and_pos = code text = END_CODE { let (code, pos) = code_and_pos in CodeBlock (code, (text, pos)) } @@ -519,8 +507,43 @@ source_file_item: LawInclude includ } +law_article: +| title = LAW_ARTICLE { + let (title, id, exp_date) = title in { + law_article_name = (title, $sloc); + law_article_id = id; + law_article_expiration_date = exp_date; + } +} + +law_heading: +| heading = LAW_HEADING { let (title, precedence) = heading in { + law_heading_name = title; + law_heading_precedence = precedence; + } +} + +law_articles_items: +| hd = law_article_item tl = law_articles_items{ hd::tl } +| { [] } + +source_file_item: +| article = law_article items = law_articles_items { + LawStructure (LawArticle (article, items)) +} +| heading = law_heading { + LawStructure (LawHeading (heading, [])) +} +| BEGIN_METADATA code = metadata_block { + let (code, source_repr) = code in + LawStructure (MetadataBlock (code, source_repr)) +} +| text = LAW_TEXT { LawStructure (IntermediateText text) } + source_file: -| i = source_file_item f = source_file { i::f } +| i = source_file_item f = source_file { + i::f +} | EOF { [] } master_file_include: @@ -536,4 +559,48 @@ master_file_includes: source_file_or_master: | MASTER_FILE is = master_file_includes { MasterFile is } -| f = source_file { SourceFile f } +| f = source_file { + (* + now here the heading structure is completely flat because of the + [source_file_item] rule. We need to tree-i-fy the flat structure, + by looking at the precedence of the law headings. + *) + let rec law_struct_list_to_tree (f: program_item list) : program_item list = + match f with + | [] -> [] + | [item] -> [item] + | first_item::rest -> + let rest_tree = law_struct_list_to_tree rest in + begin match rest_tree with + | [] -> assert false (* there should be at least one rest element *) + | rest_head::rest_tail -> + begin match first_item with + | LawStructure (LawArticle _ | MetadataBlock _ | IntermediateText _) -> + (* if an article or an include is just before a new heading or a new article, + then we don't merge it with what comes next *) + first_item::rest_head::rest_tail + | LawStructure (LawHeading (heading, _)) -> + (* here we have encountered a heading, which is going to "gobble" + everything in the [rest_tree] until it finds a heading of + at least the same precedence *) + let rec split_rest_tree (rest_tree: program_item list) + : law_structure list * program_item list = + match rest_tree with + | [] -> [], [] + | (LawStructure (LawHeading (new_heading, _)))::_ + when new_heading.law_heading_precedence <= heading.law_heading_precedence + -> + (* we stop gobbling *) + [], rest_tree + | (LawStructure first)::after -> + (* we continue gobbling *) + let after_gobbled, after_out = split_rest_tree after in + first::after_gobbled, after_out + in + let gobbled, rest_out = split_rest_tree rest_tree in + (LawStructure (LawHeading (heading, gobbled)))::rest_out + end + end + in + SourceFile (law_struct_list_to_tree f) +} diff --git a/src/catala/catala_surface/parser_errors.ml b/src/catala/catala_surface/parser_errors.ml index 4f619c67..4a76e737 100644 --- a/src/catala/catala_surface/parser_errors.ml +++ b/src/catala/catala_surface/parser_errors.ml @@ -4,413 +4,140 @@ let message s = match s with - | 0 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#0\n" - | 1 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#1\n" - | 5 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#5\n" - | 279 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#275\n" - | 12 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#12\n" - | 13 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#13\n" - | 272 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#268\n" - | 275 -> "Wrong way to begin a code section\n" - | 14 -> "Expecting the constructor for the scope\n" - | 16 -> "Expected a colon after scope constructor\n" - | 158 -> "Expected a rule, a definition or an assertion\n" - | 159 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#18\n" - | 178 -> "Wrong token following an identifier\n" - | 173 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#157\n" - | 164 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#149\n" - | 174 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#158\n" - | 161 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#20\n" - | 167 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#151\n" - | 179 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#61\n" - | 181 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#162\n" - | 182 -> "Only the identifier you wish to define should follow the definition introducing token\n" - | 184 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#165\n" - | 183 -> "Wrong token following function parameter\n" - | 185 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#166\n" - | 188 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#169\n" - | 18 -> "Expected date inside \"|...|\"\n" - | 20 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#24\n" - | 21 -> "Expected date inside \"|...|\"\n" - | 22 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#26\n" - | 23 -> "Expected date inside \"|...|\"\n" - | 24 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#28\n" - | 189 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#170\n" - | 191 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#172\n" - | 192 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#173\n" - | 162 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#21\n" - | 170 -> "Unexpected token after a condition\n" - | 201 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#182\n" - | 90 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#73\n" - | 91 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#74\n" - | 92 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#75\n" - | 93 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#76\n" - | 95 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#78\n" - | 96 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#79\n" - | 51 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#50\n" - | 52 -> - "Missing enumeration case for testing if an enumeration value is in a particular enumeration \ - case\n" - | 82 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#87\n" - | 106 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#124\n" - | 54 -> "Invalid function application\n" - | 78 -> "Expected the second term of the comparison\n" - | 87 -> "Expected expression on the right-hand side of multiplication operator\n" - | 84 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#89\n" - | 133 -> "Missing collection for testing whether an element is inside a collection or not\n" - | 100 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#103\n" - | 46 -> "Expected operator or new item after expression\n" - | 49 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#47\n" - | 43 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#44\n" - | 32 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#35\n" - | 140 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#133\n" - | 141 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#134\n" - | 142 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#135\n" - | 148 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#141\n" - | 149 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#142\n" - | 145 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#138\n" - | 151 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#144\n" - | 146 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#139\n" - | 143 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#136\n" - | 33 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#36\n" - | 126 -> "Unmatched parenthesis that should have ended before this\n" - | 55 -> "Expecting an unit for the preceding numeric literal, or an operator\n" - | 35 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#38\n" - | 136 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#127\n" - | 137 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#128\n" - | 138 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#129\n" - | 135 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#126\n" - | 37 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#39\n" - | 112 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#107\n" - | 113 -> "A for all construction expects only one ident\n" - | 114 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#109\n" - | 115 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#110\n" - | 111 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#106\n" - | 197 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#178\n" - | 198 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#179\n" - | 199 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#180\n" - | 120 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#115\n" - | 121 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#116\n" - | 122 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#117\n" - | 123 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#118\n" - | 124 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#119\n" - | 118 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#113\n" - | 62 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#66\n" - | 63 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#67\n" - | 128 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#68\n" - | 42 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#43\n" - | 205 -> "Unexpected token after a scope item\n" - | 208 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#189\n" - | 209 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#190\n" - | 210 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#191\n" - | 211 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#192\n" - | 212 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#193\n" - | 213 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#194\n" - | 214 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#195\n" - | 238 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#219\n" - | 231 -> "Unexpected token, struct scope declaration is over at this point\n" - | 232 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#213\n" - | 228 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#198\n" - | 241 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#222\n" - | 242 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#223\n" - | 243 -> "Scope declarations must have at least one context element\n" - | 244 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#225\n" - | 245 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#226\n" - | 248 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#227\n" - | 249 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#228\n" - | 253 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#250\n" - | 256 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#252\n" - | 257 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#253\n" - | 258 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#254\n" - | 259 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#255\n" - | 260 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#256\n" - | 261 -> - "Unexpected token\n\ - To get a better error messsage, file an issue at \ - https://github.com/CatalaLang/catala/issues with this parser error token: ERROR#257\n" + | 0 -> "\n" + | 1 -> "\n" + | 5 -> "\n" + | 275 -> "\n" + | 278 -> "\n" + | 285 -> "\n" + | 281 -> "\n" + | 13 -> "\n" + | 15 -> "\n" + | 16 -> "\n" + | 17 -> "\n" + | 19 -> "\n" + | 20 -> "\n" + | 21 -> "\n" + | 22 -> "\n" + | 23 -> "\n" + | 45 -> "\n" + | 51 -> "\n" + | 50 -> "\n" + | 81 -> "\n" + | 105 -> "\n" + | 53 -> "\n" + | 77 -> "\n" + | 86 -> "\n" + | 83 -> "\n" + | 132 -> "\n" + | 46 -> "\n" + | 156 -> "\n" + | 48 -> "\n" + | 89 -> "\n" + | 90 -> "\n" + | 91 -> "\n" + | 92 -> "\n" + | 94 -> "\n" + | 95 -> "\n" + | 99 -> "\n" + | 42 -> "\n" + | 31 -> "\n" + | 140 -> "\n" + | 141 -> "\n" + | 147 -> "\n" + | 148 -> "\n" + | 144 -> "\n" + | 150 -> "\n" + | 145 -> "\n" + | 142 -> "\n" + | 139 -> "\n" + | 32 -> "\n" + | 125 -> "\n" + | 54 -> "\n" + | 34 -> "\n" + | 135 -> "\n" + | 136 -> "\n" + | 137 -> "\n" + | 134 -> "\n" + | 36 -> "\n" + | 111 -> "\n" + | 112 -> "\n" + | 113 -> "\n" + | 114 -> "\n" + | 110 -> "\n" + | 119 -> "\n" + | 120 -> "\n" + | 121 -> "\n" + | 122 -> "\n" + | 123 -> "\n" + | 117 -> "\n" + | 61 -> "\n" + | 62 -> "\n" + | 127 -> "\n" + | 63 -> "\n" + | 64 -> "\n" + | 68 -> "\n" + | 69 -> "\n" + | 65 -> "\n" + | 66 -> "\n" + | 41 -> "\n" + | 157 -> "\n" + | 158 -> "\n" + | 177 -> "\n" + | 172 -> "\n" + | 163 -> "\n" + | 173 -> "\n" + | 160 -> "\n" + | 166 -> "\n" + | 178 -> "\n" + | 180 -> "\n" + | 181 -> "\n" + | 183 -> "\n" + | 182 -> "\n" + | 184 -> "\n" + | 187 -> "\n" + | 188 -> "\n" + | 190 -> "\n" + | 191 -> "\n" + | 189 -> "\n" + | 161 -> "\n" + | 169 -> "\n" + | 200 -> "\n" + | 196 -> "\n" + | 197 -> "\n" + | 198 -> "\n" + | 204 -> "\n" + | 207 -> "\n" + | 208 -> "\n" + | 209 -> "\n" + | 210 -> "\n" + | 211 -> "\n" + | 212 -> "\n" + | 213 -> "\n" + | 237 -> "\n" + | 230 -> "\n" + | 231 -> "\n" + | 235 -> "\n" + | 224 -> "\n" + | 227 -> "\n" + | 240 -> "\n" + | 241 -> "\n" + | 242 -> "\n" + | 243 -> "\n" + | 244 -> "\n" + | 245 -> "\n" + | 252 -> "\n" + | 247 -> "\n" + | 248 -> "\n" + | 250 -> "\n" + | 255 -> "\n" + | 256 -> "\n" + | 257 -> "\n" + | 258 -> "\n" + | 259 -> "\n" + | 260 -> "\n" + | 265 -> "\n" + | 11 -> "\n" + | 12 -> "\n" + | 271 -> "\n" | _ -> raise Not_found diff --git a/src/catala/driver.ml b/src/catala/driver.ml index 9bd6a504..66615ef3 100644 --- a/src/catala/driver.ml +++ b/src/catala/driver.ml @@ -64,12 +64,6 @@ let driver (source_file : string) (debug : bool) (unstyled : bool) (wrap_weaved_ Cli.debug_print (Printf.sprintf "Weaving literate program into %s" (match backend with Cli.Latex -> "LaTeX" | Cli.Html -> "HTML" | _ -> assert false)); - let weaved_output = - match backend with - | Cli.Latex -> Latex.ast_to_latex program language - | Cli.Html -> Html.ast_to_html program pygmentize_loc language - | _ -> assert false - in let output_file = match output_file with | Some f -> f @@ -77,21 +71,25 @@ let driver (source_file : string) (debug : bool) (unstyled : bool) (wrap_weaved_ Filename.remove_extension source_file ^ match backend with Cli.Latex -> ".tex" | Cli.Html -> ".html" | _ -> assert false ) in - let weaved_output = - if wrap_weaved_output then - match backend with - | Cli.Latex -> - Latex.wrap_latex weaved_output program.Catala_ast.program_source_files - pygmentize_loc language - | Cli.Html -> - Html.wrap_html weaved_output program.Catala_ast.program_source_files pygmentize_loc - language - | _ -> assert false - else weaved_output + let oc = open_out output_file in + let weave_output = + match backend with + | Cli.Latex -> Latex.ast_to_latex language + | Cli.Html -> Html.ast_to_html pygmentize_loc language + | _ -> assert false in Cli.debug_print (Printf.sprintf "Writing to %s" output_file); - let oc = open_out output_file in - Printf.fprintf oc "%s" weaved_output; + let fmt = Format.formatter_of_out_channel oc in + if wrap_weaved_output then + match backend with + | Cli.Latex -> + Latex.wrap_latex program.Catala_ast.program_source_files pygmentize_loc language fmt + (fun fmt -> weave_output fmt program) + | Cli.Html -> + Html.wrap_html program.Catala_ast.program_source_files pygmentize_loc language fmt + (fun fmt -> weave_output fmt program) + | _ -> assert false + else weave_output fmt program; close_out oc; 0 | Cli.Run -> diff --git a/src/catala/literate_programming/html.ml b/src/catala/literate_programming/html.ml index 9115e3a4..8760ce80 100644 --- a/src/catala/literate_programming/html.ml +++ b/src/catala/literate_programming/html.ml @@ -27,20 +27,21 @@ let raise_failed_pygments (command : string) (error_code : int) : 'a = (Printf.sprintf "Weaving to HTML failed: pygmentize command \"%s\" returned with error code %d" command error_code) -let wrap_html (code : string) (source_files : string list) (custom_pygments : string option) - (language : Cli.backend_lang) : string = +let wrap_html (source_files : string list) (custom_pygments : string option) + (language : Cli.backend_lang) (fmt : Format.formatter) (wrapped : Format.formatter -> unit) : + unit = let pygments = match custom_pygments with Some p -> p | None -> "pygmentize" in let css_file = Filename.temp_file "catala_css_pygments" "" in let pygments_args = [| "-f"; "html"; "-S"; "colorful"; "-a"; ".catala-code" |] in let cmd = - Printf.sprintf "%s %s > %s" pygments (String.concat " " (Array.to_list pygments_args)) css_file + Format.sprintf "%s %s > %s" pygments (String.concat " " (Array.to_list pygments_args)) css_file in let return_code = Sys.command cmd in if return_code <> 0 then raise_failed_pygments cmd return_code; let oc = open_in css_file in let css_as_string = really_input_string oc (in_channel_length oc) in close_in oc; - Printf.sprintf + Format.fprintf fmt "\n\