Skip to content

Commit

Permalink
Update outer parser endColumn (#2546)
Browse files Browse the repository at this point in the history
Co-authored-by: rv-jenkins <[email protected]>
Co-authored-by: Bruce Collie <[email protected]>
  • Loading branch information
3 people authored Apr 22, 2022
1 parent cc655bb commit 9f8e454
Show file tree
Hide file tree
Showing 35 changed files with 71 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Error] Compiler: Found syntax declaration in proof module. Only tokens for existing sorts are allowed.
Source(syntax-spec.k)
Location(6,18,6,28)
Location(6,18,6,29)
[Error] Compiler: Found syntax declaration in proof module. Only tokens for existing sorts are allowed.
Source(syntax-spec.k)
Location(7,5,7,12)
Location(7,5,7,13)
[Error] Compiler: Had 2 structural errors.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Compiler: Symbol 'foo(_)_CHECKUNUSEDSYMBOL_Foo_Int' defined but not used. Add the 'unused' attribute if this is intentional.
Source(checkUnusedSymbol.k)
Location(9,18,9,25)
Location(9,18,9,26)
[Error] Compiler: Had 1 structural errors.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Requiring a K file in the K builtin directory via a deprecated filename. Please replace "ffi.k" with "ffi.md".
Source(requireBuiltinK.k)
Location(1,1,1,15)
Location(1,1,1,16)
6 changes: 3 additions & 3 deletions k-distribution/tests/regression-new/checks/binder.k.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Error] Compiler: Binder productions must have at least two nonterminals.
Source(binder.k)
Location(6,20,6,33)
Location(6,20,6,34)
[Error] Compiler: Attribute value for 'binder' attribute is not supported.
Source(binder.k)
Location(8,20,8,52)
Location(8,20,8,53)
[Error] Compiler: First child of binder must have a sort with the 'KVAR.KVar' hook attribute.
Source(binder.k)
Location(10,20,10,45)
Location(10,20,10,46)
[Error] Compiler: Had 3 structural errors.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Outer Parser: bracket productions should have exactly one non-terminal of the same sort as the production.
Source(checkBracket.k)
Location(2,18,2,42)
Location(2,18,2,43)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Outer Parser: bracket productions should have exactly one non-terminal of the same sort as the production.
Source(checkBracketSubsort.k)
Location(4,18,4,36)
Location(4,18,4,37)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Outer Parser: bracket productions should have exactly one non-terminal of the same sort as the production.
Source(checkBracketSupersort.k)
Location(4,16,4,36)
Location(4,16,4,37)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Outer Parser: bracket productions should have exactly one non-terminal of the same sort as the production.
Source(checkBracketUnrelatedsort.k)
Location(3,18,3,36)
Location(3,18,3,37)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Compiler: Could not find sorts: [MisTypedCell]
Source(checkCellSortDeclFail.k)
Location(12,16,12,27)
Location(12,16,12,28)
[Error] Compiler: Had 1 parsing errors.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Could not find sorts: [MInt{6}]
Source(checkInstantiation.k)
Location(9,20,9,31)
Location(9,20,9,32)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: KItem can not be extended to be a list sort.
Source(checkListDecl1.k)
Location(12,18,12,29)
Location(12,18,12,30)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Circular lists are not allowed.
Source(checkListDecl2.k)
Location(12,16,12,27)
Location(12,16,12,28)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Inline list declarations are not allowed.
Source(checkListDecl3.k)
Location(12,26,12,37)
Location(12,26,12,38)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Outer Parser: Could not find any productions for tag: a
Source(checkUndeclaredTags.k)
Location(2,3,2,25)
Location(2,3,2,26)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Outer Parser: Module DUPLICATEMODULE previously declared at Source(duplicateModule.k) and Location(1,1,3,9)
[Error] Outer Parser: Module DUPLICATEMODULE previously declared at Source(duplicateModule.k) and Location(1,1,3,10)
Source(duplicateModule.k)
Location(5,1,7,9)
Location(5,1,7,10)
[Error] Outer Parser: Had 1 outer parsing errors.
2 changes: 1 addition & 1 deletion k-distribution/tests/regression-new/checks/formatatt.k.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Compiler: Invalid colors attribute: expected 5 colors, found 4 colors instead.
Source(formatatt.k)
Location(4,19,4,119)
Location(4,19,4,120)
[Error] Compiler: Had 1 structural errors.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Error] Compiler: Cannot add new constructors to hooked sort K
Source(invalidConstructor.k)
Location(3,16,3,20)
Location(3,16,3,21)
[Error] Compiler: Cannot add new constructors to hooked sort Int
Source(invalidConstructor.k)
Location(4,18,4,22)
Location(4,18,4,23)
[Error] Compiler: Sort Int was declared as a token. Productions of this sort can only contain [function] or [token] labels.
Source(invalidConstructor.k)
Location(4,18,4,22)
Location(4,18,4,23)
[Error] Compiler: Had 3 structural errors.
14 changes: 7 additions & 7 deletions k-distribution/tests/regression-new/checks/invalidFormat.k.out
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[Error] Compiler: Invalid format attribute: unfinished escape sequence.
Source(invalidFormat.k)
Location(3,18,3,34)
Location(3,18,3,35)
[Error] Compiler: Invalid colors attribute: expected 2 colors, found 1 colors instead.
Source(invalidFormat.k)
Location(5,18,5,50)
Location(5,18,5,51)
[Error] Compiler: Invalid format escape sequence '%0'. Expected a number between 1 and 1
Source(invalidFormat.k)
Location(9,16,9,31)
Location(9,16,9,32)
[Error] Compiler: Invalid format escape sequence '%2'. Expected a number between 1 and 1
Source(invalidFormat.k)
Location(11,16,11,31)
Location(11,16,11,32)
[Error] Compiler: Invalid format escape sequence referring to regular expression terminal 'r"c"'.
Source(invalidFormat.k)
Location(13,16,13,32)
Location(13,16,13,33)
[Error] Compiler: Expected format attribute on production with regular expression terminal. Did you forget the 'token' attribute?
Source(invalidFormat.k)
Location(15,16,15,19)
Location(15,16,15,20)
[Error] Compiler: Expected format attribute on production with regular expression terminal.
Source(invalidFormat.k)
Location(17,16,17,23)
Location(17,16,17,24)
[Error] Compiler: Had 7 structural errors.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Inconsistent token precedence detected.
Source(invalidPrec.k)
Location(3,17,3,33)
Location(3,17,3,34)
12 changes: 6 additions & 6 deletions k-distribution/tests/regression-new/checks/invalidStrict.k.out
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[Error] Compiler: Cannot put a strict attribute on a production with no nonterminals
Source(invalidStrict.k)
Location(4,16,4,32)
Location(4,16,4,33)
[Error] Compiler: Expecting a number between 1 and 1, but found 2 as a strict position in [2]
Source(invalidStrict.k)
Location(6,16,6,35)
Location(6,16,6,36)
[Error] Compiler: Invalid strict attribute containing invalid semicolons. Must contain 0, 1, 2, or an even number of components.
Source(invalidStrict.k)
Location(8,16,8,45)
Location(8,16,8,46)
[Error] Compiler: Cannot heat a nonterminal of sort K. Did you mean KItem?
Source(invalidStrict.k)
Location(10,16,10,30)
Location(10,16,10,31)
[Error] Compiler: Cannot heat a nonterminal of sort K. Did you mean KItem?
Source(invalidStrict.k)
Location(12,16,12,40)
Location(12,16,12,41)
[Error] Compiler: Cannot heat a HOLE of sort K. Did you mean to sort it to KItem?
Source(invalidStrict.k)
Location(20,15,20,21)
Expand All @@ -21,5 +21,5 @@
Location(22,15,22,19)
[Error] Compiler: Cannot heat a nonterminal of sort K. Did you mean KItem?
Source(invalidStrict.k)
Location(26,16,26,39)
Location(26,16,26,40)
[Error] Compiler: Had 8 structural errors.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Error] Compiler: Symbol #KToken is not unique. Previously defined as: syntax KBott ::= "#token" "(" KString "," KString ")" [klabel(#KToken), symbol]
Source(invalidSymbol.k)
Location(3,16,3,46)
Location(3,16,3,47)
[Error] Compiler: Symbol foo is not unique. Previously defined as: syntax Bar ::= "bar" "(" ")" [klabel(foo), symbol]
Source(invalidSymbol.k)
Location(6,16,6,42)
Location(6,16,6,43)
[Error] Compiler: Had 2 structural errors.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Compiler: Definition is missing function isKResult required for strictness. Please either declare sort KResult or declare 'syntax Bool ::= isKResult(K) [symbol, function]'
while executing phase "resolving heat and cool attributes" on sentence at
Source(missingKResult.k)
Location(13,18,13,46)
Location(13,18,13,47)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Could not find module: FOO
Source(missingModule.k)
Location(2,3,2,13)
Location(2,3,2,14)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Error] Compiler: Could not find sorts: [Float]
Source(noImportFloat.k)
Location(3,19,3,28)
Location(3,19,3,29)
4 changes: 2 additions & 2 deletions k-distribution/tests/regression-new/checks/tokenCheck.k.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Error] Compiler: Sort X was declared as a token. Productions of this sort can only contain [function] or [token] labels.
Source(tokenCheck.k)
Location(10,16,10,21)
Location(10,16,10,22)
[Error] Compiler: Sort Y was declared as a token. Productions of this sort can only contain [function] or [token] labels.
Source(tokenCheck.k)
Location(13,16,13,16)
Location(13,16,13,17)
[Error] Compiler: Had 2 structural errors.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kore-exec: [] Warning (WarnTrivialClaim):
#Top
[Warning] Compiler: Found syntax declaration in proof module. This will not be visible from the main module.
Source(proofSyntax-spec.k)
Location(16,16,16,18)
Location(16,16,16,19)
[Warning] Compiler: Found syntax declaration in proof module. This will not be visible from the main module.
Source(proofSyntax-spec.k)
Location(22,16,22,18)
Location(22,16,22,19)
3 changes: 3 additions & 0 deletions k-distribution/tests/regression-new/issue-1602/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ KOMPILE_FLAGS+=--gen-bison-parser --bison-stack-max-depth 12000
KRUN_FLAGS=--dry-run --no-expand-macros 1>/dev/null 2>/dev/null

include ../../../include/kframework/ktest.mak

# output is already ignored, no need to update results
update-results: CHECK=| diff -
8 changes: 4 additions & 4 deletions k-distribution/tests/regression-new/issue-1760/test.k.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[Warning] Compiler: Non exhaustive match detected: `.Kat_TEST-SYNTAX_Kat`(.KList)
Source(test.k)
Location(7,18,7,71)
Location(7,18,7,72)
[Warning] Compiler: Non exhaustive match detected: `notKat_`(_)
Source(test.k)
Location(20,19,20,171)
Location(20,19,20,172)
[Warning] Compiler: Non exhaustive match detected: `_andKat_`(_,_)
Source(test.k)
Location(21,19,21,183)
Location(21,19,21,184)
[Warning] Compiler: Non exhaustive match detected: `_orKat__TEST_Kat_Kat_Kat`(_,_)
Source(test.k)
Location(22,19,22,170)
Location(22,19,22,171)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Error] Outer Parser: Module LIST previously declared at Source...
Source(test.k)
Location(1,1,3,9)
Location(1,1,3,10)
[Error] Outer Parser: Had 1 outer parsing errors.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ KOMPILE_BACKEND=llvm
include ../../../../include/kframework/ktest.mak

CHECK := $(REMOVE_PATHS) $(CHECK)
update-results: CHECK := $(REMOVE_PATHS) $(CHECK)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DEFDIR=some/nested/path
include ../../../../include/kframework/ktest.mak

CHECK := $(REMOVE_PATHS) $(CHECK)
update-results: CHECK := $(REMOVE_PATHS) $(CHECK)

clean:
rm -rf $(KOMPILED_DIR) .depend-tmp .depend .kompile-* .krun-* .kprove-* .kbmc-* kore-exec.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ all:
$(MAKE) -C ../imp-llvm clean

clean:
update-results:
2 changes: 2 additions & 0 deletions k-distribution/tests/regression-new/llvm-krun/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ include ../../../include/kframework/ktest.mak

clean:
rm -rf test.kore $(KOMPILED_DIR) .depend-tmp .depend .kompile-* .krun-* .kprove-* kore-exec.tar.gz

update-results: CHECK=> test.out
22 changes: 11 additions & 11 deletions k-distribution/tests/regression-new/nonexhaustive/test.k.out
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
[Error] Compiler: Non exhaustive match detected: `foo(_)_TEST_Int_Int`(#token("3","Int"))
Source(test.k)
Location(19,16,19,46)
Location(19,16,19,47)
[Error] Compiler: Non exhaustive match detected: `foo2(_)_TEST_Int_Foo`(`baz()_TEST_Foo`(.KList))
Source(test.k)
Location(24,16,24,47)
Location(24,16,24,48)
[Error] Compiler: Non exhaustive match detected: `foo2a(_)_TEST_Int_Bar`(`stuff(_)_TEST_Bar_Foo`(`baz()_TEST_Foo`(.KList)))
Source(test.k)
Location(29,16,29,48)
Location(29,16,29,49)
[Error] Compiler: Non exhaustive match detected: `foo3(_)_TEST_Int_String`(#token("\"3\"","String"))
Source(test.k)
Location(35,16,35,50)
Location(35,16,35,51)
[Error] Compiler: Non exhaustive match detected: `foo4(_)_TEST_Int_Bytes`(_)
Source(test.k)
Location(41,16,41,49)
Location(41,16,41,50)
[Error] Compiler: Non exhaustive match detected: `foo10(_)_TEST_Int_Float`(#token("3.0","Float"))
Source(test.k)
Location(89,16,89,50)
Location(89,16,89,51)
[Error] Compiler: Non exhaustive match detected: `foo10a(_)_TEST_Int_Float`(#token("0.0","Float"))
Source(test.k)
Location(96,16,96,51)
Location(96,16,96,52)
[Error] Compiler: Non exhaustive match detected: `foo11(_)_TEST_Int_Bool`(#token("false","Bool"))
Source(test.k)
Location(99,16,99,49)
Location(99,16,99,50)
[Error] Compiler: Non exhaustive match detected: `foo11a(_)_TEST_Int_Bool`(#token("true","Bool"))
Source(test.k)
Location(102,16,102,50)
Location(102,16,102,51)
[Error] Compiler: Non exhaustive match detected: `foo12(_)_TEST_Int_KVar`(#token("_3","KVar"))
Source(test.k)
Location(106,16,106,49)
Location(106,16,106,50)
[Error] Compiler: Non exhaustive match detected: `foo13(_)_TEST_Int_StringBuffer`(_)
Source(test.k)
Location(111,16,111,57)
Location(111,16,111,58)
[Error] Compiler: Had 11 pattern matching errors.
2 changes: 1 addition & 1 deletion kernel/src/main/javacc/Outer.jj
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public class Outer {
uses of this function).
*/
private <T extends ASTNode> T markLoc(Location locPrefix, T node) {
return markLocExplicit(Location.apply(locPrefix.startLine(), locPrefix.startColumn(), token.endLine, token.endColumn), node);
return markLocExplicit(Location.apply(locPrefix.startLine(), locPrefix.startColumn(), token.endLine, token.endColumn + 1), node);
}

/** Marks 'node' with the location in 'loc'.Returns 'node' (which
Expand Down

0 comments on commit 9f8e454

Please sign in to comment.