Skip to content

Commit

Permalink
Merge pull request #28 from mulesoft/final-yaml-recovery
Browse files Browse the repository at this point in the history
Final yaml recovery
  • Loading branch information
pope1838 authored Aug 19, 2020
2 parents a035f5a + 0bc56ce commit 0f70195
Show file tree
Hide file tree
Showing 35 changed files with 755 additions and 85 deletions.
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pipeline {
}
stage('Publish') {
when {
branch 'master'
anyOf {
branch 'master'
}
}
steps {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ val settings = Common.settings ++ Common.publish ++ Seq(
organization := "org.mule.syaml",
name := "syaml",
version := {
val major = 0
val minor = 7
val major = 1
val minor = 0

lazy val build = sys.env.getOrElse("BUILD_NUMBER", "0")
lazy val branch = sys.env.get("BRANCH_NAME")
Expand Down
5 changes: 1 addition & 4 deletions shared/src/main/scala/org/mulesoft/lexer/BaseLexer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ abstract class BaseLexer[T <: Token](var input: LexerInput, val positionOffset:
val sourceName: String = input.sourceName
private var _tokenData: TokenData[T] = _

/** initialize the current _tokenData (may be invoking advance) */
initialize()

private def position = input.position + positionOffset

/** Check if there are emitted tokens */
def nonTokenEmitted: Boolean = tokenQueue.isEmpty

/** Init must initialize the current _tokenData (may be invoking advance) */
protected def initialize()
def initialize(): BaseLexer[T]

/** get the current token in the input stream. */
override def token: T = _tokenData.token
Expand Down
7 changes: 7 additions & 0 deletions shared/src/main/scala/org/mulesoft/lexer/LexerContext.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.mulesoft.lexer

trait LexerContext

object StreamLexerContext extends LexerContext

object SingleDocumentLexerContext extends LexerContext
3 changes: 2 additions & 1 deletion shared/src/main/scala/org/yaml/lexer/JsonLexer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ final class JsonLexer private (input: LexerInput, positionOffset: Position = Pos
extends BaseLexer[YamlToken](input, positionOffset) {

/** Init must initialize the stack and the current _tokenData (may be invoking advance) */
override protected def initialize(): Unit = {
override def initialize(): JsonLexer = {
emit(BeginDocument)
advance()
this
}

/**
Expand Down
Loading

0 comments on commit 0f70195

Please sign in to comment.